You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of the current master (7c6dbd3) ranges of SI units provided by \SIRange{firstvalue}{secondvalue}{unit} of siunitx are dropped during parsing of LaTeX files. This leads to funny conversions like the following:
Original LaTeX test_sirange.tex
Something important is happening \SIRange{100}{200}{\ms} after the event.
Expected output in markdown
Something important is happening 100 ms to 200 ms after the event.
Actual output of pandoc -so test_sirange.md test_sirange.tex
Something important is happening after the event.
Why is this a bug?
The manual states that pandoc doesn't aim for perfect document conversion, and that in particular formatting details may not be preserved across formats. However, by dropping \SIRange, pandoc's output can become semantically different from the original LaTeX (ie phrases might not make sense or even take on a different meaning after conversion), so this isn't a formatting detail.
Proposed fix
siunitx's \SIRange is highly configurable. Depending on the options used, \SIRange{100}{200}{\ms} might be rendered as
100 ms to 200 ms
100 ms – 200 ms
100 – 200 ms
etc
In the spirit of prioritizing semantics over formatting details, I think it would be good enough for pandoc to support only the first option. I've implemented this approach and will submit a PR shortly.
Related issues and PRs
How pandoc should parse siunitx commands has also been discussed in issue #3587. I'm opening a new issue because that issue (and the associated PR #3823) have been focused on the \num command and are a bit stale.
The text was updated successfully, but these errors were encountered:
Description of bug and steps to reproduce
As of the current master (7c6dbd3) ranges of SI units provided by
\SIRange{firstvalue}{secondvalue}{unit}
of siunitx are dropped during parsing of LaTeX files. This leads to funny conversions like the following:Original LaTeX
test_sirange.tex
Expected output in markdown
Actual output of
pandoc -so test_sirange.md test_sirange.tex
Why is this a bug?
The manual states that pandoc doesn't aim for perfect document conversion, and that in particular formatting details may not be preserved across formats. However, by dropping
\SIRange
, pandoc's output can become semantically different from the original LaTeX (ie phrases might not make sense or even take on a different meaning after conversion), so this isn't a formatting detail.Proposed fix
siunitx's
\SIRange
is highly configurable. Depending on the options used,\SIRange{100}{200}{\ms}
might be rendered asIn the spirit of prioritizing semantics over formatting details, I think it would be good enough for pandoc to support only the first option. I've implemented this approach and will submit a PR shortly.
Related issues and PRs
How pandoc should parse siunitx commands has also been discussed in issue #3587. I'm opening a new issue because that issue (and the associated PR #3823) have been focused on the
\num
command and are a bit stale.The text was updated successfully, but these errors were encountered: