11

I have discovered a behavior that I cannot explain. When compiling the MWE

\listfiles
\documentclass{article}
%\usepackage{fontspec}
\title{foo\thanks{bar}}
\author{baz\thanks{qux}}
\setlength{\textheight}{2.25in} % just for the example

\begin{document}
\maketitle
\end{document}

with XeLaTeX or LuaLaTeX, the result is as expected:

enter image description here

Corresponding file list:

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
 ***********

However, uncommenting \usepackage{fontspec} and compiling with either XeLaTeX or LuaLaTeX results in

enter image description here

Corresponding file list:

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
fontspec.sty    2014/06/21 v2.4a Font selection for XeLaTeX and LuaLaTeX
   expl3.sty    2015/02/13 v5524 L3 programming layer (loader) 
expl3-code.tex    2015/02/13 v5524 L3 programming layer 
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
l3unicode-data.def    2015/02/12 v5523 L3 Unicode data
l3xdvipdfmx.def    
  xparse.sty    2014/11/25 v5471 L3 Experimental document command parser
fontspec-patches.sty    2014/06/21 v2.4a Font selection for XeLaTeX and LuaLaTe
X
fontspec-xetex.sty    2014/06/21 v2.4a Font selection for XeLaTeX and LuaLaTeX
 fontenc.sty
  eu1enc.def    2010/05/27 v0.1h Experimental Unicode font encodings
  eu1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern
xunicode.sty    2011/09/09 v0.981 provides access to latin accents and many oth
er characters in Unicode lower plane
 eu1lmss.fd    2009/10/30 v1.6 Font defs for Latin Modern
graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2014/10/28 v1.0p Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
   xetex.def    2014/07/25 v4.03 LaTeX color/graphics driver for XeTeX (RRM/JK)

fontspec.cfg
   t3cmr.fd    2001/12/31 TIPA font definitions
 ***********

As you can see, only one distinct footnote mark is used when fontspec is loaded. This happens even if I load a system font using \setmainfont and/or friends. I use vanilla TeX Live 2014 (updated today) on Windows 7.

Is there a reason for this behavior or a problem with my setup? Or is this a bug that should be reported?

10

The problem is that fontspec-patches.sty redefines \@fnsymbol as a protected function, while it should be fully expandable:

\listfiles
\documentclass{article}
\usepackage{fontspec}

\ExplSyntaxOn
\cs_set:cpn {@fnsymbol} #1 % NOT \cs_set_protected:cpn !!!
 {
  \int_case:nnF {#1}
   {
    {0} {}
    {1} { \mode_if_math:TF *\textasteriskcentered }
    {2} { \mode_if_math:TF \dagger\textdagger }
    {3} { \mode_if_math:TF \ddagger\textdaggerdbl }
    {4} { \mode_if_math:TF \mathsection\textsection }
    {5} { \mode_if_math:TF \mathparagraph\textparagraph }
    {6} { \mode_if_math:TF \|\textbardbl }
    {7} { \mode_if_math:TF {**}{\textasteriskcentered\textasteriskcentered} }
    {8} { \mode_if_math:TF {\dagger\dagger}{\textdagger\textdagger} }
    {9} { \mode_if_math:TF {\ddagger\ddagger}{\textdaggerdbl\textdaggerdbl} }
   }
   { \@ctrerr }
 }
\ExplSyntaxOff

\setlength{\textheight}{2.25in} % just for the example

\begin{document}

\title{foo\thanks{bar}}
\author{baz\thanks{qux}}
\maketitle

\end{document}

enter image description here

The protection should be at the level of the values, not at the main function's.

  • 6
    Indeed, I reported this to Will some time ago! – Joseph Wright Mar 4 '15 at 7:22
  • 1
    @JosephWright Fixing this bug warrants issuing a new version of fontspec. – egreg Mar 4 '15 at 7:24
  • Indeed! @JosephWright did you report this over "official channels" or should I do so? (Might help expedite a fix and all that.) – Paul Gessler Mar 4 '15 at 10:47
  • @PaulGessler Was just an e-mail to Will, I think: probably should get logged in the GitHub database – Joseph Wright Mar 4 '15 at 10:56
  • 3
    @JosephWright, ok, thanks for the info. Issue logged at GitHub here. – Paul Gessler Mar 4 '15 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.