Skip to content

Extending cvevent Macro

Jan Küster edited this page May 13, 2020 · 2 revisions

The macro \cvevent is limited to two lines in it's current definition but that does not prevent you from extending it.

This is an example, taken from the classic cv template:

% creates a stretched box as cv entry headline followed by two paragraphs about 
% the work you did
% param 1:	event time i.e. 2014 or 2011-2014 etc.
% param 2:	event name (what did you do?)
% param 3:	institution (where did you work / study)
% param 4:	what was your position
% param 5:	some words about your contributions
%
\newcommand{\cvevent}[5]
{

\begin{tabular*}{1\textwidth}{p{13.6cm}  x{3.9cm}}
	\textbf{#2} - \textcolor{bgcol}{#3} &   \vspace{2.5pt}\textcolor{sectcol}{#1}
\end{tabular*}

\vspace{-8pt}
\textcolor{softcol}{\hrule}
\vspace{6pt}

  $\cdot$ #4\\[3pt]
  $\cdot$ #5\\[6pt]

}

as you can see the last two parameters #4 and #5 represent these two lines. If you want more than two lines, you would have to extend the max. args from [5] to [6] and add another parameter:

\newcommand{\cvevent}[6]
{

\begin{tabular*}{1\textwidth}{p{13.6cm}  x{3.9cm}}
	\textbf{#2} - \textcolor{bgcol}{#3} &   \vspace{2.5pt}\textcolor{sectcol}{#1}
\end{tabular*}

\vspace{-8pt}
\textcolor{softcol}{\hrule}
\vspace{6pt}

  $\cdot$ #4\\[3pt]
  $\cdot$ #5\\[3pt]
  $\cdot$ #6\\[6pt]

}

Now here is the thing: You can change this in any way you want, for example could you replace the bullets with a single parameter, and pass an item-list (using itemize:

\newcommand{\cvevent}[4]
{

\begin{tabular*}{1\textwidth}{p{13.6cm}  x{3.9cm}}
	\textbf{#2} - \textcolor{bgcol}{#3} &   \vspace{2.5pt}\textcolor{sectcol}{#1}
\end{tabular*}

\vspace{-8pt}
\textcolor{softcol}{\hrule}
\vspace{6pt}

#4
}

which you then call via:

\cvevent{2016 - present}{Scientific Employee / PhD Student}{University of XYZ}
{\begin{itemize}
  \item did this and that
  \item and this and this
  \item solved a lot of things
\end{itemize}}

Further readings: https://en.wikibooks.org/wiki/LaTeX/Macros

Clone this wiki locally