Description
This bug report originates from my attempts to answer this question on Stack Overflow. Minimal example thanks to the other answer there by Baptiste.
With certain LaTeX strings, the right paranthesis indicates by \right)
is replaced with an exclamation point when passed to MathTextParser and rendered as a bitmap or png. This behaviour appears to occur when the parantheses are around an expression comprising multiple layered fractions. It does not occur if \right]
or \right\}
are used
The minimal code to reproduce this is as follows:
import matplotlib.mathtext as mt
s = r'$\left(\frac{\frac{\frac{M}{I}}{N}}' \
r'{\frac{\frac{B}{U}}{G}}\right)$'
parser = mt.MathTextParser("Bitmap")
for size in range(1, 30):
filename = "figure{0}.png".format(size)
parser.to_png(filename, s, fontsize=size)
This gives output like
Investigations indicate that this occurs only for certain combinations of expression and font size, but the example given above seems to give the most consistent failure conditions. It may be related to dpi
in the rendering, however this has not yet been conclusively proven or disproven.
Metadata
Metadata
Assignees
Type
Projects
Status