[XeTeX] Combined sub- and superscript

Sebastian Gerecke sgerecke at l3s.de
Sat Aug 7 12:27:43 CEST 2010


Dear all,

for a document I am preparing I want something like this:
http://www.linuxlibertine.org/index.php?id=87&L=1 (the colored ^{14}_{6}C 
example in the middle}. Unfortunately I don't get it to work using Linux 
Libertine and TL2010PT xelatex. Though the Libertine documentation is fairly 
complete, it does not cover how to combine sub- and superscript text.

Yours,
Sebastian

%---------------------------
\documentclass{minimal}
\usepackage{fontspec}
% Makes it easier to show the problem
% but problem occurs without Numbers=OldStyle as well
\defaultfontfeatures{Numbers=OldStyle}
\setmainfont{Linux Libertine O}
\usepackage[version=3]{mhchem}
\begin{document}

% 1. Correct numberset, correct position
{\addfontfeature{VerticalPosition=Superior}14}C
% 2. Correct numberset, correct position
{\addfontfeature{VerticalPosition=ScientificInferior}6}C
% 3. Correct numberset, wrong position
{\addfontfeature{VerticalPosition=Superior}14}
{\addfontfeature{VerticalPosition=ScientificInferior}6}C
% 4. Wrong numberset, wrong position
\textsuperscript{14}\textsubscript{6}C
% 5. Wrong numberset, almost correct position
\ce{^{14}_{6}C}

\end{document}
%-----------------------------


More information about the XeTeX mailing list