0

\(S\) renders fine. No problem here.

$S$ renders fine. No problem here.

$ S $ does nothing. I wouldn't expect this. Comment below referencing manual explains this case.

$S $ does nothing. I wouldn't expect this. Comment below referencing manual explains this case.

\( S \) renders with an image of TLT TLT over the expression. Using luatex. Weird. This remains unexplained.

\(S \) renders fine. Similar to previous but notice no space after initial inline expression delimiter.

I wouldn't expect spaces just after the opening inline expression delimiter to be a problem.

Question: Any ideas on what I should look at in my config to allow space after opening inline delimiter \(?

This issue happens when rendering org-mode latex fragments. I have found that it happens with the default value of org-preview-latex-process-alist of:

((dvipng :programs
         ("latex" "dvipng")
         :description "dvi > png" :message "you need to install the programs: latex and dvipng." :image-input-type "dvi" :image-output-type "png" :image-size-adjust
         (1.0 . 1.0)
         :latex-compiler
         ("latex -interaction nonstopmode -output-directory %o %f")
         :image-converter
         ("dvipng -D %D -T tight -o %O %f"))
 (dvisvgm :programs
          ("latex" "dvisvgm")
          :description "dvi > svg" :message "you need to install the programs: latex and dvisvgm." :image-input-type "dvi" :image-output-type "svg" :image-size-adjust
          (1.7 . 1.5)
          :latex-compiler
          ("latex -interaction nonstopmode -output-directory %o %f")
          :image-converter
          ("dvisvgm %f -n -b min -c %S -o %O"))
 (imagemagick :programs
              ("latex" "convert")
              :description "pdf > png" :message "you need to install the programs: latex and imagemagick." :image-input-type "pdf" :image-output-type "png" :image-size-adjust
              (1.0 . 1.0)
              :latex-compiler
              ("pdflatex -interaction nonstopmode -output-directory %o %f")
              :image-converter
              ("convert -density %D -trim -antialias %f -quality 100 %O")))

and default value for org-preview-latex-default-process of: dvipng.

Update: This happens when Org version > 9.0 uses its default config, i.e., no use of luatex. I am no longer using luatex but the problem still remains.

2
  • 1
    You mean that you are now not using LuaTeX but you still get that TLT TLT junk in the '(...)` case? Have you cleaned out all the files that LuaTeX produced? Also, have you cleaned out the `ltximg/' subidr? There may be old stuff there, confusing the issue.
    – NickD
    Commented Jun 26, 2020 at 22:06
  • That did solve it for the case I presented above. I am still trying to figure out why a particular file doesn't render as mentioned in my comments below. You have answered it and I will award that, but want to keep it open for a bit longer in case you or someone else has an insight on why that particular files inline math expressions don't render correctly for me with default org-preview-latex-process-alist.
    – Joe
    Commented Jun 26, 2020 at 22:54

1 Answer 1

1

For the $-delimited cases, there is a simple explanation: you are not allowed to have a space after the opening delimiter and before the closing delimiter. The manual says:

Text within the usual LaTeX math delimiters. To avoid conflicts with currency specifications, single ‘$’ characters are only recognized as math delimiters if the enclosed text contains at most two line breaks, is directly attached to the ‘$’ characters with no whitespace in between, and if the closing ‘$’ is followed by whitespace, punctuation or a dash. For the other delimiters, there is no such restriction, so when in doubt, use \(...\) as inline math delimiters.

Using default settings for the dvipng section of org-preview-latex-process-alist and the dvipng setting for org-preview-latex-default-process, all the \(...\) constructs work, both when exporting to PDF and when previewing.

One possibility is that you have old files produced by LuaTeX, polluting your environment, in particular, the PNG files in the ltximg/ subdirectory. When you remove those, the preview mechanism will be forced to recreate them with the current settings.

8
  • Thanks for looking that up in the manual @NickD. I've updated the question. No longer using luatex at all and it still remains. You have explained the dollar delimiter cases though, thanks. Now I need to figure out why for the \(\) delimiters. Are you able to render \( S \) or \(S \) successfully? At least that would show me that the issue is in my config possibly.
    – Joe
    Commented Jun 26, 2020 at 21:55
  • 1
    All the \(...\) delimited cases work for me, both when I export to PDF and also when I preview latex fragments. Can you reproduce your finding starting with emacs -Q?
    – NickD
    Commented Jun 26, 2020 at 22:03
  • Thanks for the reminder. They work fine for me with emacs -Q as well. Will be interesting to see what in my config is responsible.
    – Joe
    Commented Jun 26, 2020 at 22:16
  • 1
    As I mentioned, it might be something in your environment, rather than in your config.
    – NickD
    Commented Jun 26, 2020 at 22:18
  • Good point, thanks.
    – Joe
    Commented Jun 26, 2020 at 22:26

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.