I'm trying to update my cv (moderncv) and I had a custom made box added with some information that would show up. However, when compiling now on a new pc, this box doesn't show up. The bug is probably something stupid, since the log shows no errors. Does anyone hava an idea which error I made?

\patchcmd{\makecvtitle}% <cmd>
  {\usebox{\makecvtitlepicturebox}}% <search>
  {\leavevmode\rlap{\smash{\small% Adjust font style/size
     \\ \rule{0pt}{1.5\normalbaselineskip}%
     BirthDate:\\ *-*-* \\ Burgelijke staat: \\*% Your picture information here
   \usebox{\makecvtitlepicturebox}}% <replace>
  {}{}% <success><failure>

EDIT: I've added tracingpatches. The log can be found here

The key part is:

[debug] tracing \patchcmd on input line 65
[debug] analyzing '\makecvtitle'
[debug] ++ control sequence is defined
[debug] ++ control sequence is a macro
[debug] ++ macro can be retokenized cleanly
[debug] -- search pattern not found in replacement text
  • I don't see anything in the succes or failure branch and i don't see a \tracingpatches. Why not? This is essential for testing.
    – Johannes_B
    Feb 13, 2017 at 7:16
  • Since no working example is given, i can only guess you are trying something that might have worked with an old version, or you aretrying something working for the new version but having an old version installed.
    – Johannes_B
    Feb 13, 2017 at 7:17
  • 4
    etoolbox quite deliberately doesn't trigger an error if patching fails: as @Johannes_B says you need something in the 'failure' branch to tell you this has happened at the minimum. My guess is that definition of \makecvtitle has changed such that the 'hook' you are aiming for is no longer there.
    – Joseph Wright
    Feb 13, 2017 at 7:41
  • I've added the log file with tracingpatches. I'll try to make a minimal working example soon, unless someone already sees what the problem is.
    – jelmew
    Feb 13, 2017 at 8:12
  • 1
    The log says "[debug] -- search pattern not found in replacement text" Feb 13, 2017 at 8:29

1 Answer 1


Well, in older versions are the variables \makecvtitle and \makecvtitlepicturebox used. The current version 2.2.0 of moderncv uses \makecvhead and \makecvheadpicturebox instead. Because there are some major changes you need to rewrite the patching code complety.

With the following code (change values to your needs) you can see that I added the tabular you want in a new way:

\patchcmd{\makecvhead}% <cmd> instead \makecvtitle
  {\framebox{\includegraphics[width=\@photowidth]{\@photo}}}% <search> 
  {{\small% Adjust font style/size
      \framebox{\includegraphics[width=\@photowidth]{\@photo}} & \\
      BirthDate: & *-*-* \\ 
      Burgelijke staat: & * \\
  }% <replace>
  {}{}% <success><failure>

With the complete MWE


\moderncvstyle{casual} % head 2, body 1, foot 1



% personal data
\title{Resumé title}
\address{street and number}{postcode city}{country}
\email{[email protected]}
\extrainfo{additional information}
\quote{Some quote}

%   to show numerical labels in the bibliography (default is to show no labels)
%   to redefine the bibliography heading string ("Publications")

\patchcmd{\makecvhead}% <cmd> instead \makecvtitle
  {\framebox{\includegraphics[width=\@photowidth]{\@photo}}}% <search> 
  {{\small% Adjust font style/size
      \framebox{\includegraphics[width=\@photowidth]{\@photo}} & \\
      BirthDate: & *-*-* \\ 
      Burgelijke staat: & * \\
  }% <replace>
  {}{}% <success><failure>



\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}  % arguments 3 to 6 can be left empty

\section{Master thesis}
\cvitem{description}{Short thesis abstract}

\cventry{year--year}{Job title}{Employer}{City}{}{General description no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
  \item Sub-achievement (a);
  \item Sub-achievement (b), with sub-sub-achievements (don't do this!);
    \item Sub-sub-achievement i;
    \item Sub-sub-achievement ii;
    \item Sub-sub-achievement iii;
  \item Sub-achievement (c);
\item Achievement 3.
\cventry{year--year}{Job title}{Employer}{City}{}{Description line 1\newline{}Description line 2}
\cventry{year--year}{Job title}{Employer}{City}{}{Description}

\cvitemwithcomment{Language 1}{Skill level}{Comment}
\cvitemwithcomment{Language 2}{Skill level}{Comment}
\cvitemwithcomment{Language 3}{Skill level}{Comment}

\section{Computer skills}
\cvdoubleitem{category 1}{XXX, YYY, ZZZ}{category 4}{XXX, YYY, ZZZ}
\cvdoubleitem{category 2}{XXX, YYY, ZZZ}{category 5}{XXX, YYY, ZZZ}
\cvdoubleitem{category 3}{XXX, YYY, ZZZ}{category 6}{XXX, YYY, ZZZ}

\cvitem{hobby 1}{Description}
\cvitem{hobby 2}{Description}
\cvitem{hobby 3}{Description}

% moderncv sets the \cventry as an unbreakable block - a tabular - to achieve the display alignment. Also, the seventh argument #7 of \cventry - your itemized list - is set inside a minipage which also doesn't allow for breaking across the page boundary.
%You can manually format separate items to allow for page breaking by setting them inside an empty \cvitem{}:
  \item Worked on camera calibration and homography for the mapping of 
        objects onto a common coordinate system for object fusion and 
        analysis in world coordinates
%In order to allow for this to happen naturally would require a complete rewrite of that part (which is substantial).
% ======================================================================

\section{Extra 1}
\cvlistitem{Item 1}
\cvlistitem{Item 2}
\cvlistitem{Item 3. This item is particularly long and therefore normally spans over several lines. Did you notice the indentation when the line wraps?}

\section{Extra 2}
\cvlistdoubleitem{Item 1}{Item 4}
\cvlistdoubleitem{Item 2}{Item 5}%\cite{book1}}
\cvlistdoubleitem{Item 3}{Item 6. Like item 3 in the single column list before, this item is particularly long to wrap over several lines.}

  \cvcolumn{Category 1}{\begin{itemize}\item Person 1\item Person 2\item Person 3\end{itemize}}
  \cvcolumn{Category 2}{Amongst others:\begin{itemize}\item Person 1, and\item Person 2\end{itemize}(more upon request)}
  \cvcolumn[0.5]{All the rest \& some more}{\textit{That} person, and \textbf{those} also (all available upon request).}


%-----       letter       ---------------------------------------------------------
% recipient data
\recipient{Company Recruitment team}{Company, Inc.\\123 somestreet\\some city}
\date{January 01, 1984}
\opening{Dear Sir or Madam,}
\closing{Yours faithfully,}
\enclosure[Attached]{curriculum vit\ae{}}          % use an optional argument to use a string other than "Enclosure", or redefine \enclname

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis 
ullamcorper neque sit amet lectus facilisis sed luctus nisl iaculis. 
Vivamus at neque arcu, sed tempor quam. Curabitur pharetra tincidunt 
tincidunt. Morbi volutpat feugiat mauris, quis tempor neque vehicula 
volutpat. Duis tristique justo vel massa fermentum accumsan. Mauris 
ante elit, feugiat vestibulum tempor eget, eleifend ac ipsum. Donec 
scelerisque lobortis ipsum eu vestibulum. Pellentesque vel massa at 
felis accumsan rhoncus.

Suspendisse commodo, massa eu congue tincidunt, elit mauris pellentesque 
orci, cursus tempor odio nisl euismod augue. Aliquam adipiscing nibh ut 
odio sodales et pulvinar tortor laoreet. Mauris a accumsan ligula. Class 
aptent taciti sociosqu ad litora torquent per conubia nostra, per 
inceptos himenaeos. Suspendisse vulputate sem vehicula ipsum varius nec 
tempus dui dapibus. Phasellus et est urna, ut auctor erat. Sed tincidunt 
odio id odio aliquam mattis. Donec sapien nulla, feugiat eget adipiscing 
sit amet, lacinia ut dolor. Phasellus tincidunt, leo a fringilla 
consectetur, felis diam aliquam urna, vitae aliquet lectus orci nec 
velit. Vivamus dapibus varius blandit.

Duis sit amet magna ante, at sodales diam. Aenean consectetur porta 
risus et sagittis. Ut interdum, enim varius pellentesque tincidunt, 
magna libero sodales tortor, ut fermentum nunc metus a ante. Vivamus 
odio leo, tincidunt eu luctus ut, sollicitudin sit amet metus. Nunc sed 
orci lectus. Ut sodales magna sed velit volutpat sit amet pulvinar diam 

Albert Einstein discovered that $e=mc^2$ in 1905.

\[ e=\lim_{n \to \infty} \left(1+\frac{1}{n}\right)^n \]



you get the following compiled first page:

resulting first page of MWE

  • Wow, you saved me the effort of digging to the source code myself. Thanks a lot.
    – jelmew
    Feb 22, 2017 at 8:09

You must log in to answer this question.

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