When generating text for use with LaTeX or pyplot we run into an issue.
For example:
>>> from tcutility import formula
>>> formula.molecule('NMe2*', mode='latex')
\mathrm{N}\mathrm{M}\\ma\mathrm{t}h\ma\mathrm{t}hrm{r}m{m}a\mathrm{t}\\ma\mathrm{t}h\ma\mathrm{t}hrm{r}m{m}a\mathrm{t}h\ma\mathrm{t}hrm{r}\ma\mathrm{t}h\ma\mathrm{t}hrm{r}m{m}{h}\ma\mathrm{t}hrm{r}\ma\mathrm{t}h\ma\mathrm{t}hrm{r}m{m}{e}_2^•
Which is of course nonsense. It should return instead \mathrm{N}\mathrm{M}\mathrm{e}_2^•. This then renders nicely as:
The issue is due to the way we replace characters in the string to make them non-mathmode. This should be an easy fix luckily.
When generating text for use with LaTeX or pyplot we run into an issue. For example:
Which is of course nonsense. It should return instead
\mathrm{N}\mathrm{M}\mathrm{e}_2^•
. This then renders nicely as:The issue is due to the way we replace characters in the string to make them non-mathmode. This should be an easy fix luckily.