Reputation: 1407
I want to change the \section and \subsection font size of doxygen's html-output. In addition, I would like to add numbers to the sections and (sub-)subsections in the style:
1 Section1
1.1 Subsection1.1
1.1.1 Subsubsection
From the manual I found out that I should copy the customdoxygen.css and change it to represent my needs. Unfortunately I don't know anything about css and could not manage to find the command that is responsible for the font size of \section and \subsection.
In this question, it is said that one should define a h4-tag. Is that correct? And how could I do that?
Upvotes: 1
Views: 3123
Reputation: 56
Here's what you do: In the configuration doxyfile:
HTML_EXTRA_STYLESHEET = mystylesheet.css
Settings in this stylesheet override the settings in other stylesheets. Then create the text file mystylesheet.css.
To change the font size add to mystylesheet.css a style for h1. For example:
h1 { font-size:1.5em; }
To handle numbered headings, you use styles with CSS counters. Here's an example:
<!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>
Upvotes: 2