6.2 LaTeX output

The latex output driver produces LaTeX source from internal DOM tree. Output is written in doc/latex directory.

Use of this driver can be enforced using the doc_format option either in the doc/mkdoc.conf file or on the command line with --doc-format latex.

Customization [link] 

A default latex_head.tmpl file is automatically copied to the doc_path directory when you first use this driver.

This file is used as the LaTeX document header and can be modified to suite your needs. It contains all LaTeX source before the \begin{document} directive.

Some special tokens of the form @@doc_token@@ are replaced by associated configuration values in the LaTeX header file. This allows inserting title, author name and other such things. If an associated configuration value is not defined, the whole line containing the token is discarded.

Some LaTeX packages are optional. Removing a \usepackage directive from the header file for an optional package will be detected and MkDoc will prevent use of that package in generated LaTeX source. This may however affect the quality of the output document.

Related configuration [link] 

Some configurations options are useful when using this output driver:

  • latex_use_parts option enables use of the \part sectioning directive in generated output. This may be changed according to LaTeX document class in use.

  • latex_use_chapters option enables use of the \chapter sectioning directive in generated output. This may be changed according to LaTeX document class in use.

Generated document [link] 

The output LaTeX source is written in doc/latex/doc.tex file by default. This can be changed with the output_filename and output_path configuration options.

The generated file must be further processed with LaTeX. The following example shows how to use pdflatex to generate a pdf file:

mkdoc --doc-format latex
cd doc/latex
pdflatex doc.tex
pdflatex doc.tex

If you used the @index tag, do not forget to run makeindex too:

mkdoc --doc-format latex
pdflatex doc.tex
makeindex main.idx # for each index name used
pdflatex doc.tex
pdflatex doc.tex
Valid XHTML 1.0 StrictGenerated by diaxen on Wed Jan 27 15:46:24 2021 using MkDoc