Changes

Jump to navigation Jump to search
1,098 bytes added ,  08:51, 12 August 2011
Example for directory tree setup
In addition, you have to keep in mind that when compiling a product or component file, ConTeXt goes "up" to the project file and compiles everything it finds in there that is not a <cmd>product</cmd> (e.g. table of content, sectioning commands, text, <cmd>component</cmd> etc.). So all the things on project level have to be put inside a <cmd>product</cmd>, otherwise they will show up in the individual components (or products), too. That also makes it problematic to use <cmd>component</cmd> directly inside a project file, i.e. you have to use <cmd>product</cmd>, you can't skip it.
==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>
==Comand =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:  env_mymag.tex project_mymag.tex 2011-01/prd_issue2011-01.tex 2011-02/prd_issue2011-02.tex 2011-03/prd_issue2011-03.tex ... 2011-03/c_editorial.tex 2011-03/c_article1.tex ... 2011-03/img/author1.jpg ... general_img/logo.pdf ... '''Environment'''<texcode>\startenvironment env_mymag\project project_mymag ... % where \product and \component look for TeX input files\usepath[{2011-01,2011-02,2011-03}] % where to look for images\doifmodeelse{*product} {\setupexternalfigures[directory={../general_img}]} {\setupexternalfigures[directory={../general_img, img}]} ...\stopenvironment</texcode> '''Product'''<texcode>\startproduct prd_issue2011-01\project project_mymag\environment env_mymag \component c_editorial\component c_article1... \stopproduct</texcode> (This is untested. I assume that ConTeXt looks automatically into parent directories.) ==Command behaviour==
Depending on the (start-stop) environment a command will either load a file once, or many times or not at all. The following table specifies what happens when:

Navigation menu