如何使用moderntimeline
而不必moderncv
作为文档类?
以下代码是我迄今为止尝试过的:
\documentclass{article}
\usepackage{moderntimeline}
\tlmaxdates{2001}{2012}
\begin{document}
\tlcventry{2012}{0}{Test}{}{}{}{}
\end{document}
更具体地说,moderntimeline
需要进行哪些修改才能使其与更通用的文档类一起运行?
答案1
我不熟悉moderntimeline
,但您需要添加一些长度的定义,以及来自的命令moderncv.cls
和它的一些样式(moderncvstyleclassic.sty
例如);您还需要提供一些颜色。
至少,为了使主要命令\tlcventry
、\tllabelcventry
、\tldatecventry
和\tldatelabelcventry
可用,并使其行为与 的经典风格一样moderncv
,在另一个类中,您需要类似以下内容:
\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{ifthen}
\usepackage[firstyear=1999,lastyear=2012]{moderntimeline}
\makeatletter
\colorlet{color0}{blue}
\colorlet{color1}{olive}
\newcommand*{\hintfont}{}
\newcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}}
\newcommand*{\listitemsymbol}{\labelitemi~}
\newcommand*{\cventry}[7][.25em]{%
\cvitem[#1]{#2}{%
{\bfseries#3}%
\ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%
\ifthenelse{\equal{#5}{}}{}{, #5}%
\ifthenelse{\equal{#6}{}}{}{, #6}%
.\strut%
\ifx&%
\else{\newline{}\begin{minipage}[t]{\linewidth}\small#7\end{minipage}}\fi}}
\newcommand*{\cvitem}[3][.25em]{%
\begin{tabular}{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\maincolumnwidth}@{}}%
\raggedleft\hintstyle{#2} &{#3}%
\end{tabular}%
\par\addvspace{#1}}
\tlmaxdates{2001}{2012}
\newlength{\quotewidth}
\newlength{\hintscolumnwidth}
\setlength{\hintscolumnwidth}{0.175\textwidth}
\newlength{\separatorcolumnwidth}
\setlength{\separatorcolumnwidth}{0.025\textwidth}
\newlength{\maincolumnwidth}
\newlength{\doubleitemmaincolumnwidth}
\newlength{\listitemsymbolwidth}
\settowidth{\listitemsymbolwidth}{\listitemsymbol}
\newlength{\listitemmaincolumnwidth}
\newlength{\listdoubleitemmaincolumnwidth}
\setlength{\maincolumnwidth}{\dimexpr\textwidth-\separatorcolumnwidth-\hintscolumnwidth\relax}
\makeatother
\begin{document}
\tlcventry{1999}{2002}{WYSIWYG User}{Unnamed Company}
{Somewhere}{}{Tried hard to typeset documents}
\tllabelcventry[magenta]{2002}{2003}{July--November 2002}
{Scribus Student}{GNU School}
{The Internet}{}{Tried Scribus for a short while}
\tldatecventry[brown]{2011}{Trusted TeX.SX user}{}{tex.stackexchange.com}
{The Internet}{}{Achived 20k reputation on TeX.SX}
\tldatelabelcventry[blue!70!black]{2011}{Christmas 2011}{Happy TeXer}{}{Home}
{Townville}{}{Received Don Knuth’s \emph{3:16} as a gift.}
\end{document}