I am trying to make my surname on my CV to be \textsc
.
Since I wish it to have a different font from the rest of the CV, I wrap it within \setmainfont
. Once I did that, the \textsc
effect was gone.
MWE of \textsc
not working
\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 g@icloud.com
\smallskip
\FilledHut\enspace 25 Park
\hfill
\phone\enspace 1234567
}
\end{document}
MWE of \textsc
working
\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 g@icloud.com
\smallskip
\FilledHut\enspace 25 Park
\hfill
\phone\enspace 1234567
}
\end{document}
Best Answer
The problem is due to the fact that no Times New Roman font I know has small caps.
You can obviate the problem, at least for Latin characters, by substituting it with a font that has small caps.
In order to use a different font than the main one for just a short part of a document, don't reset
\setmainfont
, but use\newfontfamily
in the preamble. Theifsym
fonts have nothing to do with the problem.