0

I am a brand new emacs user and I want to be able to view snippets of LaTeX in my .org file.

My OS is Ubuntu 16.04, I have installed texlive-full, and I have installed AucTex and org using the Emacs package manager.

I have been trying to follow the first example in this guide:

latex preview example

I have put in my .emacs file the single line

(setq org-latex-create-formula-image-program 'imagemagick)

I have the imagemagick package installed in Ubuntu.

Yet when I try to see the first example by pressing C-c C-x C-l, I get this error message:

org-compile-file: File "/tmp/orgtex32228nYH.pdf" wasn't produced.  Please adjust 'imagemagick' part of `org-preview-latex-process-alist'.

When I press C-h v I can inspect the variable, but I have no idea what to change...

Looking in /tmp there is no corresponding .log file, only a .tex file, which doesn't reveal any error.

Can anybody please help me?

  • The guide you point to predates the current version of org by many years, but looking over it I don't see too much that needs changing (other than the name of the variable: org-latex-create-formula-image-program is an alias to org-preview-latex-default-process, so it's going to work either way, but the new name is preferred, since it has a better chance of being valid in the future). If you forget about org for a moment and just cut and paste the example TeX program from the guide into a file on your system, and then try to process it as described in the guide, do you get any errors? – NickD Mar 13 '17 at 6:10
  • As an inspection of org-create-formula-image and org-compile-file shows the log-text of the programs for processing the preview images goes to the buffer *Org Preview LaTeX Output*. Pityingly the used function shell-command erases the output buffer before it prints the new output of the shell command. That means that you will only see the output of the last command. You could collect the output of all commands in a new buffer using an after-advice of org-compile-file. – Tobias Dec 26 '17 at 12:02
1

I recently struggled with this same problem, after installing texlive-full on Linux Mint. I followed advice starting from this post and indeed found I needed to install an additional package: ulem.sty. Unfortunately you say you cannot find the .log file, but if you can find where the .log file is, I suspect you will find you need additional packages which were not included in texlive-full.

0

I also faced the same problem. In my case, it was caused by the wrong setting of :latex-compiler in imagemagick part of org-preview-latex-process-alist: the original value was

("pdflatex -interaction nonstopmode -output-directory %o %f")

but I would like use

("lualatex -interaction nonstopmode -output-directory %o %f")

instead.

As I do not know much about lisp, I simply followed https://stackoverflow.com/questions/41568410/configure-org-mode-to-use-lualatex

Although this patch is for lualatex users like me (and not the best or reasonable way), your problem could be solved in a similar manner. You might define new function (e.g. new-imagemagick) with proper :latex-compiler command, add it to org-preview-latex-process-alist and call it rather than imagemagick. You can change directly the part of "pdf latex -interation ....") according to your prefer latex command.

  • In the case of luaLaTeX, a new entry was necessary because there was no entry before. But in the the case of imagemagick, there is an entry already present. If it does not work, it is better to fix it, than to introduce a new one. – NickD Mar 5 at 19:37
0

I solved the problem that way :

  1. Edit /etc/ImageMagick-6/policy.xml
  2. Change the line <policy domain="coder" rights="none" pattern="PDF" /> to: <policy domain="coder" rights="read|write" pattern="PDF" />
  • 1
    Can you please enlarge your answer and explain what that line does and why commenting it out solved your problem? – NickD Mar 5 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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