
如何讓 Latex 中的井號 (#) 符號的文字上標運作?我嘗試過\textsuperscript{\#}
但沒有成功。
我應該更具體地提出我的問題。我正在使用\usepackage{fontspec}
和\usepackage{xltxtra}
, 與\setmainfont{Calibri}
.雖然 Latex/Xelatex 列印 #,但它不會將其列印為上標。當我使用 Arial、Computer Modern 或 Palatino 字體時,Latex 會正確地將 # 列印為上標。
\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
重讀肖恩·奧爾雷德的評論:
\textsuperscript{\#}
註:\text上標...
如果您正在使用xltextra
字體不支援真正的上標/下標,那麼您可以告訴它不要使用它們,如中所述這個答案通過 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}