如何将 LaTeX 片段直接包含在 Doxygen 注释中?

发布于 2024-10-15 10:37:25 字数 351 浏览 0 评论 0原文

我希望能够使用一些合适的编辑器在外部编辑一些 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月蹉跎了容颜 2024-10-22 10:37:25

您可以使用类似的内容

\latexonly
\input <file>
\endlatexonly

,其中 是要包含的文件的路径,可以是绝对路径,也可以是相对于生成乳胶文档的目录的相对路径。

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.

蛮可爱 2024-10-22 10:37:25

您是否尝试过 \verbinclude 命令?此命令逐字包含文档中的任何文件(与 \include 不同,后者用于包含 文件)。

来自 doxygen 手册:

\verbinclude <文件名>

此命令在文档中逐字包含文件。该命令相当于将文件粘贴到文档中并在其周围放置 \verbatim\endverbatim 命令。

doxygen 应查找的文件或目录可以使用 doxygen 配置文件的 EXAMPLE_PATH 标记来指定。

编辑:我只是想到您可能希望在将文件的其余部分包含在文档中之前从 .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:

\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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文