如何将 LaTeX 片段直接包含在 Doxygen 注释中?
我希望能够使用一些合适的编辑器在外部编辑一些 Doxygen 注释的 LaTeX 部分。我只会在复杂的环境中使用它。为此,我想我可以拥有纯 LaTeX 文件并从 Doxygen 中包含它们。我确实为 \begin
和 \end
创建了 Doxygen 别名,以使语法兼容。
(例如,我知道如何设置 Emacs/AUCTex 来处理没有前言和文档结构的 LaTeX 片段。)
有没有办法将 .tex 文件的内容包含在 Doxygen 注释中?我寻找类似于 \htmlinclude
的内容,但针对的是 TeX 文件。鉴于我对纯 TeX 外部源的要求,是否有某种方法可以模拟功能?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用类似的内容
,其中
是要包含的文件的路径,可以是绝对路径,也可以是相对于生成乳胶文档的目录的相对路径。You may use something like
where
<file>
is the path to the file to include, either absolute or relative to the directory in which the latex documentation is generated.您是否尝试过
\verbinclude
命令?此命令逐字包含文档中的任何文件(与\include
不同,后者用于包含源 文件)。来自 doxygen 手册:
编辑:我只是想到您可能希望在将文件的其余部分包含在文档中之前从 .tex 文件中删除前导码。您可以使用
\dontinclude
命令来完成此操作,该命令与\line
、\skip
、\skipline
一起使用和\until
命令允许您包含特定文件的特定行/块。请参阅\dontinclude
文档 中的示例。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:
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.