4

Referring to artcile with moderntimeline, I tried to implement the same. I wish to have the entries which are in the tabular form: enter image description here
To like this(similar structure): enter image description here
But, with the use of moderntimeline, package. Here is what I have done till now. I need help in improving it.

\documentclass{article}
\usepackage[english]{babel}
\usepackage{titlesec}
\usepackage{ifthen}
\usepackage{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

\titleformat{\section}
[block]
{\normalfont\bfseries}
{\rule[0ex]{2cm}{4pt}}
{1em}
{}



\begin{document}
\section{EDUCATIONAL QUALIFICATION}
\tllabelcventry[blue]{2011}{2015}{2011}
{B.Tech.}{Computer Science and Engineering}
{Pondicherry Engineering College}{}{Aggregate CGPA 8.5}
\tldatelabelcventry[blue!70!black]{2011}{2011}{Higher Secondary}{}{Petit Seminar Higher Sec. School}
{92\%}{}{}
\end{document} 

enter image description here

subham soni
  • 9,673

1 Answers1

4

Here are some suggestions:

  1. To keep consistency, use the same lengths everywhere; i.e., instead of fixed, hard-coded lengths for the rule and spacing in the customized \section command, use \hintscolumnwidth and \separatorcolumnwidth, as in

    \titleformat{\section}
    [block]
    {\normalfont\bfseries}
    {\rule[0ex]{\hintscolumnwidth}{4pt}}
    {\separatorcolumnwidth}
    {}
    
  2. Since this is a CV, it seems reasonable to suppress indentation globally (by setting \parindent to 0pt); if this is not desired, then use a \par\noindent in the definition of the elements which shouldn't be indented (\cventry, for example). Which option is to be used will depend on your actual intent, but my code contains both possibilities so you can decide.

  3. For the timelines, use years that lie between the declared range; I mean, in your code you had

    \tlmaxdates{2001}{2012}
    

    so the maximum expected year was 2012, but you were using 2015 for one of your entries. In the code below I changed to

    \tlmaxdates{2001}{2015}
    

The code:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{titlesec}
\usepackage{ifthen}
\usepackage{moderntimeline}

%\setlength\parindent{0pt} % to suppress indentation globally

\makeatletter
\colorlet{color0}{blue}
\colorlet{color1}{olive}

\newcommand*{\hintfont}{}
\newcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}}
\newcommand*{\listitemsymbol}{\labelitemi~}
\newcommand*{\cventry}[7][.25em]{%
  \par\noindent% not required if indentation has been suppressed globally
  \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}}

\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

\titleformat{\section}
[block]
{\normalfont\bfseries}
{\rule[0ex]{\hintscolumnwidth}{4pt}}
{\separatorcolumnwidth}
{}

\tlmaxdates{2001}{2015}

\begin{document}

\section{EDUCATIONAL QUALIFICATION}
\tllabelcventry[blue]{2011}{2015}{2011}
{B.Tech.}{Computer Science and Engineering}
{Pondicherry Engineering College}{}{Aggregate CGPA 8.5}
\tldatelabelcventry[blue!70!black]{2011}{2011}{Higher Secondary}{}{Petit Seminar Higher Sec. School}
{92\%}{}{}

\end{document} 

The result:

enter image description here

Update

In a comment it has been requested to use a shading for the colored bar instead of a solid color and to move the bar slightly to the left; the shading can be achieved using the left color, right color, middle color keys for a standard TikZ horizontal shading in the optional argument; the bar can be moved to the left using a smaller (for example,2010.5 or any other suitable value) in the first mandatory argument instead of 2011:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{titlesec}
\usepackage{ifthen}
\usepackage{moderntimeline}

%\setlength\parindent{0pt} % to suppress indentation globally

\makeatletter
\colorlet{color0}{blue}
\colorlet{color1}{olive}

\newcommand*{\hintfont}{}
\newcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}}
\newcommand*{\listitemsymbol}{\labelitemi~}
\newcommand*{\cventry}[7][.25em]{%
  \par\noindent% not required if indentation has been suppressed globally
  \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}}

\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

\titleformat{\section}
[block]
{\normalfont\bfseries}
{\rule[0ex]{\hintscolumnwidth}{4pt}}
{\separatorcolumnwidth}
{}

\tlmaxdates{2001}{2015}

\begin{document}

\section{EDUCATIONAL QUALIFICATION}
\tllabelcventry[left color=blue,right color=white]{2010.5}{2015}{2011}
{B.Tech.}{Computer Science and Engineering}
{Pondicherry Engineering College}{}{Aggregate CGPA 8.5}
\tldatelabelcventry[blue!70!black]{2011}{2011}{Higher Secondary}{}{Petit Seminar Higher Sec. School}
{92\%}{}{}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128