Bad superscript with authblk / xltxtra

I'm writing a document using the article class using XeLaTeX, and authblk to have the author / affiliation displayed using superscript. I also wants to use the package xltxtra to typeset better superscripts (for footnotes).

However, when using that last package, I noticed that the superscripts are not typeset correctly in the affiliation anymore. Actually they appear as normal font.

Here is the MWE (with 2 possible work-around commented out):

\documentclass{article}

\usepackage{fontspec}
\usepackage{xltxtra}
% \usepackage[no-sscript]{xltxtra}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Minion Pro}
\usepackage[noblocks]{authblk}
% \makeatletter
% \renewcommand\AB@authnote[1]{\textsuperscript{#1}}
% \renewcommand\AB@affilnote[1]{\textsuperscript{#1}}
% \makeatother

\title{Bad superscript with authblk / xltxtra}
\author{Author A}
\affil{Affiliation A}

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


First work-around

As a first work-around (1st commented part above), I noticed I could simply disable the definition of textsuperscript in package xltxtra by adding option [no-sscript]. However I would prefer avoid doing that since I'd like to keep the better superscript in the main text.

Second work-around

An alternative work-around (2nd commented part above) is to patch authblk by redefining the commands AB@authnote and AB@affilnote so that to remove the call to \normalfont, that is, change

\renewcommand\AB@affilnote[1]{\textsuperscript{\normalfont#1}}


into

\renewcommand\AB@affilnote[1]{\textsuperscript{#1}}


This works well but this is a patch over a package that is 13 years old, so I guess there is a better solution. Also this patch does not work when using glyphs that do not have 'superior' version (like 'A' or $\dagger$).

Third work-around

A last (bad) work-around is to force superscript in math mode, like \author[\$^1]{...}, but then we might get double superscripting if we select a font without superior glyphs.

.

Any solution that would overcome the limitations of these work-arounds would be appreciated.

• I don't have this font availabel for testing. When I remove the call to Minion-Pro, then there is no problem with your code. Have tried experimenting with other fonts? – Andrew Swann Apr 4 '14 at 6:52
• @AndrewSwann Indeed the problem disappear if you comment out the font selection. But that's because then you fallback on a font that does not have "superior" glyphes. I have the same problem if I choose 'Palatino Linotype". – fuujuhi Apr 7 '14 at 7:27
• Then the way forward should be to load the font in the correct way, rather than redefining the other package commads... – Andrew Swann Apr 7 '14 at 8:07
• @AndrewSwann What do you mean by loading the fond in the correct way? There is no indication that the fonts are loaded incorrectly in the example above. – fuujuhi Apr 28 '14 at 14:40

Don't load xltxtra.

\documentclass{article}
\usepackage[noblocks]{authblk}
\usepackage{fontspec}

\setmainfont{Minion Pro}

\makeatletter
\renewcommand\AB@authnote[1]{\textsuperscript{#1}}
\renewcommand\AB@affilnote[1]{\textsuperscript{#1}}
\makeatother

\title{Good superscript without xltxtra}
\author{Author A}
\affil{Affiliation A}

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


By the way, Mapping=tex-text should be Ligatures=TeX, but it's not necessary, for fontspec uses the option by default, except for the monospaced font.

If the font has real superscripts, but you only know by experiment, you have to redefine \AB@authnote and \AB@affilnote, because they set \normalfont. Probably \upshape is the only precaution to keep.

\documentclass{article}
\usepackage[noblocks]{authblk}
\usepackage{fontspec}
\usepackage{realscripts}

\setmainfont{Minion Pro}

\makeatletter
\renewcommand\AB@authnote[1]{\textsuperscript{\upshape#1}}
\renewcommand\AB@affilnote[1]{\textsuperscript{\upshape#1}}
\makeatother

\title{Good superscript without xltxtra}
\author{Author A}
\affil{Affiliation A}

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


• But the point of using xltxtra is exactly to use the superior glyphs instead of using the fall-back scaled down version, which you get in your suggestion above. Of course this is mostly cosmetic. – fuujuhi Jan 12 '17 at 13:52
• @fuujuhi If the font doesn't have the superior glyphs to begin with… – egreg Jan 12 '17 at 14:17
• But it does. If you follow the 2nd workaround above, you can clearly see a difference between the output without xltxtra and with xltxtra. With xltxtra and 2nd work-around, the stem of the font is conserved in the superscript, whereas it is not the case if you don't load xltxtra. – fuujuhi Jan 15 '17 at 18:37
• @fuujuhi OK, but then you need to redefine those authblk commands. – egreg Jan 15 '17 at 20:47