我目前使用moderncv
和moderntimeline
创建我的简历。虽然我对目前的结果非常满意,但我还没有在中指定月份\tlcventry
。
一个可行的最小示例如下所示
\documentclass[11pt,a4paper,sans]{moderncv}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\moderncvstyle{classic} % CV theme - options include: 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{orange} % CV color - options include: 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
\usepackage[firstyear=2010,lastyear=2020]{moderntimeline}
\firstname{John} % Your first name
\familyname{Doe} % Your last name
\tlenablemonths
\begin{document}
\section{Tex Exchange}
\tlenablemonths
\tlcventry{2012/1}{2015/10}{entry}{entry}{entry}{entry}{entry}
\end{document}
我希望此条目的上方标签为 01/2012,下方标签为 10/2015。我该如何实现?
谨致问候,并提前致谢
答案1
把这个放在序言中。
\makeatletter
\renewcommand{\tl@formatstartyear}[1]{
\startyeartrue
\tl@yearfraction{#1}
\pgfmathsetmacro\tl@startfraction{(\tl@startyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
\ifissince
\xdef\tl@startlabel{\tl@since \tl@tmpmonth/\tl@tmpyear}
\else
\xdef\tl@startlabel{\tl@tmpmonth/\tl@tmpyear}
\fi
}
\renewcommand{\tl@formatendyear}[1]{
\startyearfalse%
\tl@yearfraction{#1}
\pgfmathsetmacro\tl@endfraction{(\tl@endyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
\ifissince%
\xdef\tl@endlabel{}
\else
\xdef\tl@endlabel{\tl@tmpmonth/\tl@tmpyear}
\fi
}
\makeatother