简体   繁体   English

如何在Doxygen评论中直接包含LaTeX片段?

[英]How to include LaTeX snippets directly in Doxygen comments?

I would like to be able to edit LaTeX parts of some Doxygen comments externally with some suitable editor. 我希望能够通过一些合适的编辑器在外部编辑一些Doxygen注释的LaTeX部分。 I would use that only for complex environments. 我只会在复杂的环境中使用它。 To do that, I figured I can have LaTeX-only files and include them from Doxygen. 为此,我想我可以使用仅限LaTeX的文件,并将它们包含在Doxygen中。 I did create Doxygen aliases for \\begin and \\end to make the syntax compatible. 我确实为\\begin\\end创建了Doxygen别名以使语法兼容。

(For example, I know how to set-up Emacs/AUCTex for working with LaTeX snippets that have no preamble and document structure.) (例如,我知道如何设置Emacs / AUCTex以使用没有前导码和文档结构的LaTeX片段。)

Is there a way to include the contents of a .tex file inside a Doxygen comment? 有没有办法在Doxygen评论中包含.tex文件的内容? I look for something analogous to \\htmlinclude , but for TeX files. 我寻找类似于\\htmlinclude东西,但是对于TeX文件。 Is there some way to emulate the functionality, given my requirements for having a TeX-only external source? 考虑到我对只有TeX外部源的要求,有没有办法模拟功能?

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. 其中<file>是要包含的文件的路径,绝对或相对于生成latex文档的目录。

Have you tried the \\verbinclude command? 你试过\\verbinclude命令吗? This command includes any file verbatim in the documentation (in contrast to \\include , which is used to include source files). 此命令包括文档中的任何文件(与\\include相反,后者用于包含文件)。

From the doxygen manual: 从doxygen手册:

\\verbinclude <file-name>

This command includes the file <file-name> verbatim in the documentation. 此命令在文档中包含文件<file-name> verbatim。 The command is equivalent to pasting the file in the documentation and placing \\verbatim and \\endverbatim commands around it. 该命令相当于粘贴文档中的文件并在其周围放置\\verbatim\\endverbatim命令。

Files or directories that doxygen should look for can be specified using the EXAMPLE_PATH tag of doxygen's configuration file. 可以使用doxygen配置文件的EXAMPLE_PATH标记指定doxygen应查找的文件或目录。

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. 编辑 :我只是想到你可能希望在文档中包含文件的其余部分之前从.tex文件中删除序言。 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. 您可以使用\\dontinclude命令执行此操作,该命令与\\line\\skip\\skipline\\until命令一起允许您包含特定文件的特定行/块。 See the example in the \\dontinclude documentation . 请参阅\\dontinclude 文档中的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM