purge aux files

From Wiki
Jump to navigation Jump to search

When typesetting a TeX file, ConTeXt creates a certain number of auxiliary files, of which some remain when the corresponding PDF file is produced (such as .log file, a utility file .tuc, or synctex.gz file if SyncTex has been invoked). When using ConTeXt (that is mkiv) from a Terminal window (command line) to typeset my-jobname.tex one can issue an optional flag --purge. That is one says

context my-jobname.tex --purge

to remove all auxiliary files, except the .tuc file, and the synctex.gz file if the --synctex option flag has been invoked. Upon saying

context my-jobname.tex --purgeall

one removes all auxiliary files, except the synctex.gz file if SyncTex has been invoked.

Beginning with ConTeXt version 2013.09.03 10:22, there is a new possibility to pass such options when typesetting, both with a Terminal command line or a dedicated editor such as TeXShop on Mac OS X, or TeXWorks on Mac OS X or Windows. In order to use this new capability of ConTeXt, one can create a file named for instance

 my-preferences.ctx 

which contains for instance the following lines:

<?xml version='1.0' standalone='yes'?>
<ctx:job>
   <ctx:message>default flags</ctx:message>
   <ctx:flags>
       <ctx:flag>purgeall</ctx:flag>
       <ctx:flag>synctex=zipped</ctx:flag>
   </ctx:flags>
</ctx:job>

This file has to be put for instance in your

 texmf-local/tex/context 

directory. Then on top of the file my-jobname.tex one has to say:

 % ctxfile=my-preferences 

in order to pass all the optional flags contained in my-preferences.ctx to the mkiv engine. By having several preferences.ctx files, one can have different environments for the typesetting.