[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] Engine check
From: |
Mosè Giordano |
Subject: |
Re: [AUCTeX] Engine check |
Date: |
Mon, 9 May 2016 13:22:52 +0200 |
Hi Joost,
2016-05-09 13:15 GMT+02:00 Joost Kremers <address@hidden>:
> 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)?
Of course there is ;-) See `TeX-check-engine' variable. It's local
by default, but you can make it so, if you want.
> 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è