Discussion:
[AUCTeX] Engine check
Joost Kremers
2016-05-09 11:15:10 UTC
Permalink
Hi all,

I just ran into the following issue: I have a LaTeX file that has the
following in the preamble:

```
\usepackage{ifxetex}

\ifxetex
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Linux Biolinum O}
\setsansfont[Mapping=tex-text]{Linux Biolinum O}
\usepackage{polyglossia}
\setmainlanguage{english}
\else
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[english]{babel}
\fi
```

The file also has a file-local variable declaration setting `TeX-engine`
to `default`. (The global value of `TeX-engine` is xetex in my
configuration).

When I proceed to compile this file, I get a message saying "XeTeX,
LuaTeX are required to build this document. Do you want to select one of
these engines? (y or n)?" I assume this warning is triggered by the use
of fontspec and/or polyglossia, but since these are inside an \ifxetex
block, they don't really "count".

TBH I find it somewhat annoying to be given this warning each time I'm
trying to compile the document. Is it possible to turn this checking off
(either globally or, preferably, on a per-file basis)?

Also, in terms of refining this functionality, would it be possible to
make it a bit smarter, so that \ifxetex blocks are ignored? Or if that
becomes too error-prone, would it be possible to ask this question only
once per session and file? I can live with being asked once if I want to
use Xe/LuaTeX, but being asked every time I'm compiling a file is
annoying...
--
Joost Kremers
Life has its moments
Mosè Giordano
2016-05-09 11:22:52 UTC
Permalink
Hi Joost,
Post by Joost Kremers
Hi all,
I just ran into the following issue: I have a LaTeX file that has the
```
\usepackage{ifxetex}
\ifxetex
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Linux Biolinum O}
\setsansfont[Mapping=tex-text]{Linux Biolinum O}
\usepackage{polyglossia}
\setmainlanguage{english}
\else
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[english]{babel}
\fi
```
The file also has a file-local variable declaration setting `TeX-engine`
to `default`. (The global value of `TeX-engine` is xetex in my
configuration).
When I proceed to compile this file, I get a message saying "XeTeX,
LuaTeX are required to build this document. Do you want to select one of
these engines? (y or n)?" I assume this warning is triggered by the use
of fontspec and/or polyglossia, but since these are inside an \ifxetex
block, they don't really "count".
TBH I find it somewhat annoying to be given this warning each time I'm
trying to compile the document. Is it possible to turn this checking off
(either globally or, preferably, on a per-file basis)?
Of course there is ;-) See `TeX-check-engine' variable. It's local
by default, but you can make it so, if you want.
Post by Joost Kremers
Also, in terms of refining this functionality, would it be possible to
make it a bit smarter, so that \ifxetex blocks are ignored? Or if that
becomes too error-prone, would it be possible to ask this question only
once per session and file? I can live with being asked once if I want to
use Xe/LuaTeX, but being asked every time I'm compiling a file is
annoying...
TeX conditionals are a known problem for AUCTeX, but for this case a
possibility can be to add

(TeX-check-engine-add-engines nil)

in ifxetex style file. I'll consider it, thanks for pointing this out.

Bye,
Mosè
Joost Kremers
2016-05-09 11:41:56 UTC
Permalink
Hi Mosè,

Thanks for the quick reply!
Post by Mosè Giordano
Post by Joost Kremers
TBH I find it somewhat annoying to be given this warning each time I'm
trying to compile the document. Is it possible to turn this checking off
(either globally or, preferably, on a per-file basis)?
Of course there is ;-) See `TeX-check-engine' variable. It's local
by default, but you can make it so, if you want.
Great! I tried finding such an option, but apparently I didn't try hard
enough... :-(
Post by Mosè Giordano
TeX conditionals are a known problem for AUCTeX,
Yes, I figured as much.
Post by Mosè Giordano
but for this case a
possibility can be to add
(TeX-check-engine-add-engines nil)
in ifxetex style file. I'll consider it, thanks for pointing this out.
Like I said, being asked once would be fine as well.
--
Joost Kremers
Life has its moments
Mosè Giordano
2016-05-09 20:48:41 UTC
Permalink
Hi Joost,
Post by Joost Kremers
Hi Mosè,
Thanks for the quick reply!
Post by Mosè Giordano
Post by Joost Kremers
TBH I find it somewhat annoying to be given this warning each time I'm
trying to compile the document. Is it possible to turn this checking off
(either globally or, preferably, on a per-file basis)?
Of course there is ;-) See `TeX-check-engine' variable. It's local
by default, but you can make it so, if you want.
Great! I tried finding such an option, but apparently I didn't try hard
enough... :-(
`TeX-check-engine' is in `TeX-command' customization group, do you
feel it fits better in another group? In addition, it's described in
"Processor Options" node of AUCTeX manual.
Post by Joost Kremers
Like I said, being asked once would be fine as well.
Now `TeX-check-engine' asks only once, if user answers that doesn't
want to change the engine. Thanks for your suggestion! I also set
`TeX-check-engine-list' to nil in ifluatex style file. We don't have
yet a style for ifxetex package, this may be an idea for our Crazy
Style File Writers ;-)

Bye,
Mosè

Loading...