I installed emacs23 on my Ubuntu 13.10 64-bit system. I also downloaded the AucTeX tarball and installed it (./configure
then make
and finally make install
). Now I get the LaTeX commands in the menu of emacs and the key-bindings also work well. But I am able to compile only in LaTeX mode. That is, to generate the pdf I have to go the directory and give pdflatex
command in the terminal. Secondly, I tried the Other option in the compilation in emacs but pdflatex is not present as a command there. I would like to run pdflatex directly instead of LaTeX compilation so that it modifies my pdf. Secondly, I am not able to run XeLaTeX or LuaTeX in emacs as well. These are the compilation options available for me:
Also, I tried a sample code, I am able to compile and get the pdf in the terminal using latex
and pdflatex
commands but emacs shows me some error.
Here is the code which I ran:
\documentclass[12pt]{article}
\author{Subham Soni S.}
\date{\today}
\title{Installing a new Kernel(ver. 3.13.3) to the Existing Ubuntu Operating System}
\begin{document}
\maketitle
To replace the existing \textsl{kernel} with a new one, do the following:
\begin{enumerate}
\item Download the latest kernel from \texttt{www.kernel.org}, the files will be compressed in tarball.
\end{enumerate}
\end{document}
The contents of my .emacs file are as follows:
(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
I would like to make emacs a complete IDE for LaTeX. What do I need to do?
Best Answer
If you want to get PDF output by default using Emacs, you can add this to your
.emacs
:Alternatively, you can declare 'local' variables that are applied per-file. This is done at the end of the file, using a 'Local Variables' block. For example ---
--- tells Emacs that the major mode is LaTeX-mode and that you want to get PDF output rather than DVI output. (You could also add
\pdfoutput=1
in your preamble; but this has nothing to do with Emacs.) This block, by contrast ------ tells Emacs you want to use LaTeX-mode, the flyspell minor mode, and use LuaTeX as the backend/engine (LuaTeX produces PDF by default). Regarding the engine, you can switch, say, to LuaTeX even after the local variables have been set by using.
Or, if you want to switch to XeTeX, then replace
luatex
withxetex
. Note, finally, that we are talking about the engine, so do not uselualatex
orxelatex
in the above settings. AUCTEX is usually clever enough to figure out which format (TeX, LaTeX, ConTeXt) to use by parsing the file.