0

I am using TeXstudio to write my CV but I do not know why ModernCV works incorrectly in my system. In fact, it seems that \textsc and font do not work.

Here is my code:

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[11pt]{moderncv} % Font sizes: 10, 11, or 12; paper sizes: a4paper, letterpaper, a5paper

\moderncvstyle{Banking} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{blue} % CV color - options include: 'blue' (default), 'orange'

\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template

\usepackage[scale=0.86]{geometry} % Reduce document margins

%----------------------------------------------------------------------------------------
%   NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------

\firstname{First name} % Your first name
\familyname{Family name} % Your last name
%\title{Short Curriculum Vitae}
\email{[email protected]}

%----------------------------------------------------------------------------------------

\begin{document}

\makecvtitle % Print the CV title

\vspace{-1cm}

%----------------------------------------------------------------------------------------
%   Research Experience & Projects SECTION
%----------------------------------------------------------------------------------------

\section{RESEARCH EXPERIENCE \& NOTABLE PROJECTS}

%Winter 2021:
\cventry{Winter 2021}{School of Computer Science}{Computational Neuroscience}{University of UUU}{\textsc{Prof. PPP}}
{Developing \& Analyzing a Framework in Pytorch to Simulate LIF Model, ELIF Model, AELIF Model, Neural Population, Balanced Network, Encoding and Decoding, STDP learning rule, Reinforcement STDP learning rule}

%----------------------------------------------------------------------------------------
%   COMPUTER SKILLS SECTION
%----------------------------------------------------------------------------------------

\section{SKILLS}

\cvitem{Basic}{\textsc{Django, java, OpenCV}}
\cvitem{Intermediate}{\textsc{R, Flask, Tkinter, SFML, Gambit, Pandas, Scikit-learn, TikZ}}

\end{document}

After Compiling with TeXstudio in my Windows:

enter image description here

After Compiling with Overleaf:

enter image description here

Why did this happen? How can I fix this problem? Should I install any packages? By the way, I want to keep this font. So, I want to have the Overleaf result exactly.

2
  • The font Overleaf is giving you is TeX Gyre Pagella. \usepackage{tgpagella}. You're getting either Computer Modern or Latin Modern locally instead. When I compile your code, I had to change \moderncvstyle{Banking} to \moderncvstyle{banking} with a lowercase b to get it to compile at all. Once I did, I got TeX Gyre Pagella without having to add anything since the banking style already loads that package. There's no need for fontspec or xelatex. Do you get any errors when you compile locally?
    – frabjous
    Jun 8, 2022 at 0:23
  • It may be that you're using xelatex instead of pdflatex, as I get Latin Modern with xelatex because xelatex expects a different encoding. Use pdflatex. If for some reason you need xelatex (not sure why'd that would be), you'd have to switch font encoding \usepackage[T1]{fontenc}—though T1 is not usually recommended for XeLaTeX, or else use the otf versions of the font. \usepackage{fontspec}\setmainfont{TeX Gyre Pagella}, assuming you've installed it system-wide.
    – frabjous
    Jun 8, 2022 at 0:34

1 Answer 1

0

Though I found how to fix this problem, I still don't understand the reason for this incompatibility!

We should just add \usepackage{fontspec} to the preamble section. After compilation:

enter image description here

I would be happier if I knew why!

1
  • What compiler are you using on Overleaf compared to your local machine?
    – Werner
    Feb 7, 2022 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .