3
votes

What I'd like is to be able to use emacs and auctex successfully.

Some system information:

ProductName:    Mac OS X
ProductVersion: 10.8.5
BuildVersion:   12F45

Emacs
Version 24.3 (9.0)

AUCTeX-version is a variable defined in `tex-site.el'.
Its value is "11.87"

There's two things that I've tried. First, installing auctex interactively from within emacs as recommended:

M-x package-list-packages RET

On the surface things seem to be working as expected:

\documentclass{article}
\bein{document}
Hello world 
\section{Here lies a section}
Hello people.
\end{doument}

You can't see it in the code, but on my emacs screen the syntax highlighting is working, and the auctex icons are visible. Also environment completion commands work expected (like filling in \begin and \figure stuff). Now issuing the compile command:

C-c C-c

I get the following message:

LaTeX: problems after [0] pages

looking at the source there is two mistakes that are not picked up, furthermore it seems like the document is not even compiled even if there are no mistakes, there is no dvi or pdf or aux files created. Also testing the viewing functional, nothing happens. So it seems like something isn't configured properly.

Second, without uninstalling or removing auctex (which I suspect could have to do with something but I'm not sure as we'll see later) I found the webpage: http://algorithmicallyrandom.blogspot.com/2012/08/getting-auctex-working-on-mac-os-x.html That recommends building from source:

*) ./configure --with-emacs=/Applications/Emacs.app/Contents/MacOS/Emacs --disable-preview --with-lispdir=/Applications/Emacs.app/Contents/Resources/site-lisp/
*) make
*) sudo make install

Then add these lines to your .emacs file

(load "auctex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)

Something that makes me think this installation was successful is the source I downloaded is for version 11.87 and thats the version of auctex that I'm currently running. However, the same behavior continues, basically none of the compiling or viewing functionality seems to be working.

Another thing, from reading around it seems like you also need the preview-latex.el package, when including it in my .emacs file

(load "preview-latex.el" nil t t)

I get an error so I'm pretty sure that package isn't installed properly. So my question is mainly, what am I missing here? How can I successfully run emacs and auctex (and maybe the preview-latex.el package also) together?

Maybe this includes removing auctex completely and installing it again. How do I remove an emacs package when I installed it interactively (try one)? How do I remove the emacs package when I installed it from source (try two)?

Also its possible that I haven't installed ghost script but I'm not sure how to check.

Man, I know this is a lot, I'm trying to provide any information that is required. If you've waded through this and can help me I'd be so grateful.

2
Which (La)Tex distribution are you running on your Mac? Have you tried typesetting the TeX document manually? Also, your code section has a typo (should be \begin{document} instead of \bein{document}).Ha-Duong Nguyen
You might have more luck on tex.stackexchange.com.Robin Green
This is an Emacs-related question, not a TeX-related one. Stack Overflow should be the appropriate place.Ha-Duong Nguyen
I put the typos there on purpose with the intent that they would be found by compiling them with auctex. I'm using mactex, when I compile a document from the terminal or texshop it works as expected. I also agree that it is an emacs related question, I've seen a couple unanswered questions on tex.stackexchange related to mine and they were not answered because they aren't tex related.mbigras
What is the output of running latex? i.e. Hit C-c C-l and tell us what you see. Can you run latex manually from a shell? From a shell inside Emacs?Ivan Andrus

2 Answers

2
votes

You may need to configure emacs to recognize shell path. To do that, simply install exec-path-from-shell package. There is some help from the following link. PATH and exec-path set, but emacs does not find executable

1
votes

A comment from @lawlist helped me:

Do you have texbin in your $PATH? If not, you could add this inside your .emacs or init.el file:

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