1

I would like to write a \tllabelcventry without a description line, and tried to define a new command \tllabelcventrywithoutdescription. I looked through the moderncv and moderntimeline command definitions to achieve this, but I am stuck, as I don't quite understand where I can hard-code such a change.

The reason I want to omit the description line is, if I don't supply a description in a \tllabelcventry, there is a nasty looking empty line below each entry.

Can anyone help me out here?

minimal example:

\documentclass[ngerman,11pt,a4paper,sans]{moderncv}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\makeatletter
\moderncvstyle{classic} 
\moderncvcolor{blue} 
\usepackage[scale=0.8]{geometry}
\setlength{\hintscolumnwidth}{3cm} 
\usepackage{moderntimeline}

\tlmaxdates{2007}{2018}
\name{name}{surname}
\title{how to omit the description line?{}} 

\newcommand{\tllabelcventrywithoutdescription}[9][color1]{%
\pgfmathsetmacro\tl@endyear{ifthenelse(#3==0,\tl@lastyear,#3)}
\pgfmathsetmacro\tl@startfraction{(#2-\tl@firstyear)/(\tl@lastyear-    \tl@firstyear)}%
\pgfmathsetmacro\tl@endfraction{(\tl@endyear-    \tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
 \cventry{\tikz[baseline=0pt]{
     \fill [\tl@runningcolor] (0,0)
        rectangle (\hintscolumnwidth,\tl@runningwidth);
     \useasboundingbox (0,-1.5ex)
        rectangle (\hintscolumnwidth,1ex);
     \fill [#1] (0,0)
        ++(\tl@startfraction*\hintscolumnwidth,0pt)
        node [tl@startyear] {#4}
        rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width-1pt);
     \pgfmathsetlength{\pgf@xa}{#3} \ifdim\pgf@xa=0pt
        \shade [left color=#1] (\tl@startfraction*\hintscolumnwidth,0)
            rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
     \else
        \fill [#1] (\tl@startfraction*\hintscolumnwidth,0)
            rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
     \fi
     }
}
{#5}{#6}{#7}{#8}{#9}%
}

\usepackage{babel}
\usepackage[style=authoryear]{biblatex}
\begin{document}
\makecvtitle

\section{Section}

\tllabelcventrywithoutdescription{2008/10}{2009/9}{2008/10 -- 2009/9}{\textbf{Grade}}    {Institution}{City}{}{}

\tllabelcventrywithoutdescription{2008/10}{2009/9}{2008/10 -- 2009/9}{\textbf{Grade}}    {Institution}{City}{}{}

\tllabelcventrywithoutdescription{2008/10}{2009/9}{2008/10 -- 2009/9}{\textbf{Grade}}    {Institution}{City}{}{Description}

\tllabelcventrywithoutdescription{2008/10}{2009/9}{2008/10 -- 2009/9}{\textbf{Grade}}   {Institution}{City}{}{Description}
\end{document}

enter image description here

I tried to remove the description by removing {#9}, the code compiled, but the empty line is still there. This change should be easy to make for a trained eye, but I unfortunately don't have one.

Kind regards,
snapdeb

2

You are using an definition for command \tllabelcventry I do not know from where you it have ...

The original definition in moderntimeline.sty is

\newcommand{\tllabelcventry}[9][color1]{%
\tl@formatendyear{#3}
\tl@formatstartyear{#2}
 \cventry{\tikz[baseline=0pt]{
     \fill [\tl@runningcolor] (0,0)
        rectangle (\hintscolumnwidth,\tl@runningwidth);
     \useasboundingbox (0,-1.5ex)
        rectangle (\hintscolumnwidth,1ex);
     \fill [#1] (0,0)
        ++(\tl@startfraction*\hintscolumnwidth,0pt)
        node [tl@startyear] {#4}
        rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width-1pt) ;
    \ifissince
       \newdimen\fullcolorwidth
       \pgfmathsetlength\fullcolorwidth{\tl@startfraction*(1+(1-\tl@startfraction)*\tl@nsfrac)*\hintscolumnwidth}
       \shade [left color=#1,right color=#1]
(\tl@startfraction*\hintscolumnwidth,0)
           rectangle (\fullcolorwidth,\tl@width);
       \shade [left color=#1] (\fullcolorwidth,0)
           rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
     \else
        \fill [#1] (\tl@startfraction*\hintscolumnwidth,0)
            rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
     \fi
     }
}
{#5}{#6}{#7}{#8}{#9}%
}

You can change command \cventry to \cventry[-\baselineskip] to get rid of the empty line ...

With the following MWE

\documentclass[ngerman,11pt,a4paper,sans]{moderncv}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\moderncvstyle{classic} 
\moderncvcolor{blue} 
\usepackage[scale=0.8]{geometry}
\setlength{\hintscolumnwidth}{3cm} 
\usepackage{moderntimeline}

\tlmaxdates{2007}{2018}
\name{name}{surname}
\title{how to omit the description line?{}} 

\makeatletter
\newcommand{\tllabelcventrywithoutdescription}[9][color1]{%
\tl@formatendyear{#3}
\tl@formatstartyear{#2}
 \cventry[-\baselineskip]{\tikz[baseline=0pt]{ % <======================
     \fill [\tl@runningcolor] (0,0)
        rectangle (\hintscolumnwidth,\tl@runningwidth);
     \useasboundingbox (0,-1.5ex)
        rectangle (\hintscolumnwidth,1ex);
     \fill [#1] (0,0)
        ++(\tl@startfraction*\hintscolumnwidth,0pt)
        node [tl@startyear] {#4}
        rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width-1pt) ;
    \ifissince
       \newdimen\fullcolorwidth
       \pgfmathsetlength\fullcolorwidth{\tl@startfraction*(1+(1-\tl@startfraction)*\tl@nsfrac)*\hintscolumnwidth}
       \shade [left color=#1,right color=#1]
(\tl@startfraction*\hintscolumnwidth,0)
           rectangle (\fullcolorwidth,\tl@width);
       \shade [left color=#1] (\fullcolorwidth,0)
           rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
     \else
        \fill [#1] (\tl@startfraction*\hintscolumnwidth,0)
            rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
     \fi
     }
}
{#5}{#6}{#7}{#8}{#9}%
}
\makeatother

\usepackage{csquotes} % <===============================================
\usepackage{babel}
\usepackage[style=authoryear]{biblatex}


\begin{document}
\makecvtitle

\section{Section}

\tllabelcventrywithoutdescription{2008/10}{2009/9}{2008/10 -- 2009/9}{\textbf{Grade}}    {Institution}{City}{}{}

\tllabelcventrywithoutdescription{2008/10}{2009/9}{2008/10 -- 2009/9}{\textbf{Grade}}    {Institution}{City}{}{}

\tllabelcventry{2008/10}{2009/9}{2008/10 -- 2009/9}{\textbf{Grade}}    {Institution}{City}{}{Description}

\tllabelcventry{2008/10}{2009/9}{2008/10 -- 2009/9}{\textbf{Grade}}   {Institution}{City}{}{Description}
\end{document}

you can the usage of both commands \tllabelcventry and \tllabelcventrywithoutdescription:

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.