-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pint and siunitx #113
Comments
For clarity, are you saying that the output of repr_latex() on pint objects outputs a Latex str that includes commands for siunitx? |
No, the repr.latex is plain latex text. Since no str or print are invoked, it will never output siunitx. |
Sorry for the delayed response. I am prioritizing working better with pint. siunitx is not utilized at all in either MathJax or Katex (although it is an asked-for feature) so this would only be useful when outputting text to a .tex file for external rendering which I consider to be a secondary use for handcalcs. The tex output from handcalcs is intended to work across all latex rendering environments and using the siunitx code would be limited to a latex environment with the siunitx package installed. So, while I will be focusing on having better interaction with pint, I don't know if I will have a flag or trigger for outputting the siunitx tex code since it is such a special use case. |
This will now work in the upcoming version by specifying the preferred string formatter in the global config. Default setting is |
I am trying to use handcals with pint and siunitx.
The main problem is that in
latex_repr
it checks if the object has a_repr_latex_
. Pint has that attribute but it is standard LaTeX, not siunitx. For thatstr()
orprint
should be used.A minimal example:
The result is:
As you can see the result is using siunitx but the latex representation by handcalc, its not.
One solution would be to detect a pint object and use the
str()
method if default format is set to Lx, otherwise_repr_latex
.Is there anything I am missing to work around this question?
The text was updated successfully, but these errors were encountered: