Skip to content

Commit

Permalink
Documentation: Add CSS to improve the look of equations
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
billsacks authored and fritzt committed May 19, 2021
1 parent ccfbd5b commit 066b15a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/source/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* Make equation numbers float to the right */
.eqno {
margin-left: 5px;
float: right;
}
/* Hide the link... */
.math .headerlink {
display: none;
visibility: hidden;
}
/* ...unless the equation is hovered */
.math:hover .headerlink {
display: inline-block;
visibility: visible;
/* Place link in margin and keep equation number aligned with boundary */
margin-right: -0.7em;
}
3 changes: 3 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,6 @@
'section': '%s',
}
numfig_secnum_depth = 2

def setup(app):
app.add_stylesheet('css/custom.css')

0 comments on commit 066b15a

Please sign in to comment.