[OS X TeX] Aquamacs, AucTeX, and preview-latex

Cameron Hooper chooper at umich.edu
Mon Nov 28 02:05:15 CET 2005

On Nov 27, 2005, at 4:37 PM, Peter Dyballa wrote:

> Am 27.11.2005 um 18:45 schrieb Cameron Hooper:
>> Really? Aquamacs help (Aquamacs for Emacs Veterans -> Latex  
>> Support) says to install the AucTeX package maintained by Norm  
>> Gall at http://yaced.sourceforge.net. Before I did this, visiting  
>> a .tex file loaded tex-mode, not auctex.
> The Help is probably elder then the ELisp code. Look here: / 
> Applications/Aquamacs Emacs.app/Contents/Resources/site-lisp/edit- 
> modes/preview/
> You make AUCTeX take regime over all TeX files you need to enable it:
> 	(add-hook 'LaTeX-mode-hook 'turn-on-reftex)   ; with AUCTeX LaTeX  
> mode
> 	(add-hook 'LaTeX-mode-hook '(lambda () (TeX-fold-mode 1)))
> and again you need to load a bit: (require 'tex-site). And here can  
> be one problem: I think this file needs so customisation for its  
> locality.

I'm using the documentation that came with the application bundle.  
Anyway I removed the auctex package I installed and added the above  
lines. Emacs chokes on (require 'tex-site). Spotlight fails to find  
tex-site.el anywhere on my system. If aquamacs comes with auctex  
preinstalled, surely it must come with a copy of tex-site.el.

>>> You not only need to activate preview-latex by loading the ELisp  
>>> file, you too need to add the path to the preview-latex files:
>>> 	(add-to-list 'load-path "/Library/Application Support/Emacs/ 
>>> preview")
>> I assumed Aquamacs did this automatically as it explicitly says  
>> auctex should be installed at this location. Anyway I added the  
>> following
>> (add-to-list 'load-path "/Library/Application Support/Emacs/site- 
>> lisp/preview")
>> but nothing changed. So I then tried
>> (add-to-list 'load-path "/Library/Application Support/Emacs/site- 
>> lisp/site-start.d")
>> Again no change.
> I don't know what might be going wrong. I hope you did the  
> installation of AUCTeX and preview-latex according to the  
> documentation and let make do it ...

I installed auctex using the installer available from http:// 
yaced.sourceforge.net as suggested by the Aquamacs documentation.  
There is nothing to make, it comes "pre-made". My understanding is  
that the job of the installer is to take care of the usual configure/ 
make process automatically.

> You can put into site-start.el or .emacs or into *scratch* with  
> eval-region when you need it this little bit of code:
> 	(defadvice load (before debug-log activate)
> 	  (message "(Tipp von Kai G):Loading now: %s" (ad-get-arg 0)))

This produces the following:

An error has occurred while loading `/Users/cameron/.emacs':

File error: Cannot open load file, tex-site

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

(XXX): Loading now: /Library/Preferences/Emacs/Preferences
(XXX): Loading now: /Library/Preferences/Aquamacs Emacs/Preferences
(XXX): Loading now: ~/Library/Preferences/Emacs/Preferences
(XXX): Loading now: ~/Library/Preferences/Aquamacs Emacs/Preferences
Loading ~/Library/Preferences/Aquamacs Emacs/Preferences (source)...done
(XXX): Loading now: ~/Library/Preferences/Aquamacs Emacs/ 
Loading latexenc...done
Loading tex-mode...done
Loading font-lock...done
Loading jit-lock...done

> This will record in *Messages* which files get loaded. For me, when  
> I first load a TeX source, this gets recorded:
> 	/Library/Application Support/Emacs/site-start.el
> 	(Tipp von Kai G):Lade jetzt: preview-latex.el
> 	preview-latex wird geladen
> 	...
> 	(Tipp von Kai G):Lade jetzt: /Applications/Emacs.app/Contents/ 
> Resources/site-lisp/site-start.d/auctex.el

I don't have this directory structure. Spotlight is unable to find  
auctex.el. All this is confirming for me that AucTeX does not come  
pre-installed with Aquamacs and simply needs to be activated.

Of course, I could be wrong :-) Perhaps I deleted something I  
shouldn't have from /Library/Application Support/Emacs. So I  
reinstalled Aquamacs from scratch. None of the above results changed.

>> The only files in /Library/Application Support/Emacs were added by  
>> auctex installer. I went ahead and deleted them but kept the load  
>> statement in .emacs. On startup emacs complained that it couldn't  
>> open load file preview-latex.el. So I deleted the (load "preview- 
>> latex.el" nil t t) line from .emacs. Now emacs starts but auctex  
>> is not loaded.
> As mentioned above AUCTeX needs the (require 'tex-site) first and  
> then the statements to make it take over over elder ELisp software.  
> Upon correct installation these files and directories will appear  
> in the install directory:
> 	drwxr-xr-x   6 root  admin     204 29 Sep 20:44 preview
> 	-rw-r--r--   1 root  admin     324 29 Sep 20:44 auctex.el
> 	drwxr-xr-x  43 root  admin    1462 29 Sep 20:44 auctex
> 	-rw-r--r--   1 root  admin   12421 29 Sep 20:44 tex-site.el

Okay time to review. First up I remain unconvinced that auctex/ 
preview-latex comes with aquamacs. Unless these packages are  
installed by the user, aquamacs will use tex-mode. Second, after  
installing auctex using the installer described above, aquamacs will  
then use auctex when visiting a tex file without any further  
customisation required the user AS LONG AS auctex is installed to / 
Library/Application Support/Emacs or (despite what the documentation  
claims) $HOME/Library/Application Support/Emacs. BUT preview-latex  
does not work.

In my reply to Paulo I mentioned that I had got Preview to work when  
I installed to ~/Emacs. In the above tests I removed these from from  
load path. It seems that the above experimentation broke something as  
now I am unable to regain the set up that did work earlier.

Okay. It's not worth this much work! Thanks anyway for your suggestions.


------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/

More information about the macostex-archives mailing list