Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some glitch when working with latex package siunitx #7

Open
Serenade600 opened this issue Jan 15, 2023 · 2 comments
Open

some glitch when working with latex package siunitx #7

Serenade600 opened this issue Jan 15, 2023 · 2 comments

Comments

@Serenade600
Copy link

When using commands \si{} in siunitx, content \si{\meter\cubed}, [\meter\cubed]{.si}, \si{m^3}, [m^3]{.si} produed
image.

The last one is different from the first three. It seems somewhere did not convert the ^3 correctly.

@cderv
Copy link
Contributor

cderv commented Jan 16, 2023

The LaTeX produced for the above content is the following

\si{\meter\cubed}, \si{\meter\cubed}, \si{m^3}, \si{m\^{}3}

You see in the last case that ^ is interpreted from markdown as Literal ^ and not special LaTeX character that you expect.

> quarto pandoc -t native
[m^3]{.si}
^Z
[ Para [ Span ( "" , [ "si" ] , [] ) [ Str "m^3" ] ] ]

> quarto pandoc -t latex
m^3
^Z
m\^{}3

For forcing ^ to be preserved in LaTeX from markdown, it would require raw code attributes. i.e [m^{=latex}3]{.si} but we would loose it in HTML conversion.

And if we consider the content of [content]{.cmd} to be raw LaTeX for this extension, we loose the benefit of being able to have markdown syntax in the text. Not sure it is good. We could support an option in the span syntax to consider the content as raw maybe... 🤔

So this is a special case with a special package where some specific LaTeX character is needed to be preserve.

@dragonstyle what are you thoughts on this ?

@dragonstyle
Copy link
Contributor

I think the long term solution to this conundrum is likely to actually implement an extension that provides nice unit support across formats (like siunitx does for LaTeX). The latex environment package works best when the contents of the environment could be reasonably rendered in other formats as text and I think in this case that isn't likely to be true.

For now, I suppose the use of raw LaTeX might be the preferred solution until someone implements a nice port of siunitx as a Quarto extension...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants