0

I'm facing a very similar issue as per question Make "org-latex-preview" load package so that it properly renders "tcolorbox" environments, using the mhchem latex package (version 4.09).

I'm using Emacs 28.1, org-mode 9.5.5, pdfTeX 3.141592653-2.6-1.40.22, ImageMagick 6.9.12 running on Fedora 37.

org-latex-packages-alist is set to '(("version=4" "mhchem" t))

I have tried setting org-preview-latex-default-process to dvipng, dvisvgm or imagemagick.

When the org file is exported to latex and PDF, the mhchem syntax is correctly interpreted and exported. And when calling org-latex-preview on \(2 + 3\) a preview is correctly generated. However, when calling org-latex-preview on \ce{Na2CO4} nothing happens.

1 Answer 1

0

Solved by wrapping \ce{Na2CO4} with \(…\).

However, I'm still confused on why this is necessary, as \alpha{} of \pm{} get correctly “prettified” in α and ± without \(\).

3
  • Not when you preview: \alpha and \pm stay as they are. They are not LaTeX fragments in the way that Org mode understands that term: explicit environments or things surrounded by math delimiters. Exporting is a different matter: there Org mode transcodes \alpha into \( \alpha \) and \pm into \textpm because the exporter "knows" that these things only make sense within a math environment - taking a look at the resulting LaTeX file should prove enlightening.
    – NickD
    Commented Nov 29, 2022 at 22:27
  • BTW, the exporter "knows" these things through the org-entities table. The doc string of that variable and the related org-entities-user will tell you what the various columns mean.
    – NickD
    Commented Nov 29, 2022 at 22:28
  • Thank you @NickD Commented Dec 5, 2022 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.