2

I'd like to delete my phone entry in a document, in which the entry is set previously in the heading of the cover letter, but it's unpleasant occurring in the latter case(s) automatically.
I can add (seemingly) as many phone entries as I want, but I cannot remove any.

mwe.tex

\documentclass[a4paper]{moderncv}
\moderncvtheme[blue]{classic}
\usepackage[left=25mm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{ragged2e}
\usepackage{lipsum}
\makeatletter
\newcommand*{\subject}[1]{\def\@subject{\textbf{#1}}}
\patchcmd{\makeletterhead}{\@date\\[2em]}{\@date\\[2em]\@subject\par\medskip
}{}{}
\renewcommand*{\makeletterclosing}{
    \\[1em]\@closing\\[1em]
    {\includegraphics[width=4cm]{mwe.png}
    \par
    \bfseries \@firstname~\@lastname}
    \ifthenelse{\isundefined{\@enclosure}}{}{
        \vfill
        {\color{color2}\itshape\enclname: \@enclosure}}}
\makeatother
\setlength{\hintscolumnwidth}{45mm}
\name{Myself}{Me}
\title{Applying including living walk}
\address{Homestreet 0}{56789 Homing}
\email{[email protected]}
\phone{0123 456 789}
\photo[55mm][0pt]{mwe.png}
\author{\href{mailto:[email protected]}{Myself Me}}
\date{\today}
\begin{document}
    \newcommand{\n}{\newline}
    \recipient{Musterfirming\n personal management\n attn. Max Musterman}{Musterstreet\n 01234 Mustercity}
    \date{Homing, the \today}
    \opening{Dear Sirs and Madams,}
    \closing{Kind regards}
    \enclosure[\vfill Additional things]{Living walk}
    \subject{Jobapplying}

    \makelettertitle\justifying
    \lipsum[1]
    \makeletterclosing
    \newpage

    \renewcommand{\fixedphonesymbol}{}
    \renewcommand{\emailsymbol}{}
    \name{Me, Myself}{I}
    \title{Living walk}
    \address{}{}
    \collectionloop{phones}{}
%   \phone
    \email{}

\makecvtitle
\section{Personal datas\n}
    \cvitem{Name}{Me, Myself and I}
    \cvitem{Address}{Homestreet 1, 56789 Homing}
    \cvitem{Birth date and place}{1. 2. 345 in Hometopia}
    \cvitem{Citicenship}{Mine}
    \cvitem{Phone}{0123 456 789}
    \cvitem{Email}{[email protected]\n\n}
\section{Next whatevers\n}
    \cvitem{Also name}{Me, Myself and I}
    \cvitem{Again address}{Homestreet 1, 56789 Homing}
    \cvitem{Birth date and place}{1. 2. 345 in Hometopia}
    \cvitem{Citicenship}{Mine}
    \cvitem{Phone}{0123 456 789}
    \cvitem{Email}{[email protected]\n\n}
\end{document}

I actually get this (with mwe.png). On the second page next to the picture, there's a phone number, which should not appear there and therefore it ought to be removed.

How can I delete (all) phone entries in my document after it's used once?

1
  • 3
    Could you show an example document that results in the unwanted output? Also, what exactly do you mean with "after it's used once"?
    – Marijn
    Commented Apr 30, 2021 at 13:34

1 Answer 1

2

Well, in file moderncvheadi.sty there is a definition of option nodetails which is set to \@detailsfalse if used.

With this option you can suppress all additional personal informations in the header of the cv (and letter) using in your tex code this:

\makeatletter
\@detailsfalse
\makeatother

With the following MWE (see important code changings marked with <=======):

\documentclass[a4paper]{moderncv}

\moderncvstyle{classic}
\moderncvcolor{blue}

\usepackage[left=25mm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{ragged2e}
\usepackage{lipsum}

\makeatletter
\newcommand*{\subject}[1]{\def\@subject{\textbf{#1}}}
\patchcmd{\makeletterhead}{\@date\\[2em]}{\@date\\[2em]\@subject\par\medskip
}{}{}
\renewcommand*{\makeletterclosing}{
    \\[1em]\@closing\\[1em]
    {\includegraphics[width=4cm]{example-image}
    \par
    \bfseries \@firstname~\@lastname}
    \ifthenelse{\isundefined{\@enclosure}}{}{
        \vfill
        {\color{color2}\itshape\enclname: \@enclosure}}}
\makeatother

\setlength{\hintscolumnwidth}{45mm}

\name{Myself}{Me}
\title{Applying including living walk}
\address{Homestreet 0}{56789 Homing}
\email{[email protected]}
\phone{0123 456 789}
\photo[55mm][0pt]{example-image}
\author{\href{mailto:[email protected]}{Myself Me}}
\date{\today}


\begin{document}
    \newcommand{\n}{\newline}
    \recipient{Musterfirming\n personal management\n attn. Max Musterman}{Musterstreet\n 01234 Mustercity}
    \date{Homing, the \today}
    \opening{Dear Sirs and Madams,}
    \closing{Kind regards}
    \enclosure[\vfill Additional things]{Living walk}
    \subject{Jobapplying}

    \makelettertitle\justifying
    \lipsum[1]
    \makeletterclosing
    \newpage

%   \renewcommand{\fixedphonesymbol}{} <================================
%   \renewcommand{\emailsymbol}{} <=====================================
    \name{Me, Myself}{I}
    \title{Living walk}
%   \address{}{} <======================================================
%   \collectionloop{phones}{} <=========================================
%%   \phone{~}
%   \email{} <==========================================================

% to get no details in makecvtitle
\makeatletter % <=======================================================
\@detailsfalse
\makeatother % <========================================================

\makecvtitle
\section{Personal datas\n}
    \cvitem{Name}{Me, Myself and I}
    \cvitem{Address}{Homestreet 1, 56789 Homing}
    \cvitem{Birth date and place}{1. 2. 345 in Hometopia}
    \cvitem{Citicenship}{Mine}
    \cvitem{Phone}{0123 456 789}
    \cvitem{Email}{[email protected]\n\n}
\section{Next whatevers\n}
    \cvitem{Also name}{Me, Myself and I}
    \cvitem{Again address}{Homestreet 1, 56789 Homing}
    \cvitem{Birth date and place}{1. 2. 345 in Hometopia}
    \cvitem{Citicenship}{Mine}
    \cvitem{Phone}{0123 456 789}
    \cvitem{Email}{[email protected]\n\n}
\end{document}

you get the wished result:

resulting pdf for cv

In the letter you will still see all personal datas:

resulting pdf for letter with personal datas in header

You must log in to answer this question.

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