2

I would like to have a line under each first cvlist-heading (to the end of the margin) but the line shouldn't increase the space between the headline and the following entry. Is there a nice way to achieve this?

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{currvita}
\usepackage[T1]{fontenc}            
\usepackage[utf8]{inputenc}

\begin{document} \setlength{\cvlabelwidth}{6cm}
  \begin{cvlist}{Schulbildung:} 
  \item[\rule{\textwidth}{0.4pt}]
  \item[08/200X ~\textemdash~ zurzeit] Grundschule und Gymnasium in Mettmann
    (Leistungskurse Mathematik und Physik)
  \end{cvlist}
\end{document}

enter image description here

1 Answer 1

3

Hard way is to renew cvlist environment:

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{currvita}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\makeatletter
\renewenvironment{cvlist}[1]{%
  \sbox{\@cvlistheading}{\makebox[0pt][l]{\rule[-0.5\baselineskip]{\textwidth}{0.4pt}}%
  \cvlistheadingfont#1}%
  \begin{list}{}{%
      \renewcommand*{\makelabel}[1]{%
        \settowidth{\@tempdima}{\usebox{\@cvlistheading}}%
        \ifthenelse{\lengthtest{\@tempdima > 0pt}}{%
          \settowidth{\@tempdimb}{\cvlabelfont##1}%
          \ifthenelse{%
            \lengthtest{\@tempdima < \cvlabelwidth} \and
            \lengthtest{\@tempdimb = 0pt}}{%
            \parbox[b]{\cvlabelwidth}{%
              \vspace{\cvlabelskip}%
              \makebox[\cvlabelwidth][l]{%
                \box\@cvlistheading
              }%
            }%
          }{%
            \parbox[b]{0pt}{%
              \makebox[0pt][l]{\box\@cvlistheading}%
              \\*[0.5\baselineskip plus 1pt minus 1pt]%
            }%
          }%
        }{}%
        \cvlabelfont##1\hfill
      }%
      \setlength{\itemsep}{0ex}%
      \setlength{\parsep}{%
        0.5\baselineskip plus 1pt minus 1pt%
      }%
      \setlength{\topsep}{%
        1\baselineskip plus 2pt minus 2pt%
      }%
      \setlength{\partopsep}{0ex}%
      \setlength{\labelsep}{\cvlabelsep}%
      \setlength{\labelwidth}{\cvlabelwidth}%
      \setlength{\leftmargin}{\cvlabelwidth}%
      \addtolength{\leftmargin}{\cvlabelsep}%
    }%
}{%
  \end{list}%
}%
\makeatother

\begin{document} \setlength{\cvlabelwidth}{6cm}
  \begin{cvlist}{Schulbildung:}
  %\item[\rule{\textwidth}{0.4pt}]
  \item[08/200X ~\textemdash~ zurzeit] Grundschule und Gymnasium in Mettmann
    (Leistungskurse Mathematik und Physik)
  \end{cvlist}
\end{document}

Soft way is to patch:

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage{currvita}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{xpatch}
\xpatchcmd{\cvlist}{\cvlistheadingfont#1}
                   {\makebox[0pt][l]{\rule[-0.5\baselineskip]{\textwidth}{0.4pt}}\cvlistheadingfont#1}
                   {}{}


\begin{document} \setlength{\cvlabelwidth}{6cm}
  \begin{cvlist}{Schulbildung:}
  %\item[\rule{\textwidth}{0.4pt}]
  \item[08/200X ~\textemdash~ zurzeit] Grundschule und Gymnasium in Mettmann
    (Leistungskurse Mathematik und Physik)
  \end{cvlist}
\end{document}

enter image description here

3
  • Is there a way to increase or adjust the vertical space between the headline and the following item?
    – Robinaut
    Nov 6, 2015 at 13:15
  • 1
    @Robinaut: there is...
    – user11232
    Nov 6, 2015 at 13:18
  • 1
    @Robinaut: You will find \\*[0.5\baselineskip plus 1pt minus 1pt]% in the first code. Change 0.5\baselineskip to any value you desire.
    – user11232
    Nov 6, 2015 at 13:42

You must log in to answer this question.

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