3

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.

mbigras
  • 7,664
  • 11
  • 50
  • 111
  • 1
    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 Nov 16 '13 at 09:45
  • You might have more luck on tex.stackexchange.com. – Robin Green Nov 16 '13 at 12:55
  • This is an Emacs-related question, not a TeX-related one. Stack Overflow should be the appropriate place. – Ha-Duong Nguyen Nov 16 '13 at 13:04
  • 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 Nov 16 '13 at 23:47
  • 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 Nov 17 '13 at 16:08
  • I think you will find that the forum participants, both here and over at http://tex.stackexchange.com/questions/tagged/emacs , are very knowledgeable about AUCTeX running on Emacs -- the link cited goes straight to the `emacs` tag. Your issue can probably be resolved in either forum location. Since the forums are related, you cannot cross-post to both simultaneously. – lawlist Nov 17 '13 at 18:11
  • 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"))`. – lawlist Nov 17 '13 at 18:18
  • lawlist, this is a huge help, now I can compile my tex documents. But I can't view them as .dvis without installing x11. I'd like to view them as pdfs anyways but when trying to generate and view the output as pdfs by adding the following to my .emacs file http://yfu.me/auctex-evince-file/ Now when emacs boots up I get this error message: "File error: Cannot open load file, preview-latex.el" – mbigras Nov 18 '13 at 08:04
  • this seems like a new question so I'm going to post it as a new question, thanks again for your help this far lawlist – mbigras Nov 19 '13 at 00:18

2 Answers2

2

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

Community
  • 1
  • 1
noir
  • 185
  • 1
  • 10
1

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"))
mbigras
  • 7,664
  • 11
  • 50
  • 111
  • I'm glad that helped. I've posted my current configuration for OSX and Windows XP in an alternative answer, in the event that there is anything there that you would like to splice into your personal setup. – lawlist Nov 22 '13 at 06:06