-
DescriptionNew to Quarto here (also new to pandoc). I would like to use macros in I understand I could load LaTeX packages in the PDF engine but this would not apply to HTML. Is there no current way of achieving native formatting for quantities and units in Quarto? ---
title: "Astronomy formular"
---
## AB magnitude
$$m_\text{AB} \approx -2.5 \log_{10} \left(\frac{f_{\nu}}{\qty{3631}{Jy}}\right)$$ Note: |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 12 replies
-
If none of the equation engine supports it (MathJax, KaTeX, etc.), there is nothing we can do. |
Beta Was this translation helpful? Give feedback.
-
I used siunitx in the past, but recently I've found that I don't need the full functionality, and since it's not supported by Mathjax I decided to go for a poor man's version of it with just two or three basic macros:
These will work fine with the quarto-pandoc-mathjax toolchain, not just for LaTeX but also Html etc.
|
Beta Was this translation helpful? Give feedback.
-
In case the goal Is to create a pdf, you can add \usepackage{sinunitx} to the preamble. A solution could be to create a lua filter that could pre-process the syntax \qty{742}{\per\second} for instance and simplify it so that it can be correctly displayed in the html output. The problem is that I don't know how to program such a filter 😅 |
Beta Was this translation helpful? Give feedback.
-
I actually ran into the same problem recently. As suggested by @mcaruel a solution could be to develop a Lua filter. I am learning Quarto, Pandoc, and Lua at the same time so it might take some time to develop, but I started such a filter for the siunitx package. So far it can handle the I will try to develop a bit more every day, especially for the |
Beta Was this translation helpful? Give feedback.
-
Recently stumbled upon this MathJax v3 implementation of siunitx v3 by @limefrogyank. It is simple, works beautifully and is well-documented. To use it, I copied siunitx.js from its repo to my Quarto project and then made Quarto add it to the published site by setting
And that should let you use siunitx v3 commands in Quarto :-) |
Beta Was this translation helpful? Give feedback.
If none of the equation engine supports it (MathJax, KaTeX, etc.), there is nothing we can do.
But di you look at
physics
which is supported in MathJax and Katex?