Skip to content

Extending cvevent Macro

Jan Küster edited this page Apr 6, 2021 · 2 revisions

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

Fixed parameter length

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}}

Arbitrary paramter length

Thanks to a pull request by @FFY00 there is also an example of using arbitrary parameters, as long as they are the last position in the list:

% creates a stretched box as cv entry headline followed by some 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:	list of paragraphs
%
\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}

	\foreach \desc in {#4}{
		$\cdot$ \desc\\[3pt]
	}
	
\vspace{3pt}
}

You can see the example also in the classic template here: https://github.com/FFY00/latexcv/blob/25d0b83140d470fd515b1b010dd1642d52a183bd/classic/main.tex#L241

You can now call the macro with arbitrary params:

\cvevent{2016 - present}{Scientific Employee / PhD Student}{University of Bremen}{
  {Develop and evaluate the next generation learning management system with Meteor},
  {Define a new level of software for classroom management based on an extensive nursing curriculum.}
  {More pragraphs}
  {And more pragraphs}
  {More pragraphs as many as you want}
}

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