Latex post process script

Post latex compilations

Extra user actions can be processed on the latex file produced by the XSL stylesheets or on its temporary working files produced by the latex compilation.

For instance, in the documents I write the cover page must display the number of pages of the document, but written in full letters (e.g. 23 is written “twenty three”). The latex post process script is then helpfull, and in this particular case it patches the .aux file.

The post process script is called just before the last latex compilation, and takes one parameter, the latex file compiled by the tool.

Post latex compilations

The latex compilations done once the script is called depend on the return code of the script:

  • When the return code is 0, dblatex continues the compilation as many times as necessary.

  • When the return code is 1, no more compilation is done by dblatex. This case is useful if the script needs to control precisely the number of compilation to apply. It is up to the script to perform the expected compilations.

    To do so, the script can retrieve in the LATEX environment variable the actual compiler used by dblatex.

  • When the return code is another value, an error is raised to signal a failed post process script execution.