I have a LaTeX file using lots of PDF figures (mostly because converting figures to EPS is a waste of disk space), so it requires to use pdflatex
.
I added these lines to the end of my main file:
%% Local Variables:
%% latex-run-command: pdflatex
%% End:
Whenever when I open the file, Emacs asks me whether to evaluate these settings, and I confirm.
However, C-c C-f
still runs latex \\nonstopmode\\input input.tex
.
Why doesn't it work? (this is the question I should point out clearly)
Also in Customize the setting of latex-run-command
still is Standard
.
After a significant waste of time, I wrote a Makefile that builds my document (keeping the PDF open in evince). So I use compile
to build the file now.
Details:
When I run C-c C-f
, the output starts like this:
latex \\nonstopmode\\input Farbe.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/TeX Live for SUSE Linux) (preloaded format=latex)
When I run pdflatex
manually, the output starts like this:
pdflatex Farbe
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/TeX Live for SUSE Linux) (preloaded format=pdflatex)
So the preloaded format is different, causing errors like
! LaTeX Error: Cannot determine size of graphic in RGB-Cube-3D.pdf (no Bounding
Box).
Also, using latex-run-command: "pdflatex"
makes no difference: pdflatex
is not being used.
More details:
When I load the file (having changed the settings to the following)
%% Local Variables:
%% latex-run-command: "pdflatex"
%% End:
and then do C-h v latex-run-command
, I get:
latex-run-command’s value is "pdflatex"
Original value was "latex"
Local in buffer Farbe.tex; global value is "latex"
This variable’s value is file-local.
This variable may be risky if used as a file-local variable.
Documentation:
Command used to run LaTeX subjob.
LaTeX Mode sets ‘tex-command’ to this string.
See the documentation of that variable.
But still, the command run is not pdflatex
, but latex
!
More info (2019-11-28)
My Emacs is 25.3.1, and in loaddefs.el
I have:
(defvar latex-run-command (purecopy "latex") "\
Command used to run LaTeX subjob.
LaTeX Mode sets `tex-command' to this string.
See the documentation of that variable.")
And tex-mode.el contains:
(setq-local tex-command latex-run-command)
Even when I tried this, it did nor work:
%% Local Variables:
%% latex--command: "pdflatex"
%% eval: (add-hook 'latex-mode-hook (lambda () \
%% (setq latex-run-command "pdflatex")))
%% End:
I also had tried variants setq-local
, tex-command
instead of latex-run-command
, but it all did not work.
Neither does it work after having used set-variable
interactively to set latex-run-command
, nor does it work after I had set the variable in "Customize Option: Latex Run Command".
emacs -Q
and your local variables. AfterC-c C-f
it does say$ latex \\nonstopmode\\input tvFellerprobe.tex This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018/Arch Linux) (preloaded format=latex)
. Is it the same for you or not, when starting the things withemacs -Q
auctex
? It is a much richer mode than the native latex mode and might have something to accommodate your needs.tex-command
fromlatex-run-command
runs before the latter is given its file-local value.