1

This question already has an answer here:

I am writing a CV with cover letter using moderncv 2.0 and I would like the line with the recipient to be longer. This question is technically a duplicate of this one, but the given solution does not work for me. When I use

\tracingpatches
\patchcmd{\makelettertitle}
  {\begin{minipage}[t]{.5\textwidth}}
  {\begin{minipage}[t]{.8\textwidth}}
  {}
  {}

the output tells me:

[debug] tracing \patchcmd on input line 16
[debug] analyzing '\makelettertitle'
[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

But when I use renewcommand to rewrite the \makeletterhead command, I can change the size perfectly well. In the MWE I comment out the working part.

MWE:

\documentclass[roman]{moderncv}
% Diese drei Pakete benötigen wir für die Umlaute, Deutsche Silbentrennung etc.
\moderncvtheme[black]{classic}         %alternativ: casual

\usepackage[applemac]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}

% adjust the page margins
\usepackage[scale=0.75]{geometry}
\recomputelengths

\tracingpatches

\makeatletter
\patchcmd{\makelettertitle}
  {\begin{minipage}[t]{.5\textwidth}}
  {\begin{minipage}[t]{.8\textwidth}}
  {}
  {}
\makeatother

% \makeatletter
% \renewcommand*{\makeletterhead}{%
%   % recompute lengths (in case we are switching from letter to resume, or vice versa)
%   \recomputeletterlengths%
%   % sender contact info
%   \hfill%
%   \begin{minipage}{.5\textwidth}%
%     % optional detailed information
%     \if@details%
%       \raggedleft%
%       \addressfont\textcolor{color2}{%
%         {\bfseries\upshape\@firstname~\@lastname}\@firstdetailselementfalse%
%         % optional detailed information
%         \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
%           \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
%           \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
%         \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
%           \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%
%         \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
%         \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
%         \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi%
%     \end{minipage}\\[1em]
%   % recipient block
%   \begin{minipage}[t]{.8\textwidth}      % original: .5
%     \raggedright%
%     \addressfont%
%     {\bfseries\upshape\@recipientname}\\%
%     \@recipientaddress%
%   \end{minipage}
%   % date
%   \hfill% US style
% %  \\[1em]% UK style
%   \@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900"
%   % opening
%   \raggedright%
%   \@opening\\[1.5em]%
%   % ensure no extra spacing after \makelettertitle due to a possible blank line
% %  \ignorespacesafterend% not working
%   \hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}}
% \makeatother

\name{Peter}{Müller}

\title{Lebenslauf}
\address{Hauptstraße 123}{12345 Berlin}
\mobile{0123/45678901}
\email{pink.panther@panthermail.pp}

\nopagenumbers{}                

\begin{document}

%-----       letter       ---------------------------------------------------------
% recipient data
\recipient
  {Super Universität Berlin, FB Superfachbereich und andere Wissenschaften}
  {Institut für Superduper\\
    Angewandte Mathematik und Gender Studies\\
    Frau Prof. Dr. Dr. Prof.\\
    Hauptstr. 456\\
    54321 Berlin}

\opening{Sehr geehrte Damen und Herren,}
\closing{Mit freundlichen Grüßen\newline}
\enclosure[im Anhang]{Lebenslauf, Leistungsübersicht, Immatrikulationsbescheinigung}

\makelettertitle

\end{document}

 % Local variables:
 % mode: latex
 % TeX-open-quote: "\"`"
 % TeX-close-quote: "\"'"
 % TeX-master: t
 % End:

I'm not sure whether it is important, but I'm using Emacs.app with AUCTeX on Mac OS X, German language and this is my first question on Stackexchange.

marked as duplicate by Werner, karlkoeller, Community Aug 21 '15 at 16:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    The message is telling you the reason: "-- search pattern not found in replacement text", so the text that you are searching to replace doesn't match any of the text in the definition. – Gonzalo Medina Aug 21 '15 at 15:35
  • 1
    I left a comment to the linked answer: I believe that with the current version of moderncv one has to patch \makeletterhead instead of \makelettertitle. – egreg Aug 21 '15 at 15:43
  • 2
    See this comment by the answerer: tex.stackexchange.com/questions/157146/… I think we can close this question as duplicate, now. – egreg Aug 21 '15 at 15:48

Browse other questions tagged or ask your own question.