I'm using XeLaTeX with the ucharclasses package to automatically switch font family on unicode classes.

The problem is that the transition commands also switch the text in the header.

First page, which is OK:

page with header sans-serif

Next page, which is KO:

page with header serif

How can I isolate the change to the content of the chapter?



% Fallback management.

    papersize={152mm,214mm}, % A5 papersize + 2mm bleed.
    layouthoffset=2mm, % Bleed offset.
    layoutvoffset=2mm, % Bleed offset.

\title{Book title \\ 1 : first book}

% Helps build better header and footer; places the page number in the footer.

% Redefine fancy style.
    \fancyhead[EL]{\smaller{\smaller{\texttechnic{\MakeUppercase{\vspace{\baselineskip} \\ \thetitle}}}}}
    \fancyhead[OR]{\smaller{\smaller{\texttechnic\MakeUppercase{\chaptername\ \thechapter\ \\ \leftmark}}}}

\newfontfamily\aserif{Times New Roman}

\newfontfamily\textfallbackserif[]{Times New Roman}










\chapter{Chapter 1}




I use the Times New Roman and Arial fonts, but you can switch to the font you have on your system.

  • 2
    unrelated but never use \usepackage[utf8]{inputenc} with xelatex (all it does is make a warning that it should not be used) Feb 11 at 20:25
  • why do you show an example with special fonts? It only makes testing difficult. Use instead something available on every system like e.g. tex gyre heros and tex gyre termes? Feb 12 at 8:57
  • Thank you @DavidCarlisle
    – NemuLumeN
    Feb 12 at 20:06
  • @UlrikeFischer , thank you for your interest. You are right, this is a little inconvenient. I tried to look for tex gyre fonts, but they were not installed. Were they supposed to come with the LaTeX installation (I use Windows + MiKTeX)? In the meantime, I have simplified the font part by using Arial and Times New Roman. The issue stays the same.
    – NemuLumeN
    Feb 12 at 20:17

1 Answer 1


You can turn off character classes in the heading

     \XeTeXinterchartokenstate=0 %<<<<<<<<<<<<<<<<<<<<<<<<
      \smaller{\smaller{\texttechnic{\MakeUppercase{\vspace{\baselineskip} \\ \texttechnic\thetitle}}}}}
    \fancyhead[OR]{\smaller{\smaller{\texttechnic\MakeUppercase{\chaptername\ \thechapter\ \\ \leftmark}}}}

  • It worked. I also had to apply the same method to the other header parts. Thank you.
    – NemuLumeN
    Feb 12 at 21:37

You must log in to answer this question.

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