Skip to content

Commit

Permalink
LaTeX formula renderer: support no unit suffix (#432)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein authored Jan 6, 2024
1 parent 66e9bac commit f559f41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions v7/latex_formula_renderer/latex_formula_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,10 @@ def _parse_svg_unit_as_pixels(unit):
value = float(unit[:-2])
# Magic value which seems to works fine for what pdf2svg and dvisvgm outputs
return round(value * 1.777778)
if unit.endswith(('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')):
value = float(unit)
# Magic value which seems to works fine for what pdf2svg and dvisvgm outputs
return round(value * 1.777778)
else:
# Looks like we need no other unit for output of pdf2svg and dvisvgm
raise Exception('Cannot interpret SVG unit "{0}"!'.format(unit))
Expand Down

0 comments on commit f559f41

Please sign in to comment.