Joost Kremers
2016-05-09 11:15:10 UTC
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...
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
Joost Kremers
Life has its moments