3

How can I get a text superscript of the hash (#) symbol in Latex to work? I tried \textsuperscript{\#} to no avail.

I should have been more specific in my question. I am using \usepackage{fontspec} and \usepackage{xltxtra}, with \setmainfont{Calibri}. While Latex/Xelatex prints the #, it does not print it as superscript. When I use fonts Arial, Computer Modern, or Palatino, Latex correctly prints the # as superscript.

\documentclass[10pt, a4paper]{article}
\usepackage{fontspec}
\usepackage{xltxtra}
\usepackage{microtype} 
\defaultfontfeatures{Mapping=tex-text,Ligatures=TeX}
\setmainfont{Calibri}
\begin{document}
\textsuperscript{\#}example
\end{document} 

1 Answers1

2

Reread Sean Allred's comment:

\textsuperscript{\#}

Note: \tex t superscript...

If you are using xltextra with a font which does not support real super/subscripts, then you can tell it not to use them as explained in this answer by djnavas:

\documentclass[10pt, a4paper]{article}
\usepackage{fontspec}
\usepackage[no-sscript]{xltxtra}
\usepackage{microtype}
\defaultfontfeatures{Mapping=tex-text,Ligatures=TeX}
\setmainfont{Calibri}
\begin{document}
\textsuperscript{\#}example
\end{document}
cfr
  • 198,882
  • This previous post seems to be closely related: http://tex.stackexchange.com/questions/132884/xelatex-textsuperscript-issue – user47979 Mar 16 '14 at 15:52
  • @user47979 So it is a duplicate of a different question? But this was only obvious now you've posted an MWE. – cfr Mar 16 '14 at 16:49