
當在 XeLaTeX 中使用 Lucida Calligraphy 字體時,破折號無法正常工作:--
給出兩個小破折號,而不是一個較長的破折號。我該如何修復它?
微量元素:
\documentclass[12pt]{scrartcl}
\usepackage{titlesec}
\usepackage{xltxtra}
\newfontfamily\headingfont{Lucida Calligraphy}
\titleformat{\section}{\LARGE\headingfont\filcenter}
\renewcommand{\maketitlehooka}{\headingfont}
\begin{document}
\section*{Hello-World}
\section*{Hello--World}
\section*{Hello---World}
\end{document}
答案1
預設情況下,此Ligatures=TeX
功能僅新增至使用 , 宣告的字型中\setmainfont
。除非您新增\setsansfont
聲明的字體,否則不會啟用 TeX 連字。\newfontfamily
您可以直接使用字元:
或可以明確指定 TeX 連字應透過以下方式應用[Ligatures=TeX]
\documentclass[12pt]{scrartcl}
\usepackage{titlesec}
\usepackage{fontspec}
\newfontfamily\headingfont[Ligatures=TeX]{Lucida Calligraphy}
\titleformat{\section}{\LARGE\headingfont\filcenter}
\renewcommand{\maketitlehooka}{\headingfont}
\begin{document}
\section*{Hello-World}
\section*{Hello--World}
\section*{Hello---World}
\section*{Hello–World}
\section*{Hello—World}
\end{document}