Ista Zahn <istaz...@gmail.com> wrote: > Hello all, > > 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? >
I remember flailing about to get everything to work with minted and I now find out that I did not take notes of what worked :-( However, looking at my customizations, I find that I have included -shell-escape in two places: o org-mode specific: org-latex-to-pdf-process - my setting is the default of calling pdflatex three times, so I added the -shell-escape option to each of the three elements in that list. If you are using texi2dvi, you'll have to do something different: not sure whether you can pass it as an option, or whether you will need to modify the script itself. o auctex specific: TeX-expand-list - I customized an entry in that list to read ,---- | ... | ("%(mode)" | (lambda nil | (if TeX-interactive-mode "" " --shell-escape -interaction=nonstopmode"))) | ... `---- AFAIK, those are the only changes needed. Nick