7

How can I use moderntimeline without having to use moderncv as the document class?

The following code is what I've tried so far:

\documentclass{article}

\usepackage{moderntimeline}
\tlmaxdates{2001}{2012}

\begin{document}
\tlcventry{2012}{0}{Test}{}{}{}{}
\end{document}

More specifically, what modifications to moderntimeline are required to get it to run with a more general document class?

1
  • Nothing prevents you from "using" moderncv as the documentclass, but to refrain from using any of the moderncv commands while creating your own cv. You will miss the commands of e.g. article, but I doubt you would need them to create a cv.
    – Xavier
    Oct 10, 2012 at 21:19

1 Answer 1

9

I am not familiar with moderntimeline, but you need to add some definitions of lengths, and commands from moderncv.cls and some of its styles (moderncvstyleclassic.sty, for example); you also need to provide some colors.

At least, to make the main commands \tlcventry, \tllabelcventry, \tldatecventry, and \tldatelabelcventry available, and to behave as they would do in the classic style for moderncv, in another class you need something like the following:

\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&#7&%
      \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}

enter image description here

You must log in to answer this question.

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