Replies: 1 comment
-
The only thing possible is to find a Python library that does what you want. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Hello, this is not an actual problem; it's more of a quality-of-life question.
I'm using Quarto, rendering to PDF, to prepare solutions to tests I give to my engineering students. It looks gorgeous and I love it. Because it's one of the first courses they take, I like to present the results with the correct number of significant digits, correct units, and the correct decimal separator for our language. The Latex package SIUnitX makes all of this trivial.
I'm also using Python to compute the results, because it makes it a lot easier to fix the solutions when I invariably discover that I made a mistake when I start to grade the tests. So I end up with a lot of stuff like this:
While not terrible, this is not good for my own readability. The students don't see the code, only the results, so this only affects me. I wonder if someone knows a way of compacting this notation either as a Latex macro, to be used
somewhat like shown below (the names don't matter, they're just for illustration), or a python function that returns the latex string preformatted, or yet another layer of preprocessing (just kidding.)
I tried a lot of stuff, but knowing who expands what when is not super easy.
Beta Was this translation helpful? Give feedback.
All reactions