如何在 moderncv 中设置日期的宽度?

如何在 moderncv 中设置日期的宽度?

您如何自定义此列/字段以在一行中适应“2011 年 6 月至 9 月”。

在此处输入图片描述

MWE 复制自Moderncv:cvitem 后的额外垂直空间

\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

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

\makeatletter
\@ifpackageloaded{moderncvstyleclassic}{%
\let\oldsection\section%
\renewcommand{\section}[1]{\leavevmode\unskip\vspace*{-\baselineskip}\oldsection{#1}}%
}{%
}
\makeatother

\begin{document}
\makecvtitle
\section{Professional Experience}
    \cventry{Start--End, Year}{Intern}{Company}{Nowhere}{State}{
    \begin{itemize}
        \item Did something important here.
    \end{itemize}}

% problem with vertical space-------------------------------------------------
\section{Education}
    \cventry{Jun-Sep, 2011}{Bachelor of Arts \LaTeX}{University of \LaTeX}{}{\textit{4.0/4.0}}{}
%\vspace*{-6mm} %this will fix vertical spacing for \moderncvstyle{classic}, but create vertical spacing issues for other \moderncvstyle{xyz}.

% problem with vertical space -------------------------------------------------
\section{Skills}
    \cvitem[-0.5em]{}{
    \begin{itemize}
        \item \LaTeX
    \end{itemize}}
%\vspace*{-6mm} %this will fix vertical spacing for \moderncvstyle{classic}, but create vertical spacing issues for other \moderncvstyle{xyz}.

\section{Languages}
    \cvitem[-0.5em]{}{
    \begin{itemize}
        \item TeX-speak
    \end{itemize}}
% \cvitem{}{job description text here}

\end{document} 

答案1

需要调整的长度称为\hintscolumnwidth。默认值为

\setlength{\hintscolumnwidth}{0.175\textwidth}

输出示例0.3\textwidth

现代简历


编辑:您还可以使用以下命令自动调整宽度为 2011 年 6 月至 9 月的宽度:

\settowidth{\hintscolumnwidth}{Jun-Sep, 2011}

相关内容