0

The following MWE will show you the problem I encountered today.

As asked, the problem I see, is that in math-mode the numbers aren't displayed as in the first line. David Carlisle stated, that this is caused by the usage of Computer Modern as Math-Font.

\documentclass{standalone}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX,Numbers=OldStyle}% ,Scale=MatchLowercase} bug in current Biolinum
\setromanfont[Mapping=tex-text]{Linux Libertine O}
\setsansfont[Mapping=tex-text]{Linux Biolinum O}
\setmonofont[Mapping=tex-text]{Linux Libertine Mono O}

\begin{document}
    \begin{minipage}{6cm}
        {\addfontfeature{VerticalPosition=Superior}1234567890 Libertine}\newline
        $1^{1234567890 Libertine}$\\
        \textsuperscript{1234567890}\\
        \begin{equation}
            1^{1234567890}
        \end{equation}
        Test -- {\bfseries Test}\\
        \textit{Test} -- \textit{\bfseries Test}\\
        \texttt{Test} -- \texttt{\bfseries Test}\\
        \textsc{Test} -- \textsc{\bfseries Test}\\
        \textsf{Test} -- \textsf{\bfseries Test}\\
        0123456789 -- {\bfseries 0123456789}\\
        \textit{0123456789} -- \textit{\bfseries 0123456789}\\
        \texttt{0123456789} -- \texttt{\bfseries 0123456789}\\
        \textsc{0123456789} -- \textsc{\bfseries 0123456789}\\
        \textsf{0123456789} -- \textsf{\bfseries 0123456789}
    \end{minipage}
\end{document}

As you can see in the following picture, the superscript isn't used correctly in math-mode while it is used with addfontfeature.

XeLaTeX with Linux Libertine

  • There's a lot of numbers:-), it might help if you said what exactly the problem you see, it if you annotated the image with some red circles or something – David Carlisle Feb 5 '15 at 21:19
  • math is still using computer modern, what output do you expect? – David Carlisle Feb 5 '15 at 21:32
1

You want to use newtxmath with the libertine option:

\documentclass{standalone}
\usepackage[libertine]{newtxmath}
\usepackage[no-math]{fontspec}
%\defaultfontfeatures{Numbers=OldStyle}
\setmainfont{Linux Libertine O}
\setsansfont{Linux Biolinum O}
\setmonofont{Linux Libertine Mono O}


\begin{document}
    \begin{minipage}{6cm}
        {\addfontfeature{VerticalPosition=Superior}1234567890 Libertine}\newline
        $1^{1234567890 Libertine}$\\
        \textsuperscript{1234567890}\\
        \begin{equation}
            1^{1234567890}
        \end{equation}
        Test -- {\bfseries Test}\\
        \textit{Test} -- \textit{\bfseries Test}\\
        \texttt{Test} -- \texttt{\bfseries Test}\\
        \textsc{Test} -- \textsc{\bfseries Test}\\
        \textsf{Test} -- \textsf{\bfseries Test}\\
        0123456789 -- {\bfseries 0123456789}\\
        \textit{0123456789} -- \textit{\bfseries 0123456789}\\
        \texttt{0123456789} -- \texttt{\bfseries 0123456789}\\
        \textsc{0123456789} -- \textsc{\bfseries 0123456789}\\
        \textsf{0123456789} -- \textsf{\bfseries 0123456789}
    \end{minipage}
\end{document}

I removed the Numbers=OldStyle option for better comparison.

The size of superscripts doesn't match, because the superscript glyphs in the OTF font are not meant for math.

enter image description here

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.