DVI or PDF from LaTeX

Short name: “tmpdvi” or “tmppdf”.

There are two very similar steps. The only difference is that parameter names are a bit different (tmpdvi_xxx vs tmppdf_xxx).

Parameters:

tmppdf_in: input LaTeX file. Default: $(patch_tex).

tmppdf_out: output PDF file. Default, can't be changed: $(noext $(tmppdf_in)).pdf for tmppdf, $(noext $(tmpdvi_in)).dvi for tmpdvi.

tmppdf_log: TeX log file. Default, can't be changed: $(noext $(tmppdf_in)).log.

tmppdf_aux, tmppdf_outout, tmppdf_toc: TeX auxiliary files. Default, can't be changed: (noext $(tmppdf_in)).aux, (noext $(tmppdf_in)).out, (noext $(tmppdf_in)).toc, correspodingly.

tmppdf_image_dirs: array of path names for images. Default: ['images/pdf'] for tmppdf, ['images/eps'] for tmpdvi.

tmppdf_rerun_max: maximal number of re-running TeX. Default: 4.

tmppdf_include_dirs: array of path names for included files. Default: $(supportdir).

tmppdf_rerun_message: notification message before re-running TeX. Default: “re-running TeX”.

tmppdf_rerun_nomore_message: Default: “After $(tmppdf_rerun_max) attempts, re-run is still required. Human inspection is required.”

Actions:

If the file $(patch_error) exists, go to the step “Patch Work, Problems”.

Before running LaTeX, set the environment variable TEXINPUTS. It consist of “:”-separated (UNIX) or “;”-separated (Windows) list of paths, which come from the variables $(tmppdf_include_dirs), $(tmppdf_image_dirs), and the original TEXINPUTS. Paths in $(tmppdf_include_dirs) and $(tmppdf_image_dirs) are relative to the $(basedir). Before adding them to TEXINPUTS, Consodoc converts them to the absolute paths.

Run LaTeX in quiet, batch mode using a helper object. The helper object checks LaTeX logs and detects if re-run is required and collects warnings and errors.

Check if re-run is required. If required, repeat generation. Repeat until there is no need to re-run or $(tmppdf_rerun_max) attempts are performed. The latter is the error. Print the message $(tmppdf_rerun_nomore_message). Handle the error.

Print the warnings. Print the errors. If errors exist, it's an error.

In case of error, delete the resulted PDF file.