如何在 Doxygen 中更改 \section、\subsection 等的字体大小?

How to change fontsize of \section, \subsection etc. in Doxygen?

我想更改 doxygen 的 html 输出的 \section 和 \subsection 字体大小。此外,我想在样式中的部分和(子)小节中添加数字:

1 第 1 节

1.1 小节 1.1

1.1.1 小节

从手册中我发现我应该复制 customdoxygen.css 并更改它以代表我的需要。不幸的是,我对 css 一无所知,无法找到负责 \section 和 \subsection.

字体大小的命令

this question中,据说应该定义一个h4-tag。那是对的吗?我该怎么做?

这是您的操作: 在配置doxyfile:

HTML_EXTRA_STYLESHEET = mystylesheet.css

此样式表中的设置会覆盖其他样式表中的设置。 然后创建文本文件 mystylesheet.css.

要更改字体大小,请为 mystylesheet.css 添加 h1 的样式。例如:

h1 { font-size:1.5em; }

要处理带编号的标题,您可以使用带有 CSS 计数器的样式。这是一个例子:

<!doctype html>
<html>
<head>
<style>
body {counter-reset: h2}
h2 {counter-reset: h3}
h3 {counter-reset: h4}
h4 {counter-reset: h5}
h5 {counter-reset: h6}

h2:before {counter-increment: h2; content: counter(h2) ". "}
h3:before {counter-increment: h3; content: counter(h2) "." counter(h3) ". "}
h4:before {counter-increment: h4; content: counter(h2) "." counter(h3) "." counter(h4) ". "}
h5:before {counter-increment: h5; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "}
h6:before {counter-increment: h6; content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "
</style>
</head>  
<body>
<h1> Demonstration of Numbered Headings</h1>
<p>To create numbered headings, you can use CSS counters. For details search for "CSS counters".</p>
<p>In this example the numbered headings begin from heading level 2. Heading level 1 is reserved for the page title. </p>
<h2>Setting Up the Style</h2>
The css style properties specify when to reset the heading level counter, and when to increment it. 
<h3>Creating the Counter</h3>
<p>You can create a named counter with the counter-reset property.  The value of counter-reset is the name of the counter. For details search for "CSS counter-reset".</p>
<h3>When Does the Value Reset</h3>
<p>It resets when the tag appears of which the counter-reset is a property.</p>
<h2>Displaying the Counters</h2>
<p>The counters are displayed by specifying a before selector for the heading levels, and styling it with content that includes counters for the heading levels preceding the current level, as well as the current level.</p>
<h3>Where is the Example?</h3>
<p>In the style tag of this page.</p>
<h4>I Can't See It</h4>
<p>Use the source, Luke.</p>
</body>
</html>