5
votes

I would like to be able to edit LaTeX parts of some Doxygen comments externally with some suitable editor. I would use that only for complex environments. To do that, I figured I can have LaTeX-only files and include them from Doxygen. I did create Doxygen aliases for \begin and \end to make the syntax compatible.

(For example, I know how to set-up Emacs/AUCTex for working with LaTeX snippets that have no preamble and document structure.)

Is there a way to include the contents of a .tex file inside a Doxygen comment? I look for something analogous to \htmlinclude, but for TeX files. Is there some way to emulate the functionality, given my requirements for having a TeX-only external source?

2
We now have a dedicated Q&A site for TeX questions. Please ask your question again at tex.stackexchange.comAndrew Arnold
Did you ever figure this out? I'm trying to do the same - I've tried several variations on \include and \verbinclude, but I can't seem to get it working...Xavier Holt
Sorry, but I couldn't find a way to do it at the time, even though I read through the documentation of Doxygen. The inquiry was for educational purposes, so I gave up eventually.simeonz

2 Answers

3
votes

You may use something like

\latexonly
\input <file>
\endlatexonly

where <file> is the path to the file to include, either absolute or relative to the directory in which the latex documentation is generated.

0
votes

Have you tried the \verbinclude command? This command includes any file verbatim in the documentation (in contrast to \include, which is used to include source files).

From the doxygen manual:

\verbinclude <file-name>

This command includes the file <file-name> verbatim in the documentation. The command is equivalent to pasting the file in the documentation and placing \verbatim and \endverbatim commands around it.

Files or directories that doxygen should look for can be specified using the EXAMPLE_PATH tag of doxygen's configuration file.

Edit: I just had a thought that you may wish to strip the preamble from your .tex file before including the rest of the file in the documentation. you could do this using the \dontinclude command which, together with the \line, \skip, \skipline, and \until commands allows you to include specific lines/blocks of a particular file. See the example in the \dontinclude documentation.