[OS X Emacs] problem running (pdf)latex

Thomas S. Dye tsd at tsdye.com
Wed Jul 9 22:28:08 EDT 2008


Art,

Put the following code in ~/Library/Application\ Support/Aquamacs\  
Emacs/site-prestart.el or get the nightly build for 1.5.

;;from mac-extra-functions.el, version 1.63

  (defun mac-read-environment-vars-from-shell ()
  "Import the environment from the system's default login shell
  specified in `shell-file-name'."
     (with-temp-buffer
       ;; execute 'printenv' with the default login shell,
       ;; running the shell with -l (to load the environment)
       (setq default-directory "~/")	; ensure it can be executed
       ;; To Do: use call-process instead -> this here
       ;; will invoke two bashes

       (let ((shell-login-switch
  	     (or shell-login-switch
  		 (if (string-match ".*/\\(ba\\|z\\)sh" shell-file-name)
  		     "-l"
  		   (if (string-match ".*/\\tcsh" shell-file-name)
  		     ""
  		   (if (string-match ".*/ksh" shell-file-name)
  		       "" ;; works for ksh
  		     (message "Could not retrieve login shell environment with  
login shell: %s" shell-file-name)
  		   ;; won't work for csh, because it doesn't take -l -c ...
  		   ))))))
		
  	(call-process shell-file-name nil
  	       t nil
  	        shell-login-switch
  		shell-command-switch
  		"printenv"))
       (goto-char (point-min))
       (while (re-search-forward "^[A-Za-z_0-9]+=()\s*[^\x]*?
  \s*}\s*$" nil t)
  	(replace-match "..." nil nil))
       (goto-char (point-min))
       (while (search-forward-regexp "^\\([A-Za-z_0-9]+\\)=\\(.*\\)$"  
nil t)
  	(setenv
  	 (match-string 1)
  	 (if (equal (match-string 1) "PATH")
	     (concat (match-string 2) ":" (getenv "PATH"))
  	     (match-string 2))))))

Tom

On Jun 25, 2008, at 5:02 AM, Art Werschulz wrote:

> Hi.
>
> Using Aquamacs 1.4 with AUCTeX ...
>
> I'm trying to run (pdf)latex from within same.  I get the following  
> in the *blah output* buffer (where blah is the full path to the  
> LaTeX file, minus the ".tex"):
>
> <quote>
> Running `LaTeX' on `foo' with ``pdflatex  -interaction=nonstopmode  
> "\input" foo.tex''
> /bin/sh: pdflatex: command not found
>
> LaTeX exited abnormally with code 127 at Wed Jun 25 10:58:33
> </quote>
>
> Note that if I do "M-x shell", I have:
>
> agw at home:~$ which pdflatex
> /usr/local/texlive/2007/bin/i386-darwin/pdflatex
>
> Suggestions?  Thanks.
>
>
> Art Werschulz
> 207 Stoughton Avenue, Cranford  NJ 07016-2838
> (908) 272-1146
>
>
> _____________________________________________________________
> MacOSX-Emacs mailing list
> MacOSX-Emacs at email.esm.psu.edu
> http://email.esm.psu.edu/mailman/listinfo/macosx-emacs
> List Archives: http://dir.gmane.org/gmane.emacs.macintosh.osx




More information about the MacOSX-Emacs mailing list