I have a weird behavior of the TeX-PDF-from-DVI
variable from AUCTeX: it keeps being set to "Dvips", and Emacs keeps calling latex instead of pdflatex.
I start with a minimal file test.tex
.
\documentclass{article}
\begin{document}
Some text.
\end{document}
I also have with a minimal .emacs
file.
(add-to-list 'load-path "~/emacs.d/lisp")
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
When I open test.tex
in Emacs, the value of variable TeX-PDF-mode
is t
, and the value of TeX-PDF-from-DVI
is nil
. This is what I want. However, when I add the line \usepackage[pdftex]{geometry}
as line 2, save the file, restart Emacs and reload the file, the value of TeX-PDF-from-DVI
becomes "Dvips". Correspondingly, when I type C-c C-c, the file is compiled to DVI rather than PDF.
After that, I tried customizing variable TeX-PDF-from-DVI
to "No DVI to PDF conversion". This adds
(custom-set-variables
...
'(TeX-PDF-from-DVI nil)
...
to .emacs
, as expected, but it does not change the value of TeX-PDF-from-DVI
in the test.tex
buffer, which is still "Dvips". When I restart Emacs and load test.tex
, the value of TeX-PDF-from-DVI
is still "Dvips". Even adding the line %%% TeX-PDF-from-DVI: nil
at the end of the file in the Local Variables section does not help: after reloading the file the value is still "Dvips".
I am not sure how it started. For a long time I only used pdflatex, and Emacs never compiled to DVI. Then I worked with a file that used PSTricks, and Emacs recognized that it needs to compile to PS through DVI. But now I can't restore the original behavior. I have to run (setq TeX-PDF-from-DVI nil)
or select Command | TeXing Options | PDF from DVI | Compile directly to PDF every time I start Emacs.
My questions are the following.
- How can I make compiling to PDF the default behavior, while preferably retaining parsing the file looking for content that does need to be compiled through DVI?
- What sets
TeX-PDF-from-DVI
besides customization (which apparent does not work)?
\usepackage[pdftex]{geometry}
, simply\usepackage{geometry}
is quite enough.M-x list-packages RET
, mark the auctex package for installation withi
, and hitx
to execute the installation procedure, restart Emacs and try it again? After the restart, also check your installation withM-x list-load-path-shadows RET
and check if you have leftovers.list-packages
.list-load-path-shadows
shows "/usr/share/emacs/site-lisp/latex-cjk-thai/thai-word
hides/usr/share/emacs/26.3/lisp/language/thai-word
". The value ofTeX-PDF-from-DVI
did not change: it is still "Dvips".