Skip to content

Commit 8fd3b70

Browse files
committed
Format online documentation
Main goal to be more readable. Specifically: - Make pages look more paper-like by * having margins for the text on the "paper" and * applying a maximum width for the "paper". Here the maximum width of the text were set such code blocks of 79 column width were generated without any scroll to the sides. Moreover, the margins were set such that they can get smaller when the screen size is reduced (in order to not have half the screen consisting of margins). - Change fonts to the system defaults in order to let readers use their favorite fonts. - Change to: * Serif in body text. * Sans-serif almost everywhere else. I did this as I think it is easier to read texts with serif in comparison to sans-serif, and since it looks better when switching to and from the math Computer Modern Roman used by MathJax which is of serif-type. - Reduce size of large texts. Most apparent example is the headers as they used to be overwhelmingly large. - Remove box around inline code. As the documentation is written as a text, code should only be considered as another font family, similar to how italic/oblique is used to emphasize things and how italic symbols are used in mathematics: It is simply another "mode" in the text. - Insert spacing between items in the sidebar as they were too close to each other. - Make "Note"-boxes have justified text, like the body text. - Make MathJax have a similar font size as regular text. NOTE: Some things in the documentation should be changed in order to look the best. One of these is to use monospace/inline code when referring to a computer variable. Another thing is to use monospace for C-files (*.c, *.h) in the headers. Optionally, one can also start using monospace when referring to websites and emails; I need to think about how to do this in practice first (there are multiple options).
1 parent ab5e81c commit 8fd3b70

File tree

1 file changed

+156
-1
lines changed

1 file changed

+156
-1
lines changed

doc/source/_static/default.css

+156-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,163 @@ ul .toctree-l1 {
1313

1414
div.body {
1515
min-width: 450px;
16-
max-width: 100%;
16+
max-width: 766px;
17+
padding-left: min(100px, 7%);
18+
padding-right: min(100px, 7%);
19+
padding-top: min(80px, 5.6%);
20+
padding-bottom: min(90px, 6.3%);
21+
margin-left: auto;
22+
margin-right: auto;
1723
}
1824

1925
li p { margin: 0.2em; }
2026

27+
28+
29+
/*
30+
################################################################################
31+
# set fonts
32+
################################################################################
33+
34+
Assuming 12pt font size in KOMA-script, then:
35+
36+
- 16px is equivalent to \normalsize. (Normal text and \subsubsection)
37+
- 19px is equivalent to \large. (\subsection)
38+
- 23px is equivalent to \Large. (\section)
39+
- 28px is equivalent to \LARGE. (\chapter)
40+
*/
41+
42+
p
43+
{
44+
font-family: serif;
45+
font-style: normal;
46+
font-weight: normal;
47+
font-size: 16px;
48+
}
49+
b
50+
{
51+
font-family: serif;
52+
font-style: normal;
53+
font-weight: bold;
54+
font-size: 16px;
55+
}
56+
em
57+
{
58+
font-family: serif;
59+
font-style: normal;
60+
font-style: oblique;
61+
font-size: 16px;
62+
}
63+
pre
64+
{
65+
font-family: monospace;
66+
font-size: 16px;
67+
}
68+
kbd, code
69+
{
70+
background-color: rgba(0, 0, 0, 0); /* Transparent */
71+
font-family: monospace;
72+
font-size: 16px;
73+
padding: 0px;
74+
}
75+
76+
/* headings */
77+
div.body h1 /* We let this resemble \chapter */
78+
{
79+
font-family: sans-serif;
80+
font-style: normal;
81+
font-weight: normal;
82+
font-size: 28px;
83+
}
84+
div.body h1 code
85+
{
86+
font-family: monospace;
87+
font-style: normal;
88+
font-weight: bold;
89+
font-size: 28px;
90+
}
91+
div.body h2 /* We let this resemble \section */
92+
{
93+
font-family: sans-serif;
94+
font-style: normal;
95+
font-weight: normal;
96+
font-size: 23px;
97+
}
98+
div.body h2 code
99+
{
100+
font-family: monospace;
101+
font-style: normal;
102+
font-weight: normal;
103+
font-size: 23px;
104+
}
105+
div.body h3 /* We let this resemble \subsection */
106+
{
107+
font-family: sans-serif;
108+
font-style: normal;
109+
font-weight: normal;
110+
font-size: 19px;
111+
}
112+
div.body h3 code
113+
{
114+
font-family: monospace;
115+
font-style: normal;
116+
font-weight: normal;
117+
font-size: 19px;
118+
}
119+
120+
div.body li
121+
{
122+
text-align: left;
123+
}
124+
125+
/* sidebar */
126+
.sphinxsidebarwrapper li
127+
{
128+
margin: 3px 0;
129+
}
130+
p.topless
131+
{
132+
font-family: sans-serif;
133+
}
134+
135+
/* toctree */
136+
.toctree-wrapper.compound
137+
{
138+
font-family: sans-serif;
139+
font-size: 16px;
140+
}
141+
.toctree-wrapper.compound code
142+
{
143+
font-family: monospace;
144+
font-size: 16px;
145+
}
146+
147+
/* description lists */
148+
dt
149+
{
150+
font-size: 16px;
151+
}
152+
.sig-name
153+
{
154+
font-size: 16px;
155+
}
156+
.sig-paren
157+
{
158+
font-size: 16px;
159+
}
160+
161+
/* note */
162+
.admonition
163+
{
164+
text-align: justify;
165+
}
166+
167+
/* mathjax */
168+
.MathJax
169+
{
170+
/* On Albin's system, CMR seems to render math that is a little bit smaller
171+
* than ordinary text. Hence, render a bit larger math than ordinary text.
172+
* This should be okay for other systems as well, as MathJax usually renders
173+
* too large texts (well above this 17/16 ratio). */
174+
font-size: 17px !important;
175+
}

0 commit comments

Comments
 (0)