On 11/11/2025 06:43, Panayotis Manganaris wrote:
Max Nikulin writes:
#+name: example-qty
Quantity \qty{1.23}{J.mol^{-1}.K^{-1}}.
#+RESULTS: org-export-string-as
: Quantity \qty{1.23}\{J.mol\textsuperscript{-1}.K\textsuperscript{-1}\}.
My expectations are not so high. Although, it is peculiar that the
exporter treats the braces, apparently, inconsistently.
It seems, you managed to find some Org-safe subset of siunitx commands
while I was unlucky to pick a wrong example.
I have realized that the issue is not second argument of LaTeX command,
but inner curly braces in arguments. Org may parse nested braces for
inline source code blocs src_something{...}. I have not figured out if
there are obstacles to use similar approach for LaTeX fragments. Even
superscripts are not active inside source code blocks.
As to disabled entities, my expectation is that they should have chance
to be treated as LaTeX fragments.
Ditto.
Perhaps, entities may be defined in a more selective way. E.g. besides
all-or-nothing variants, more options may be allowed: use HTML names or
LaTeX names only. It may be an alternative to removing \ang from
entities completely.
Allowing to disable specific entities using some `defcustom' might be
implemented as well. Unfortunately it increases complications with
sharing Org files and with 3rd party tools.
pandoc -f org -t latex <<<'Quantity \qty{1.23}{\centi\metre g^{-1}}.'
Quantity 1.23~cm\emph{g}\textsuperscript{−1}.
I find it less reasonable to expect a third party tool
to identify unmarked latex fragments in org as anything other than wonky
org markup.
Notice that pandoc better handles nested braces. (Definitely there are
more discrepancies in behavior of parsers.)
I use this tool to import selected fragments of web pages into my notes.
It especially convenient for tables and text snippets heavily loaded
with useful links. That is why I consider it as more important than just
some 3rd party application.