0
votes

I am using doxygen for a development. I am supplementing some requirements information with markdown files that doxygen will consume at the same time as the source code. Each markdown requirements file needs to have it's own TOC. using the [TOC] or \tableofcontents doxygen commands works perfectly well for this if you are using the HTML output. However, the final document must be a pdf and will be generated via the latex output.

After testing the latex output today, I have noticed that the [TOC] that is rendered in the HTML for each page is not placed into the latex output.

How would I go about adding an individual [TOC] to each markdown requirements page in the latex output?

Knowing that latex generates the TOCs on a second run of the compiler, I would imagine that there is no way to generate one just for those particular pages. I would, instead, have to generate the markdown files as their own documents, then somehow include them in the main doc? How would I do this?

I hope there is something easier.

ANSWER: From the doxygen documentation, it indicates that one must specify latex in the command in order for it to render in latex.

\tableofcontents{latex,html}

This will render a TOC in both html and latex.

  • Thank you Albert
1
Which version of doxygen?albert

1 Answers

1
votes

From the documentation of the 1.8.20 version:

24.112 \tableofcontents['{'[option[:level]][,option[:level]]*'}']

Creates a table of contents at the top of a page, listing all sections and subsections in the page. The option can be HTML or LaTeX or XML or DocBook. When a level is specified this means the maximum nesting level that is shown. The value of level should be in the range 1..5, values outside this range are considered to be 5. In case no level is specified level is set to 5 (show all) In case no option. is specified \tableofcontents acts as if just the option HTML and XML was specified. In case of multiple \tableofcontents commands in a page the option(s) will be used additional to the already specified option(s), but only the last level of an option is valid.

Warning

This command only works inside related page documentation and not in other documentation blocks and only has effect in the the specified output!

See also: https://www.doxygen.nl/manual/commands.html#cmdtableofcontents