Skip to content

Commit 066b15a

Browse files
billsacksfritzt
authored andcommitted
Documentation: Add CSS to improve the look of equations
This comes from altMITgcm/MITgcm#12, which I found in a link from readthedocs/sphinx_rtd_theme#383. This right-aligns the equation numbers, and only makes the link image visible if your mouse is hovering above a given equation.
1 parent ccfbd5b commit 066b15a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

doc/source/_static/css/custom.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* Make equation numbers float to the right */
2+
.eqno {
3+
margin-left: 5px;
4+
float: right;
5+
}
6+
/* Hide the link... */
7+
.math .headerlink {
8+
display: none;
9+
visibility: hidden;
10+
}
11+
/* ...unless the equation is hovered */
12+
.math:hover .headerlink {
13+
display: inline-block;
14+
visibility: visible;
15+
/* Place link in margin and keep equation number aligned with boundary */
16+
margin-right: -0.7em;
17+
}

doc/source/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,6 @@
180180
'section': '%s',
181181
}
182182
numfig_secnum_depth = 2
183+
184+
def setup(app):
185+
app.add_stylesheet('css/custom.css')

0 commit comments

Comments
 (0)