a big thanks to all matplotlib developers. This is a great tool! (I thought this needs to be said once on a while)
I would like to propose a small feature addition to the mathtext module. It has a \overline command but is missing the corresponding \underline command which LaTeX supports.
I took the liberty to edit the _mathtext.py file and added a \underline command by cloning
and slightly modifying the \overline parts.
Would be great if this in some form or other becomes part of future matplotlib releases.
Thanks,
Lothar
#_mathtext.py parts
Also needs to add something in the definitions part where p.overline is defined
The function itself
def underline(self, toks: ParseResults) -> T.Any:
body = toks["body"]
state = self.get_state()
thickness = state.get_current_underline_thickness()
height = body.height - body.shift_amount + thickness * 3.0
depth = body.depth + body.shift_amount
# Place underline below body
rightside = Vlist([Hlist([body]), Glue('fill'), \
Hrule(state,thickness=0.75*thickness)])
# Stretch the glue between the hrule and the body
rightside.vpack(height + (state.fontsize * state.dpi) / (100.0 * 12.0),
'exactly', depth)
# shift downwards so that characters have roughly same baseline
rightside.shift_amount = thickness * 5.0
hlist = Hlist([rightside])
return [hlist]
Hi @lbirk thanks for the suggestion! There is actually already an open GitHub issue to track this and even a pull request although that seems to have stalled. If you would be interested in opening a new PR to implement this, I think that would be welcome.
I would be willing to do it (since I have a working version) but I am
new to GitHub and never worked on a project as big as this. How would
I go about it?