5
votes

My org-mode refuses to export produce PDF files from their corresponding org-files. I was running org-mode v 7.9.x and suspected the problem might be because I have an older version of org-mode. Hence, I am now running the most recent version of org-mode (v 8.2.2) but the problem persists.

After some investigation, I have found the following. org-mode nicely exports my .org file to .tex. But if I try to get the org-mode exporter to create the .tex file and also process to PDF, (C-c C-e l p), I get the error `PDF file ./test.pdf was not produced'. However, if I run pdflatex from the terminal on the .tex file that org-mode creates, the PDF is generated without errors.

So my best guess is that org-mode is creating a `nice' .tex file, but something in the guts of my emacs is preventing the .tex file from being processed to .pdf. Unfortunately, I'm quite a n00b at emacs and can't figure out exactly where the problem lies.

Any ideas on what I can do?

3
Many problems can explain that message. Among others, the fact that you've opened Acrobat Reader, and that you try to generate a newer version of the PDF. Error.fniessen
The best would be to give a Minimal Working Example so that others can try it.fniessen
When PDF is not produced Org pops up a buffer with the log of it trying to produce the PDF, usually the reason would be printed there.user797257
Which operating system are you using?Carlo Rodriguez
Hey @CarloRodriguez, I'm on Mac OS X Maverickskrishnan

3 Answers

4
votes

Add the following somewhere in your Emacs initialization file (taken from https://gist.github.com/bradleywright/2046593)

(defun set-exec-path-from-shell-PATH ()
  "Sets the exec-path to the same value used by the user shell"
  (let ((path-from-shell
         (replace-regexp-in-string
          "[[:space:]\n]*$" ""
          (shell-command-to-string "$SHELL -l -c 'echo $PATH'"))))
    (setenv "PATH" path-from-shell)
    (setq exec-path (split-string path-from-shell path-separator))))

(set-exec-path-from-shell-PATH)

The link above explains why you must configure the path like that, I was having same issue than you, adding this I'm able to export to pdf with org mode in Mac OS X Mavericks, without it , I receive the same error message.

Update

Someone has already write a package for Emacs that resolve this: https://github.com/purcell/exec-path-from-shell

2
votes

This is all I need to use on OSX 10.6.8 with TexLive and Emacs -- I have it in my .emacs file:

(setenv "PATH" (concat (getenv "PATH") ":/usr/texbin"))
0
votes

I had some similar problems. I'm running Ubuntu and I believe installing in this fashion helped:

sudo apt-get install emacs texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-base texlive-latex-base