Changes

Jump to navigation Jump to search
1,577 bytes added ,  13:42, 26 December 2021
Add description regarding --errors
Changes the output document file name. ConTeXt creates the output document file in the current working directory; this option cannot create or move the output document in a different directory. Instead, change the working directory before running ConTeXt and use the ''--path'' option to configure where ConTeXt searches for files to process.
== --errors ==
ConTeXt is sometimes quite liberal when it comes to non-syntactical errors in the source files. Missing fonts, missing characters in a font, missing references do not automatically abort a run or exit with a non-successful return value. To report possible issues, either compile with <code>--errors</code> or use
 
<texcode>
\enabledirectives
[logs.errors]
</texcode>
 
in the source file. Example:
 
<texcode>
\starttext
%% missing figure
\externalfigure [nonexistent]
\stoptext
</texcode>
 
Compiling with <code>context --noconsole --silent --nostatistics file.tex</code> would result in no output (as well as a successful return value). If, on the other hand, compiled with <code>context --noconsole --silent --nostatistics --errors file.tex</code> the output would be:
 
<texcode>
error logging > start possible issues
graphics > start missing figures
graphics > foo
graphics > stop missing figures
error logging > stop possible issues
</texcode>
 
The return value would still be zero (success), though. To have the return value reflect possible found issues, patterns can be used. Example:
 
<texcode>
\enabledirectives
[logs.errors=*]
</texcode>
 
Alternatively the patterns can be provided as a compile switch <code>--errors='*'</code>. The quotes are required to prevent shell expansion. With these options, the <code>context</code> would return 1 (failure) if problems are found.
 
Note that only some of the problems are reported, some of which might not be critical and other, possibly critical problems, are not detected.
[[Category:Basics]]
[[Category:Tools]]
69

edits

Navigation menu