TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If PDFLaTeX fails to compile with

See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help.

I want to press e to get an instance of Emacs. The cursor should be on the position of the error (if TeX knows it)

I guess i should insert

export TEXEDIT="emacs magic"

to my .bashrc but what should i type instead of magic?

share|improve this question
up vote 3 down vote accepted

Since I have always an emacs open (with an emacs server active), I personally have this

export TEXEDIT="emacsclient --no-wait +%d %s"

which makes sure that you do not open tons of emacs windows around. Otherwise, just use

export TEXEDIT="emacs +%d %s"

Both versions make emacs go to the right line.

It is important to have no space left and right of the = sign.

share|improve this answer

Useful. You can somewhat "unify" the two solutions as emacsclient has a fallback editor in case the (emacs) server is not running:

export TEXEDIT="emacsclient --alternate-editor=emacs --no-wait +%d %s"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.