Changes

Jump to navigation Jump to search
550 bytes added ,  11:08, 10 September 2020
no edit summary
< [[The ConTeXt Way]] | [[Structurals]] >=Introduction=
==Introduction==ConTeXt knows no document classes (as LaTeX does). You can define your [[Layout|layout]] yourself.
ConTeXt knows no document classes (as LaTeX does). You can define your [[Layout|layout]] yourself. If you use the same layout for several products, save it as an '''environment''' file.
:<i><b>Note</b>: the project structure explained on this page is not the only way to handle complex documents. If you are working on a project with a single output file, it may be simpler to use {{cmd|startdocument}} (perhaps in combination with {{cmd|usemodule}} or {{cmd|environment}} and {{cmd|startcomponent}} as explained below) and ignore the elaborate project and product setups.</i>  If you use the same layout for several related products, it may make sense to use the project support in ConTeXt. You then save your layout settings as an '''environment''' file, and you can reuse various document parts in multiple products. How to split up a large project, say a bookcollection of books, in several handy parts? – Use ConTeXt's project management facilities.
* a '''project''' links one or more '''products''' to their environment
While you can compile ("tex") products and single components, the project is not intended for compiling; trying might lead to infinite inclusion loops and the error message "TeX capacity exceeded".
==File and directory setup==
===Naming conventions===
[[User:Hraban|Hraban]] uses and suggests the following naming conventions
There's a Python script <tt>contextproject.py</tt> at Hraban's [http://github.com/fiee/tools/blob/master/contextproject.py github repository] to help creating the files (.ini files can be used for initial content). This functionality would be nice to be integrated in any editor supporting ConTeXt...
===Example files===
'''Project'''
</texcode>
===Subdirectories===
If you keep all files in one directory, it tends to get confusing. Here’s a structured example where we keep all parts of one product together:
ConTeXt automatically looks into parent directories.
==Command behaviour==
Within a <code>\start...\stop...</code> environment, project, product, and environment definition files are loaded only once, while component files are loaded at every mention. In addition, certain loading commands are ignored inside certain environments -- for example, it makes no sense to load a <code>\component</code> inside a <code>\startenvironment</code> block. The table below gives an overview.
|}
==See also==
Hans Hagen (2011) [http://pragma-ade.com/general/magazines/mag-1101.pdf Project Structure], ConTeXt magazine #1101.
 
 
[[Category:Basics]]
[[Category:Tools]]

Navigation menu