我习惯\setmainfont{CMU Serif}
更改字体。但是 CMU Serif 不支持小型大写强调字体,如以下 MWE 所示:
\documentclass[a5paper,10pt,twoside,french]{book}
\usepackage{fontenc}
\usepackage{fontspec}
\setmainfont{CMU Serif}
\begin{document}
\textsl{\textsc{gnu}'s not Unix} (\verb|\textsl{}|) \par
\textit{\textsc{gnu}'s not Unix} (\verb|\textit{}|) \par
\emph{GNU: \textsc{gnu}'s not Unix} (\verb|\emph{}|)
\end{document}
巫婆产生以下渲染:
那么,有没有办法在强调上下文中(或反向)将欧洲计算机现代字体设置为小型大写字母?
答案1
你可以倾斜直立的小写字母
\documentclass[a5paper,10pt,twoside,french]{book}
%%%\usepackage{fontenc}
\usepackage{fontspec}
\setmainfont{CMU Serif}[ItalicFeatures= {
SmallCapsFont={CMU Serif},
SmallCapsFeatures={Letters=SmallCaps,FakeSlant=0.2} }]
\begin{document}
\textsl{\textsc{gnu}'s not Unix} (\verb|\textsl{}|) \par
\textit{\textsc{gnu}'s not Unix} (\verb|\textit{}|) \par
\emph{GNU: \textsc{gnu}'s not Unix} (\verb|\emph{}|)
\end{document}
\documentclass[a5paper,10pt,twoside,french]{book}
%%%\usepackage{fontenc}
\usepackage{fontspec}
\setmainfont{CMU Serif}[ItalicFeatures= {
SmallCapsFont=LMRomanCaps10-Oblique}]
\begin{document}
\textsl{\textsc{gnu}'s not Unix} (\verb|\textsl{}|) \par
\textit{\textsc{gnu}'s not Unix} (\verb|\textit{}|) \par
\emph{GNU: \textsc{gnu}'s not Unix} (\verb|\emph{}|)
\end{document}
答案2
如果您只需要倾斜/斜体小写拉丁字母,您可以用拉丁现代字母代替:
\documentclass[a5paper,10pt,twoside]{book}
\usepackage{fontspec}
\setmainfont{CMU Serif}[
SlantedFont=CMU Serif Roman Slanted,
UprightFeatures={SmallCapsFont=LMRomanCaps10-Regular},
ItalicFeatures={SmallCapsFont=LMRomanCaps10-Oblique},
SlantedFeatures={SmallCapsFont=LMRomanCaps10-Oblique},
]
\begin{document}
\textsl{\textsc{gnu}'s not Unix} (\verb|\textsl{}|)
\textit{\textsc{gnu}'s not Unix} (\verb|\textit{}|)
\emph{GNU: \textsc{gnu}'s not Unix} (\verb|\emph{}|)
\end{document}
答案3
也许我们可以伪造\textsc
。
\documentclass{book}
\usepackage{fontspec}
\setmainfont{CMU Serif}
\begin{document}
\textsl{\textsc{gnu}'s not Unix} (\verb|\textsl{}|) \par
\textit{\textsc{gnu}'s not Unix} (\verb|\textit{}|) \par
\emph{\textsc{gnu}'s not Unix} (\verb|\emph{}|)
\textsl{\textup{G{\scriptsize NU}}'s not Unix} (\verb|\textsl{}|) \par
\textit{\textup{G{\scriptsize NU}}'s not Unix} (\verb|\textit{}|) \par
\emph{\textup{G{\scriptsize NU}}'s not Unix} (\verb|\emph{}|)
\textsl{G{\scriptsize NU}'s not Unix} (\verb|\textsl{}|) \par
\textit{G{\scriptsize NU}'s not Unix} (\verb|\textit{}|) \par
\emph{G{\scriptsize NU}'s not Unix} (\verb|\emph{}|)
\end{document}