3

I tried editing the \cvdoubleitem in the class moderncv, style banking. I wanted to boldface the categories. I tried the following but it gives a very weird alignment when I do so, although boldfacing the text correctly.

\renewcommand*{\cvdoubleitem}[5][.5em]{%
    \cvitem[#1]{\bfseries#2}{%
        \begin{minipage}[t]{\doubleitemcolumnwidth}#3\end{minipage}%
        \hfill% fill of \separatorcolumnwidth
        \begin{minipage}[t]{\hintscolumnwidth}\raggedleft\hintstyle{\bfseries#4}\end{minipage}%
        \hspace*{\separatorcolumnwidth}%
        \begin{minipage}[t]{\doubleitemcolumnwidth}#5\end{minipage}}}

However, this produces, on 2 double items (4 items), Screw up of \cvdoubleitem

I thought editing the code here might help but that original code itself gave me an error so I didn't try.

An MWE is given below:

\documentclass[12pt,letterpaper,sans]{moderncv}
\moderncvstyle{banking}
\name{ieujrghieu}{wirjufhiuryg}

\renewcommand*{\cvdoubleitem}[5][.5em]{%
    \cvitem[#1]{\bfseries#2}{%
        \begin{minipage}[t]{\doubleitemcolumnwidth}#3\end{minipage}%
        \hfill% fill of \separatorcolumnwidth
        \begin{minipage}[t]{\hintscolumnwidth}\raggedleft\hintstyle{\bfseries#4}\end{minipage}%
        \hspace*{\separatorcolumnwidth}%
        \begin{minipage}[t]{\doubleitemcolumnwidth}#5\end{minipage}}}

\begin{document}
    \cvdoubleitem{TTTTTTT}{doiuehneiuhrigbn3ghbn iurh fg3iuh gi3uh giu43ygh iu3 ghiu3rg3iu}{GGGGGGGGGG}{eihg uegh iuh 39uf h23 948h f924 fu4g fiuf 2iuf g4iuf g}
    \cvdoubleitem{PPPPPPPPP}{rusfhvioehr iughe r}{MMMMMM}{3iurgh re3uygh 3eur}
\end{document}
7
  • Those (TTTTTT and PPPPPP) are bold by default. Anyway, you can change their appearance by redefining hintfont.
    – Johannes_B
    May 14, 2017 at 6:43
  • Your redefinition of cvdoubleitem is calling cvitem. That is far from what the template is supposed to do and leads to the weird alignment.
    – Johannes_B
    May 14, 2017 at 6:44
  • Oh OK there was another code which was un-bolding this. Thanks. I copied the redefinition from the main body .sty files. It seemed to call cvitem to define cvdoubleitem so I did.
    – Zack Fair
    May 15, 2017 at 4:46
  • Maybe you are using a modified version? That's why i asked for a link to the template. People aren't really treating other peoples copyright well, changing files again and again. Makes life of a helper a nightmare. Please add the link to the question.
    – Johannes_B
    May 15, 2017 at 4:48
  • tex.stackexchange.com/questions/146770/… I used the first answer here to edit my header. The \renewcommand*{\hintfont}{} line screwed it up.
    – Zack Fair
    May 15, 2017 at 4:54

1 Answer 1

1

In the current version of class moderncv 2.0.0 for style banking you will find the correct definition of command \cvdoubleitem in file moderncvbodyiii.sty:

\renewcommand*{\cvdoubleitem}[5][.25em]{%
  \begin{minipage}[t]{\doubleitemcolumnwidth}\hintstyle{#2}: #3\end{minipage}%
  \hfill% fill of \separatorcolumnwidth
  \begin{minipage}[t]{\doubleitemcolumnwidth}\ifthenelse{\equal{#4}{}}{}{\hintstyle{#4}: }#5\end{minipage}%
  \par\addvspace{#1}}

Command \hintstyle defined that text #2 or #4 has to be printed bold. It is defined in the class as \renewcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}} and \hintfont is defined as \renewcommand*{\hintfont}{\bfseries}

To get rid of printing bold you can define an own new command \mycvdoubleitem and delete there the both commands \hintstyle{}. Now you can change \mycvdoubleitem for your needs.

The following MWE shows the difference of commands \cvdoubleitem and \mycvdoubleitem

\documentclass[12pt,letterpaper,sans]{moderncv}
\moderncvstyle{banking}
\name{ieujrghieu}{wirjufhiuryg}


\newcommand*{\mycvdoubleitem}[5][.25em]{%
  \begin{minipage}[t]{\doubleitemcolumnwidth}#2: #3\end{minipage}%
  \hfill% fill of \separatorcolumnwidth
  \begin{minipage}[t]{\doubleitemcolumnwidth}\ifthenelse{\equal{#4}{}}{}{#4: }#5\end{minipage}%
  \par\addvspace{#1}}


\begin{document}
  \cvdoubleitem{1TTTTTTT}{2doiuehneiuhrigbn3ghbn iurh fg3iuh gi3uh 
    giu43ygh iu3 ghiu3rg3iu}{3GGGGGGGGGG}{4eihg uegh iuh 39uf h23 948h 
    f924 fu4g fiuf 2iuf g4iuf g}
  \cvdoubleitem{1PPPPPPPPP}{2rusfhvioehr iughe r}{3MMMMMM}{43iurgh 
    re3uygh 3eur}

  \mycvdoubleitem{1TTTTTTT}{2doiuehneiuhrigbn3ghbn iurh fg3iuh gi3uh 
    giu43ygh iu3 ghiu3rg3iu}{3GGGGGGGGGG}{4eihg uegh iuh 39uf h23 948h 
    f924 fu4g fiuf 2iuf g4iuf g}
  \mycvdoubleitem{1PPPPPPPPP}{2rusfhvioehr iughe r}{3MMMMMM}{43iurgh 
    re3uygh 3eur}

\end{document}

with the result

resulting pdf

You must log in to answer this question.

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