4

In XeLaTeX I have a \textsuperscript issue with all fonts I've tested, with regard to the dash. As opposed to what happens in LaTeX, in XeLaTeX the dash does not get superscripted.

This is a MWE:

\documentclass{article}
\usepackage{xltxtra}
\defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}
\setmainfont[Ligatures=Common,
  Numbers=OldStyle,
  ]{Minion Pro}

\begin{document}

88--100\textsuperscript{88--100}

\end{document}

This is the result:

enter image description here

Any ideas as to what's going on?

1
  • 2
    xltxtra loads realscripts package, that is the culprit. realscripts activates OpenType features for sub/superscripts, but most fonts have limited glyph coverage in those features and it seems to be the case with the font you are using. – Khaled Hosny Sep 12 '13 at 5:37
4

I find that the problem disappears completely if you don't load the xltxtra package and add the instruction

\usepackage{fontspec}

to the preamble.

From page 4 of the fontspec manual:

The xltxtra package adds some minor extra features to XELATEX, including, via the metalogo package, the \XeTeX macro to typeset the XETEX logo. While this package was previously recommended, it serves a much smaller role nowadays and generally will not be required. Please consult its documentation to assess whether its features are warranted before loading it.

In short, you may not need the xltxtra package at all.

enter image description here

% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}
\setmainfont[Ligatures=Common,
  Numbers=OldStyle,]{Minion Pro}
\begin{document}
88--100 \textsuperscript{88--100}
\end{document}
2
  • I hadn't noticed xltxtra. Good catch! – Gonzalo Medina Sep 12 '13 at 3:36
  • 1
    @NVaughan - The key to solving the problem was the fact that you posted a complete MWE, as it showed exactly which packages you were loading. – Mico Sep 12 '13 at 3:47
1

I used the MWE, just replacing "Minion Pro" with "Arial" and the problem dissappears.

Removing xltxtra requires to add fontspec. According to the xltxtra package manual, it loads "fixltx2e, metalogo, xunicode and fontspec". I tried fontspec with every package loaded by xltxtra, one by one and the problem does not present. If I add xltxtra instead, the problem presents again.

Therefore, the problem is associated with xltxtra.

But, if you use xltxtra without fontspec, and use a different font, for instance "Arial" or "Times New Roman", the problem does not present.

What call my attention is that I don't have installed "Minion Pro", but the MWE is compilable by XeLaTeX. Therefore, I must conclude that the problem is specific to xltxtra and with how "setmainfont" manages "Minion Pro" or its absence.

I should add that on second reading of the manual (Section 2.1), if you use "\usepackage[no-sscript]{xltxtra}" in the MWE, the problem disappears.

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