[Tex/LaTex] Moderncv: \cvitem text is too large

fontsizemoderncv

How do I change the text size for items under \cvitem to match items under \cventry that won't cause problems with other \moderncvstyle{xyz}?

MWE:

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic} % banking, casual, classic, empty, oldstyle options  
\moderncvcolor{blue}   % black, blue, green, grey, orange, purple, red options  
\usepackage[scale=0.85]{geometry} % default scale=0.7. height= scale * layoutheight
\usepackage{etoolbox}
\patchcmd{\section}{\vspace*{.5ex}}{\vspace{.5ex}}{}{}

\firstname{John}
\familyname{Doe}
\title{R\'esum\'e}     % optional

% the following definition is from the file moderncvstyleclassic.sty
% reformats the \cventry by removing the period at the end of the line
\renewcommand*{\cventry}[7][.25em]{%
  \cvitem[#1]{#2}{%
    {\bfseries#3}%
    \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}
    \ifthenelse{\equal{#5}{}}{}{, #5}%
    \ifthenelse{\equal{#6}{}}{}{, #6}%
%   .\strut% original
    \strut%   remove period
    \ifx&#7&%
      \else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}}

% Fixes spacing if using \cvitem in the classic style by redefining \section. 
\makeatletter   % changes the catcode of @ to 11 aka Make @ symbol a letter
\@ifpackageloaded{moderncvstyleclassic}{%
\let\oldsection\section%
\renewcommand{\section}[1]{\leavevmode\unskip\vspace*{-\baselineskip}\oldsection{#1}}}{}
\makeatother % changes the catcode of @ back to 12 aka Make @ symbol an "other"

\begin{document}
\makecvtitle
\section{Professional Experience}
    \cventry{Year--Year}{Intern}{Financial Services Inc.}{Somewhere}{State}{
        \begin{itemize}
            \item This is something important that I did here. This cventry text is the perfect size.
            \item This is something else equally important that I did here. This cventry text is the perfect size.
        \end{itemize}}

\section{Skills}
    \cvitem[-1.0em]{}{
        \begin{itemize}
            \item These are the skills I have. Why is this cvitem text larger than cventry text?
        \end{itemize}}

\section{Languages}
    \cvitem{}{
        \begin{itemize}
            \item These are the languages I speak. Why is this cvitem text larger than cventry text?
        \end{itemize}}
\end{document}

Best Answer

There are 4 different styles provided by moderncv: casual (default), classic, oldstyle and banking

  • casual uses the definition of \cvitem as defined in classic;
  • classic uses the following definition for \cvitem:

    \renewcommand*{\cvitem}[3][.25em]{%
      \begin{tabular}{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\maincolumnwidth}@{}}%
        \raggedleft\hintstyle{#2} &{#3}%
      \end{tabular}%
      \par\addvspace{#1}}
    
  • oldstyle uses the following definition of \cvitem:

    \renewcommand*{\cvitem}[3][.25em]{%
      \ifthenelse{\equal{#2}{}}{}{\hintstyle{#2}: }{#3}%
      \par\addvspace{#1}}
    
  • banking uses the definition of \cvitem as defined in \oldstyle.

You can either redefine \cvitem, or use xpatch's \xpatchcmd to patch #3 and insert \small:

\usepackage{xpatch}% http://ctan.org/pkg/xpatch
\xpatchcmd{\cvitem}{#3}{\small #3}{}{}

Depending on the style that you use, you may have to adjust the size accordingly. Here's how it would look if you use classic:

enter image description here

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic} % banking, casual, classic, empty, oldstyle options  
\moderncvcolor{blue}   % black, blue, green, grey, orange, purple, red options  
\usepackage[scale=0.85]{geometry} % default scale=0.7. height= scale * layoutheight
\usepackage{etoolbox,xpatch}
\patchcmd{\section}{\vspace*{.5ex}}{\vspace{.5ex}}{}{}

\firstname{John}
\familyname{Doe}
\title{R\'esum\'e}     % optional

% the following definition is from the file moderncvstyleclassic.sty
% reformats the \cventry by removing the period at the end of the line
\xpatchcmd{\cvitem}{#3}{\small #3}{}{}
\renewcommand*{\cventry}[7][.25em]{%
  \cvitem[#1]{#2}{%
    {\bfseries#3}%
    \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}
    \ifthenelse{\equal{#5}{}}{}{, #5}%
    \ifthenelse{\equal{#6}{}}{}{, #6}%
%   .\strut% original
    \strut%   remove period
    \ifx&#7&%
      \else{\newline{}\begin{minipage}[t]{\linewidth}#7\end{minipage}}\fi}}

% Fixes spacing if using \cvitem in the classic style by redefining \section. 
\makeatletter   % changes the catcode of @ to 11 aka Make @ symbol a letter
\@ifpackageloaded{moderncvstyleclassic}{%
\let\oldsection\section%
\renewcommand{\section}[1]{\leavevmode\unskip\vspace*{-\baselineskip}\oldsection{#1}}}{}
\makeatother % changes the catcode of @ back to 12 aka Make @ symbol an "other"

\begin{document}
\makecvtitle
\section{Professional Experience}
    \cventry{Year--Year}{Intern}{Financial Services Inc.}{Somewhere}{State}{
        \begin{itemize}
            \item This is something important that I did here. This cventry text is the perfect size.
            \item This is something else equally important that I did here. This cventry text is the perfect size.
        \end{itemize}}

\section{Skills}
    \cvitem[-1.0em]{}{
        \begin{itemize}
            \item These are the skills I have. Why is this cvitem text larger than cventry text?
        \end{itemize}}

\section{Languages}
    \cvitem{}{
        \begin{itemize}
            \item These are the languages I speak. Why is this cvitem text larger than cventry text?
        \end{itemize}}
\end{document}

Note that I've removed \small from your redefinition of \cventry since \cventry uses \cvitem which now uses \small by default (due to the patch).