1

Tried to shorten the moderncv template by putting two skillentries in one row with minipage and multicols. The two columns are not on the same height and there is currently an \hfill after ChemCAD that does nothing. Standardcommands like \newline or \ don't work either. Any idea how I could adjust the height and throw the Languages into the next row? Any help is appreciated. Below is a working code and visualisation of it. Am using TeXstudio with MiKTeX on Win10.

\documentclass[11pt,a4paper,roman]{moderncv} 
\moderncvstyle{classic} 
\moderncvcolor{blue}      
\usepackage{multicol}
\usepackage[scale=0.75]{geometry}
\firstname{\Huge \color{darkgray}Max}
\familyname {\Huge \color{black}Muster}

\begin{document} \section{EDV Kenntnisse} \cvskillentry{Text:}{4}{Word}{}{} \cvskillentry{}{1}{\LaTeX}{}{} \cvskillentry{CAD:}{4}{ChemCAD}{}{} \cvskillentry{}{2}{PDMS}{}{} \cvskillentry{}{3}{Inventor}{}{} \cvskillentry{Languages:}{3}{MATLAB}{}{} \hspace{\hintscolumnwidth}%

\begin{minipage}{\maincolumnwidth}
    \setlength{\hintscolumnwidth}{0pt}
\begin{multicols}{2}

\cvskillentry{Text:}{4}{Word}{}{} \cvskillentry{}{2}{PDMS}{}{} \cvskillentry{CAD:}{4}{ChemCAD}{}{} \hfill \cvskillentry{}{1}{\LaTeX}{}{} \cvskillentry{}{3}{Inventor}{}{} \cvskillentry{Languages:}{3}{MATLAB}{}{} \hspace{\hintscolumnwidth}% \end{multicols} \end{minipage}

\end{document}

Currently looks like this

JamesT
  • 3,169
dc'dt
  • 48
  • \cvskillentry's 4th and 5th arguments actually set contents to the right of what you currently have. The assumption is that you won't use that information, right? – Werner Oct 12 '23 at 04:50
  • Are you looking for something like this? image – Werner Oct 12 '23 at 05:33
  • Yes, I am looking exactly for what you created in the image. The 4th argument was for "years" and 5th arguments for a "comment" column in the original template. I decided not to use that info to fit two skills in one row instead, so the whole CV doesn't slip on a third page. Theoretically the 4th argument could be used as skill bar but didn't know how to realise it since its predefined. Thats why I tried with minipage/multicols. – dc'dt Oct 12 '23 at 21:20
  • @Werner do you mind sharing the code of how you created the image or giving me a hint? Thanks – dc'dt Oct 13 '23 at 16:02
  • I've added an answer showing the code. – Werner Oct 13 '23 at 18:52

1 Answers1

1

The default setup for \cvskillentry is to spread its 5 arguments across the text block width. So, without some major (temporary) hacking of the macro to allow for a multi-column layout, you can pull the original definitions from the source and build your own table.

To do this, find the definition of \cvskillentry in moderncvskillmatrix.sty (there are multiple definitions, depending on the style that you're loading). Based on that, and for ease of column width calculations, I added tabularx into the mix to obtain the output below.

enter image description here

\documentclass[11pt,a4paper,roman]{moderncv}

\moderncvstyle{classic} \moderncvcolor{blue}
\usepackage[scale=0.75]{geometry} \usepackage{tabularx}

\firstname{First name} \familyname{Last name}

\begin{document}

\section{EDV Kenntnisse}

\makeatletter \begingroup \renewcommand{\arraystretch}{1.25}% \arrayrulecolor{color1}% \begin{tabularx}{\linewidth}{@{}p{\skillmatrix@hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}% p{\cvskill@width}@{\hspace{\skillmatrix@padding}}% X X% p{\cvskill@width}@{\hspace{\skillmatrix@padding}}% X X@{}}% \cdashline{2-7}[.6pt/1pt] \raggedleft\hintstyle{Text:} &\centering \cvskill{4} &\centering Word & & \centering \cvskill{1} & \centering \LaTeX & \tabularnewline \cdashline{2-7}[.6pt/1pt] \raggedleft\hintstyle{CAD:} &\centering \cvskill{4} &\centering ChemCAD & & \centering \cvskill{2} & \centering PDMS \tabularnewline &\centering \cvskill{3} &\centering Inventor & & & \tabularnewline \cdashline{2-7}[.6pt/1pt] \raggedleft\hintstyle{Languages:} &\centering \cvskill{3} &\centering MATLAB & & & & \end{tabularx} \makeatother \endgroup

\end{document}

The \makeatletter/\makeatother pair is required since I'm using macros with @ in them that are defined within the moderncv base code, while the grouping (\begingroup...\endgroup) makes any changes to macros (like the adjustment to \arraystretch and colour) temporary.

Werner
  • 603,163