6

Consider the following (hopefully minimal) non-working example and compile with luatex (TeXlive 2016):

\documentclass{article}
\usepackage{fontspec}
\setmainfont{texgyrebonum-regular.otf}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot[C]{{\addfontfeature{Numbers = SlashedZero}0}}
\begin{document}
\begin{Verbatim}[frame = single]
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
  Test
\end{Verbatim}
\end{document}

One can see this in the footer of the first page:

enter image description here

There is obviously something wrong. Is this a bug or am I doing something wrong?

4
  • This doesn't seem to happen with TeXlive 2015; I get a slashed zero as the footer. Commented Sep 7, 2016 at 17:00
  • It happens for me on texlive 2015 too. Don't use \addfontfeature in this place. Define a new font family/face, e.g. \newfontfamily\footerfont{texgyrebonum-regular.otf}[Numbers = SlashedZero] and use this in the footer. Commented Sep 7, 2016 at 22:11
  • Somehow the font assignment happens at a wrong time and the code is read verbatim.
    – egreg
    Commented Sep 7, 2016 at 23:12
  • @UlrikeFischer Is this mandatory or should I consider it a bug of fontspec and report it?
    – cjorssen
    Commented Sep 8, 2016 at 6:54

1 Answer 1

5

It is a fontspec/lua problem in the distribution. The file .../texmf-dist/tex/latex/fontspec/fontspec.lua on line 29/30 has the following code

local function tempswatrue()  tex.sprint([[\FontspecSetCheckBoolTrue ]]) end
local function tempswafalse() tex.sprint([[\FontspecSetCheckBoolFalse]]) end

This code, however uses the catcodes that are current instead of the standard LaTeX catcodes. These two lines should be replaced by

local latex = luatexbase.registernumber("catcodetable@latex")
local function tempswatrue()  tex.sprint(latex,[[\FontspecSetCheckBoolTrue ]]) end
local function tempswafalse() tex.sprint(latex,[[\FontspecSetCheckBoolFalse]]) end

which uses the standard LaTeX code. Of course this should be changed in the official distribution.

See https://github.com/wspr/fontspec/issues/230.

1
  • Could you place the necessary details of the external link in this post? That would make the post self-contained rather than suggesting click-throughs to some other site to see what the issue is.
    – Werner
    Commented Sep 8, 2016 at 18:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .