Discussion:
[AUCTeX] problem with TeX-command-extra-options
Alfredo Buttari
2017-09-25 12:50:04 UTC
Permalink
Hi,
I have a large .tex file with the following footer:

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% TeX-engine: xetex
%%% TeX-command-extra-options: "-shell-escape --enable-write18 --synctex=1"
%%% End:

When I open it I am asked whether I want to accept the potentially unsafe
value for the TeX-command-extra-options. In this message the potentially
unsafe value corresponds to what I have in the footer, i.e., "-shell-escape
--enable-write18 --synctex=1". I hit yes and the file is opened. However,
if I ask emacs to describe variable TeX-command-extra-options (with C-h
C-v) I get this:

TeX-command-extra-options is a variable defined in `tex.el'.
Its value is "--synctex=1"
Original value was ""
Local in buffer hdr.tex; global value is ""

Automatically becomes buffer-local when set.

Documentation:
String with the extra options to be given to the TeX processor.

You can customize this variable.



It seems that the value of this variable is overwritten once again in some
other place. Note that this does not happen if I create a simple file
containing only (exactly the same footer):


\documentclass{article}

\begin{document}

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% TeX-engine: xetex
%%% TeX-command-extra-options: "-shell-escape --enable-write18 --synctex=1"
%%% End:


Could you please help me figure out what's happening?

regards,
Alfredo
Mosè Giordano
2017-09-25 12:59:13 UTC
Permalink
Ciao Alfredo,
Post by Alfredo Buttari
Hi,
%%% mode: latex
%%% TeX-master: t
%%% TeX-engine: xetex
%%% TeX-command-extra-options: "-shell-escape --enable-write18 --synctex=1"
When I open it I am asked whether I want to accept the potentially unsafe
value for the TeX-command-extra-options. In this message the potentially
unsafe value corresponds to what I have in the footer, i.e., "-shell-escape
--enable-write18 --synctex=1". I hit yes and the file is opened. However, if
I ask emacs to describe variable TeX-command-extra-options (with C-h C-v) I
TeX-command-extra-options is a variable defined in `tex.el'.
Its value is "--synctex=1"
Original value was ""
Local in buffer hdr.tex; global value is ""
Automatically becomes buffer-local when set.
String with the extra options to be given to the TeX processor.
You can customize this variable.
It seems that the value of this variable is overwritten once again in some
other place. Note that this does not happen if I create a simple file
\documentclass{article}
\begin{document}
\end{document}
%%% mode: latex
%%% TeX-master: t
%%% TeX-engine: xetex
%%% TeX-command-extra-options: "-shell-escape --enable-write18 --synctex=1"
Could you please help me figure out what's happening?
If you have it, try deleting the auto/hdr.el file, automatically
generated by AUCTeX when parsing the document. The value of
`TeX-command-extra-options' is stored there, in order to make it
available to all files part of the same document, but if you change
the value of that variable you can incur this nuisance.

In addition, note that you can enable `TeX-source-correlate-mode' in
order to get forward/inverse search, without setting `--synctex=1' in
in `TeX-command-extra-options'.

Bye,
Mosè
Alfredo Buttari
2017-09-25 13:07:09 UTC
Permalink
Ciao MosÚ,
thanks a lot for the quick reply. This indeed fixed the problem. And thanks
also for the TeX-source-correlate-mode tip, this is much cleaner than
adding the --synctex option.

Regards,
Alfredo
Post by Mosè Giordano
Ciao Alfredo,
Post by Alfredo Buttari
Hi,
%%% mode: latex
%%% TeX-master: t
%%% TeX-engine: xetex
%%% TeX-command-extra-options: "-shell-escape --enable-write18
--synctex=1"
Post by Alfredo Buttari
When I open it I am asked whether I want to accept the potentially unsafe
value for the TeX-command-extra-options. In this message the potentially
unsafe value corresponds to what I have in the footer, i.e.,
"-shell-escape
Post by Alfredo Buttari
--enable-write18 --synctex=1". I hit yes and the file is opened.
However, if
Post by Alfredo Buttari
I ask emacs to describe variable TeX-command-extra-options (with C-h
C-v) I
Post by Alfredo Buttari
TeX-command-extra-options is a variable defined in `tex.el'.
Its value is "--synctex=1"
Original value was ""
Local in buffer hdr.tex; global value is ""
Automatically becomes buffer-local when set.
String with the extra options to be given to the TeX processor.
You can customize this variable.
It seems that the value of this variable is overwritten once again in
some
Post by Alfredo Buttari
other place. Note that this does not happen if I create a simple file
\documentclass{article}
\begin{document}
\end{document}
%%% mode: latex
%%% TeX-master: t
%%% TeX-engine: xetex
%%% TeX-command-extra-options: "-shell-escape --enable-write18
--synctex=1"
Post by Alfredo Buttari
Could you please help me figure out what's happening?
If you have it, try deleting the auto/hdr.el file, automatically
generated by AUCTeX when parsing the document. The value of
`TeX-command-extra-options' is stored there, in order to make it
available to all files part of the same document, but if you change
the value of that variable you can incur this nuisance.
In addition, note that you can enable `TeX-source-correlate-mode' in
order to get forward/inverse search, without setting `--synctex=1' in
in `TeX-command-extra-options'.
Bye,
MosÚ
--
-----------------------------------------
Alfredo Buttari, PhD
CNRS-IRIT
2 rue Camichel, 31071 Toulouse, France
http://buttari.perso.enseeiht.fr
Loading...