From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: pdflatex not found? Date: Tue, 27 Oct 2015 09:07:43 -0700 Message-ID: References: <6sw6c7si4xe0jy.fsf@pfdstudio.com> <87io5t6ubr.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr6n6-00045p-G4 for emacs-orgmode@gnu.org; Tue, 27 Oct 2015 12:08:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zr6n2-0002Ur-DD for emacs-orgmode@gnu.org; Tue, 27 Oct 2015 12:08:04 -0400 Received: from iport-acv3-out.ucsd.edu ([132.239.0.4]:61205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr6n1-0002Uc-Pv for emacs-orgmode@gnu.org; Tue, 27 Oct 2015 12:08:00 -0400 In-Reply-To: <87io5t6ubr.fsf@alphaville.usersys.redhat.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nick Dokos Cc: emacs-orgmode@gnu.org On Mon, 26 Oct 2015, Nick Dokos wrote: > Peter Davis writes: > >> Nick Dokos writes: >> >> >>> Peter Davis writes: >>> >>>> I'm trying to export PDF from org, but I'm getting the error: >>>> >>>> pdflatex: Command not found. [3 times] >>>> >>>> I've checked the definition of exec-path, and it includes >>>> "/usr/texbin", which is where tcsh tells me the executable is. >>>> >>>> Any ideas? >>>> >>> >>> Backtrace? >> >> Sorry. Here's the backtrace: >> >> Debugger entered--Lisp error: (error "PDF file ./test.pdf wasn't produced") >> signal(error ("PDF file ./test.pdf wasn't produced")) >> error("PDF file ./test.pdf wasn't produced") >> org-latex-compile("./test.tex") >> #[(file) "\301!\207" [file org-latex-compile] 2]("./test.tex") >> org-export-to-file(latex "./test.tex" nil nil nil nil nil #[(file) >> "\301!\207" [file org-latex-compile] 2]) >> org-latex-export-to-pdf(nil nil nil nil) >> (org-open-file (org-latex-export-to-pdf nil s v b)) >> (if a (org-latex-export-to-pdf t s v b) (org-open-file (org-latex-export-to-pdf nil s v b))) >> (lambda (a s v b) (if a (org-latex-export-to-pdf t s v b) >> (org-open-file (org-latex-export-to-pdf nil s v b))))(nil nil nil nil) >> org-export-dispatch(nil) >> call-interactively(org-export-dispatch nil nil) >> command-execute(org-export-dispatch) >> >> This seems less useful to me than the *Messages* buffer: >> > > Yes, probably, but if I can get people to submit backtraces when getting > an error, we can cut down the email volume by a factor of 2.43 (making up > fictitious data to bolster my case...) In all seriousness, at least it > shows that you are not going down some strange path. > > It's not clear to me why the error message in the message file is different > from the error message above though. > >> Debug on Error enabled globally >> org-babel-exp processing... >> executing Dot code block... >> Wrote /var/folders/d4/xb7t0gbd0f97p6494kz5xzdnmlncz8/T/babel-2213VOW/ob-input-22136yU >> Code block evaluation complete. >> Saving file /Users/davisp/Dropbox/HMH/test.tex... >> Wrote /Users/davisp/Dropbox/HMH/test.tex >> Processing LaTeX file ./test.tex... >> pdflatex: Command not found. [3 times] >> Entering debugger... >> Mark set >> End of buffer >> >> I did verify that the shell, my default of tcsh, does show pdflatex at >> the right location, /usr/texbin/pdflatex >> > > In combination, this pretty much says that org-latex-pdf-process was > called (by examining the code for org-latex-compile) and it is set to > the default value of invoking pdflatex three times (hence - probably - > the "command not found 3 times" error), so as I said the standard path. > > As others have pointed out, your emacs does not know where to find > pdflatex, even though your tcsh might. If your emacs is started from a > tcsh that can find pdflatex, that would be strange; if it is started > from your desktop environment/window manager, not so much (there are > many things that could go wrong). > > OTOH, if exec-path contains the directory where pdflatex resides, then > things are a bit screwy: exec-path is used by call-process, which is > used by shell-command, which is used by org-latex-compile: so pdflatex > should be found - that's a bit of a mystery. shell-command (and call-process, I guess) seems not to use exec-path - at least not always. For example: #+BEGIN_SRC emacs-lisp :results output (shell-command "which ebrowse") #+END_SRC fails to find ebrowse even though exec-path leads to it. And #+BEGIN_SRC emacs-lisp (shell-command "echo $PATH" "*path*") #+END_SRC shows what (getenv "PATH") yields - not exec-path Give `setenv' a try. Best, Chuck > > What happens if you say M-x shell-command RET pdflatex RET? > > Somebody suggested running "which pdflatex" in your shell - what does > that say? > > And you say it should be in /usr/texbin - what happens if you invoke > it with an absolute path: "/usr/texbin/pdflatex" in your shell? > > -- > Nick > > > >