jupyter-book / mystmd

Command line tools for working with MyST Markdown.
https://mystmd.org/guide
MIT License
191 stars 62 forks source link

siunitx role in MyST #545

Open jan-david-fischbach opened 1 year ago

jan-david-fischbach commented 1 year ago

We already have support for units in the AST. However, we are missing an option to generate those entries from Markdown.

Proposal

I would suggest the following role syntax:

{qty}`<value>:<unit>`

where the parts in <> get replaced.

So for example:

{qty}`3:m`

For 3 meter

Additional notes

We need to make sure the role works within "math mode" as well.

jan-david-fischbach commented 1 year ago

577 adresses this issue partially. I realized, that there is an existing (but crude) implementation of this role. Apart from the number format (addressed in #577) I would like to be able to enter the short form of the unit into the role (more like with siunitx).