Ista Zahn <istaz...@gmail.com> wrote:

> I'm having troubel getting org-preview-latex-fragment to work when using 
> minted for exported code highlighting. Checking the log files in 
> /tmp/orgtex<...>.log I find that tex fails with the error message "Package 
> minted Error: You must invoke LaTeX with the -shell-escape flag". OK, that's 
> helpful, except that I can't figure out where/how to change the tex command 
> called by org-preview-latex-fragment. Is this configurable in org-mode 
> settings? Or does it depend on some option in the auctex or preview packages?
> 

You might have to do one more thing: if you are going through dvipng,
in org-create-formula-image, there is an explicit call to latex that
might be the one causing you problems. There is no way to deal with this
other than by modifying the function, so if that's indeed what causes your
problem, you should probably submit a bug report.

The call is around line 16927 in org.el and looks like this:

,----
|       (condition-case nil
|         (progn
|           (cd tmpdir)
|           (call-process "latex" nil nil nil texfile))
|       (error nil))
`----

I think you'd need to modify it to say:

            ...
            (call-process "latex" nil nil nil "-shell-escape" texfile))
            ...

instead.

Nick


Reply via email to