如何更改 Doxygen 创建的 PDF 文档的边距?

发布于 2024-08-16 04:46:18 字数 294 浏览 2 评论 0原文

我正在使用 doxygen 生成代码文档的 PDF。使用 PAPER_TYPE = letter 时,PDF 的边距非常大。使用 a4wide 时看起来不错,但我希望对其有更多控制。我想使用一个名为 Geometry 的包,但无法弄清楚在哪里添加这样的代码:

\usepackage[top=2.9cm,left=2in,bottom=1in,right=1in]{geometry}

如果可能的话,我希望不必更改 doxygen 生成的 tex 文件。

I am using doxygen to generate a PDF of my code documentation. The PDF has very big margins when using PAPER_TYPE = letter. It looks OK when using a4wide but I would like to have more control over it. I want to use a package called geometry but can't figure out where to add code like this:

\usepackage[top=2.9cm,left=2in,bottom=1in,right=1in]{geometry}

I would like to not have to change the doxygen-generated tex files if possible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

逆光下的微笑 2024-08-23 04:46:18

在您的 Doxyfile 中,添加或编辑 EXTRA_PACKAGES 行:

EXTRA_PACKAGES = mydoxy

然后创建一个名为 mydoxy.sty 的新文件:

\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{mydoxy}[2009/12/29 v1.0.0 csmithmaui's Doxygen style]
\RequirePackage[top=2.9cm,left=2in,bottom=1in,right=1in]{geometry}
% any other custom stuff can go here
\endinput

删除该 mydoxy.sty LaTeX 可以在哪里找到它。

EXTRA_PACKAGES 行将告诉 Doxygen 将 \usepackage{mydoxy} 添加到它生成的 .tex 文件的前导码中。这将导致 LaTeX 查找名为 mydoxy.sty 的文件。在我们创建的 mydoxy.sty 文件中,我们可以添加任何我们喜欢的 LaTeX 代码(在 \endinput 行之前)。您可以随意在此样式文件中删除您喜欢的任何其他自定义项。

请注意,我还没有测试过这一点,并且我做出了一些可能是错误的假设。但它至少应该让你开始。

In your Doxyfile, add or edit the EXTRA_PACKAGES line:

EXTRA_PACKAGES = mydoxy

Then create a new file called mydoxy.sty:

\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{mydoxy}[2009/12/29 v1.0.0 csmithmaui's Doxygen style]
\RequirePackage[top=2.9cm,left=2in,bottom=1in,right=1in]{geometry}
% any other custom stuff can go here
\endinput

Drop that mydoxy.sty where LaTeX can find it.

The EXTRA_PACKAGES line will tell Doxygen to add \usepackage{mydoxy} to the preamble of the .tex files it generates. This will cause LaTeX to look for a file named mydoxy.sty. In the mydoxy.sty file that we've created, we can add whatever LaTeX code we like (before the \endinput line). Feel free to drop any other customizations you like in this style file.

Note that I haven't tested this, and I'm making a number of assumptions that may be false. But it should at least get you started.

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