我正在尝试将我的简历上的姓氏写成\textsc
。
因为我希望它与简历的其他部分使用不同的字体,所以我将它包裹在内\setmainfont
。一旦我这样做,\textsc
效果就消失了。
\textsc
不工作的MWE
\documentclass[letterpaper, 11pt]{article} % Default font size and paper size
\usepackage{fontspec} % For loading fonts
\defaultfontfeatures{Mapping=tex-text}
% LaTeX default font = Computer Modern Roman
%\setmainfont{Garamond}
%\setmainfont{Calibri}
%\setmainfont{Times New Roman}
%\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin}
\usepackage{longtable}
\usepackage[hidelinks]{hyperref} % hide the links
% For the symbols
\usepackage{wasysym}
\usepackage{marvosym}
\usepackage[alpine]{ifsym}
\begin{document}
%\centering
\pagestyle{empty} % Removes page numbering
\font\fb=''[cmr10]'' % Change the font of the \LaTeX command under the skills section
\setmainfont{Times New Roman}{
\par{
\centering
\Huge
{
Firstname \textsc{Surname}
}
\bigskip\par
}}
\par{
\Mundus\enspace http://sites.google.com/site
\hfill
\MVAt\enspace [email protected]
\smallskip
\FilledHut\enspace 25 Park
\hfill
\phone\enspace 1234567
}
\end{document}
\textsc
工作的 MWE
\documentclass[letterpaper, 11pt]{article} % Default font size and paper size
\usepackage{fontspec} % For loading fonts
\defaultfontfeatures{Mapping=tex-text}
% LaTeX default font = Computer Modern Roman
%\setmainfont{Garamond}
%\setmainfont{Calibri}
%\setmainfont{Times New Roman}
%\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin}
\usepackage{longtable}
\usepackage[hidelinks]{hyperref} % hide the links
% For the symbols
\usepackage{wasysym}
\usepackage{marvosym}
\usepackage[alpine]{ifsym}
\begin{document}
%\centering
\pagestyle{empty} % Removes page numbering
\font\fb=''[cmr10]'' % Change the font of the \LaTeX command under the skills section
\par{
\centering
\Huge
{
Firstname \textsc{Surname}
}
\bigskip\par
}
\par{
\Mundus\enspace http://sites.google.com/site
\hfill
\MVAt\enspace [email protected]
\smallskip
\FilledHut\enspace 25 Park
\hfill
\phone\enspace 1234567
}
\end{document}
答案1
问题在于,据我所知,Times New Roman 字体都没有小写字母。
您可以通过使用带有小写字母的字体替换拉丁字符来避免此问题,至少对于拉丁字符而言。
为了在文档的一小部分中使用与主字体不同的字体,请不要重置,而是在序言中\setmainfont
使用。字体与问题无关。\newfontfamily
ifsym
\documentclass[letterpaper, 11pt]{article} % Default font size and paper size
\usepackage{fontspec} % For loading fonts
% LaTeX default font = Computer Modern Roman
\newfontfamily\times{Times New Roman}[
% the font has no small caps, so we use another one for them
SmallCapsFont=TeX Gyre Termes,
SmallCapsFeatures={Letters=SmallCaps}
]
\usepackage{longtable}
\usepackage[hidelinks]{hyperref} % hide the links
% For the symbols
\usepackage{wasysym}
\usepackage{marvosym}
\usepackage[alpine]{ifsym}
\begin{document}
\pagestyle{empty} % Removes page numbering
\begin{center}
\times
{\Huge Firstname \textsc{Surname}\par}
\bigskip
\Mundus\enspace http://sites.google.com/site
\quad
\MVAt\enspace [email protected]
\quad
\FilledHut\enspace 25 Park
\quad
\phone\enspace 1234567
\end{center}
\end{document}