I have a driver file for my thesis and all the chapters are included with \input commands. I noticed that only in the sixth chapter the section numbers are false, although they are displayed correctly in the ** table of contents**. I get ** 0.1 Nanoslits ** when I should be getting ** 6.1 Nanoslits **.

The compilation is done on Windows 10 64-bit with TexLive 2016 full installation. After a lot of tinkering I got an example that reproduces the issue and of short length. Here is the MWE and here is the associated class file:

\documentclass[titlepage, footnotes, a4paper]{kuthesismod} 
    \setmainfont[Numbers=OldStyle,Ligatures=Common,Mapping=tex-text]{Linux Libertine O}
    \setmathfont{Libertinus Math}

\emergencystretch = 1 em
        \section{Literature Review}

        \section{Thesis Outline}

    \chapter{Background Information}\label{chp:bg}
        \section{Brief review of electromagnetic theory}

        \section{Permittivities of metals}

            \subsection{Lorentz Model}

            \subsection{Drude Model}

            \subsection{Extended Drude Model}


            \subsection{Volume Plasmons}

            \subsection{Surface Plasmon Polaritons}

        \chapter{Single Scatterers}\label{chp:singlescat}

        \section{Single Grating}

        \section{Rectangular Nanoslit}


    \chapter{SPP beam launcher}\label{chp:sppbeam}

        \section{Reproduction of Hermite-Gauss SPP Beam} 

        \section{Stripe Waveguide Coupling}

    \chapter{Scalar Wave Theory}\label{chp:scalarwave} 

        \section{Antenna Arrays} 

            \subsection{Linear Arrays}

            \subsection{Coupler Design}

        \chapter{Mode Coupling}\label{chp:modecoup}



            \subsection{\texorpdfstring{Design with $w_b$ = 500 nm, $h$ = 800 nm }{Design 1}}

            \subsection{\texorpdfstring{Design with $w_b$ = 900 nm, $h$ = 800 nm }{Design 2}}

            \subsection{\texorpdfstring{Design with $w_b$ = 900 nm, $h$ = 800 nm with SPP on air-metal}{Design 3}}

    \chapter{Conclusion and Future Work}\label{chp:conc}

  • 3
    And do you think by omitting the relevant code of chapter1.tex we're able to give more than guesses only? ;-)
    – user31729
    Commented May 30, 2017 at 17:19
  • 4
    I think it is because of the Gremlins which are hiding in that file.
    – Skillmon
    Commented May 30, 2017 at 17:33
  • 2
    Which document class do you use? How or were is \chapref defined?
    – Mico
    Commented May 30, 2017 at 19:59
  • 1
    Off-topic: Instead of 80 \si{\micro\meter}, you should write \SI{80}{\micro\meter}. If nothing else, that'll ensure you'll never have a line break between the number and its associated unit.
    – Mico
    Commented May 30, 2017 at 20:01
  • 2
    there is no way that anyone can answer this question, you need to cut the example down so it just needs two or three (small) chapter files and put the full code of all needed files into code sections in the question. Commented May 30, 2017 at 21:24

1 Answer 1


xelatex is finding the wrong font. If one load the font by name as done in David's example

This is a more minimal example just using article class, it gives [6] with pdftex and luatex and [0] with xetex.

anyone feel free to pick up this example, if you want to answer (I'll delete this if someone's posted an answer when I next come by:-)


    \setmainfont[Numbers=OldStyle,Ligatures=Common]{Linux Libertine O}


[{\bfseries\slshape 6}]


it uses LinLibertine_RZI.otf instead of the correct LinLibertine_RBI.otf and this hasn't the correct numbers.


\font\test= "[LinLibertine_RBI.otf]:script=latn;language=DFLT;+onum;"

\test 6 1234567890

\font\test= "Linux Libertine O/BI/OT:script=latn;language=DFLT;+onum;"

\test 6 1234567890

\font\test= "[LinLibertine_RZI.otf]:script=latn;language=DFLT;+onum;"

\test 6 1234567890


enter image description here

So you should load at least this font by file name instead than by font name. E.g. by loading it through the libertine package or manually:


            BoldItalicFont = LinLibertine_RBI]{Linux Libertine O}

[{\bfseries\slshape 6}]



Wrong font means that xelatex finds a different font than lualatex. LinLibertine_RZI.otf is the italic semibold variant of libertine.

But that the font gives wrong old style numbers is not xelatex faults, it happens with luatex too if one force it to use the font. This is cleary a defect in the font and so I added a bug report: https://sourceforge.net/p/linuxlibertine/bugs/331/

  • Thanks for the through explanation I will go over it. So is it always safer to load fonts by the exact file name like fontname.ttf or fontname.otf?
    – Vesnog
    Commented May 31, 2017 at 10:12
  • 1
    Yes, if you want complete control file name are better. But by font name is often faster. Commented May 31, 2017 at 10:15

You must log in to answer this question.

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