0

Solved: See my answer below. It seems like emacs can't always see what you can see in the terminal. The package mentioned in my answer below solved this issue.

I'm trying to make LaTeXPreviewPane work on osx (Yosemite). When I try to use the pdf preview it never finishes loading, I see this message:

Error running timer `latex-preview-pane-update': (file-error "Searching for program" "no such file or directory" "pdflatex")

These are the requirements:

1: A installed copy of Emacs 24+ with a working packages system
2: The command pdflatex on your PATH
3: Access to the MELPA package repository

I know I have 1 and 3 and have tried to make sure pdflatex should be in my "PATH" as described below.

I tested the command pdflatex via the terminal, and it worked. It is expandable in the terminal, using bash. However I thought I may have to make sure it might still not be in the "PATH" so I found out where the pdflatex binary I installed via macports is, and added it to the .bashrc:

$ which pdflatex
/opt/local/bin/pdflatex

I then added this path to my .bashrc file like this:

PATH=$PATH:/opt/local/bin/pdflatex 
export PATH

It still does not work, I'm thinking the problem could be that emacs does not see everything bash sees and that I may need to put a symlink to the binary somewhere, but I'm not sure. I'd really appreciate some advice on how to solve this.

  • 1
    Which version of OS X are you running? El Capitan broke any MacTeX distribution up to 2014, only MacTeX 2015 survived but you need to update your PATH environment variable. – giordano Oct 3 '15 at 23:10
  • I added that info now, thanks! I'm on yosemite at the moment. (Btw: Can pdflatex work using mactex or does this mean I can't use latexpreviewpane if I upgrade?) – Var87 Oct 3 '15 at 23:15
  • 1
    If it is solved, you do not need to edit the question and add the [SOLVED] tag. You can mark your own solution as Answer in few days. That will mark the question as answered or solved. meta.stackexchange.com/q/5234/217788 – Kaushal Modi Oct 4 '15 at 3:37
0

The melpa package exec-path-from-shell solved my problem. I simply installed it and added what it mentioned in the instructions (see the link) to my .emacs and that was it!

  On OS X (and perhaps elsewhere) the $PATH environment variable and
`exec-path' used by a windowed Emacs instance will usually be the
system-wide default path, rather than that seen in a terminal
window.

This library allows the user to set Emacs' `exec-path' and $PATH
from the shell path, so that `shell-command', `compile' and the
like work as expected.

It also allows other environment variables to be retrieved from the
shell, so that Emacs will see the same values you get in a terminal.
  • I'm trying to follow your steps, but I'm lost at the usage part. What exactly do I have to add or change? I'm a newb. Thanks for helping! :D – Guilherme Salomé Oct 25 '15 at 3:58
  • add this to your .emacs: (require 'exec-path-from-shell) ;; if not using the ELPA package (exec-path-from-shell-initialize) – Var87 Oct 25 '15 at 14:03

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.