3

I'm really sorry to ask this question but I find myself unable to answer it for myself, with little idea of what went wrong:

I created a template for my CV using LaTeX, which worked fine for a year, but I let it untouched for 2 months. I had to recently upgrade my linux distribution and lost a number of libraries in the process (I mention it without a clue whether it's relevant or not). The end of the story is that now, I can't compile my .tex code.

Among various warnings, I see the error:

! LaTeX Error: \flushmaketitle undefined.

See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ...

                                               l.24               

\renewcommand*{\flushmaketitle}

Another maybe relevant warning is

LaTeX Warning: You have requested package moderncvheadiii', but the package providesmoderncvheadiii'.

LaTeX Warning: You have requested package moderncvbodyiii', but the package providesmoderncvbodyiii'.

Here is a cleared version of the .tex file:

\documentclass[11pt,a4paper]{moderncv}
    \moderncvstyle{banking}
    \moderncvcolor{black}                 
\usepackage[utf8]{inputenc} 
\usepackage[hscale=0.8, vscale=1, top=2.5cm]{geometry}
%\usepackage{libertine}
%\usepackage[sfdefault, light]{roboto}  %% Option 'sfdefault' only if the base font of the document is to be sans serif
\usepackage[T1]{fontenc}
\usepackage[skins]{tcolorbox}
\renewcommand{\sfdefault}{phv}
\renewcommand{\seriesdefault}{l}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\usetikzlibrary{patterns}
\usepackage{booktabs}

\definecolor{color0}{rgb}{0.,0.,0.}       
\definecolor{color1}{rgb}{0., 0.6, 0.8}  

            \makeatletter
                \renewcommand{\familydefault}{\sfdefault}

                \renewcommand*{\flushmaketitle}{%
                  \strut\usebox{\maketitlebox}%
                  \savebox{\maketitlebox}{}%
                  \savebox{\maketitletempbox}{}%
                  \setlength{\maketitleboxwidth}{0pt}}

                \renewcommand*{\maketitle}{
                  \setlength{\maketitlewidth}{0.7\textwidth}
                  \parbox{\maketitlewidth}{
                    \raggedright

                    \namestyle{\@firstname~\@lastname}\\
                    \vspace{0.2cm}
                    \addressfont\color{color2}%
                    \vspace{0.1cm}
                    \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle{\addresssymbol\@addressstreet}%
                      \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}
                     %
                     \flushmaketitle 
                     \@firstmaketitleelementtrue}
                     }
                     %}
                    \addtomaketitle{\emaillink{\@email}}

                    \collectionloop{phones}{\addtomaketitle{\@mobile}}
                    \vspace{0.1cm}

                    \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}%
                    \ifthenelse{\isundefined{\@title}}{}{\addtomaketitle{\@title}}%
                    %\ifthenelse{\isundefined{\@fax}}{}{\addtomaketitle{\@fax}}%
                                    \vspace{0.1cm}
                    \flushmaketitle}\\[2.5em]}

                \newcommand{\cfbox}[2]{%
                    \colorlet{currentcolor}{.}%
                    {\color{#1}%
                        \fbox{\color{currentcolor}#2}}%
                }

            %   \patchcmd{\maketitle}{\\[2.5em]}{\hfill\raisebox{-1.5cm}{\cfbox{color1}{\includegraphics[width=80pt]{/home/pierre/Documents/Personnel/CVFR/moi1}}}\\[2.5em]}
            \makeatother

\firstname{Pierre}
\familyname{Doe}
\address{Street}{Lane}
\mobile{+60669412}
\email{[email protected]}
\extrainfo{age\hspace{7pt}} 
\title{\hspace{1pt}} 
\fax{} 

\begin{document}  
    \makecvtitle
\nopagenumbers{}

% this puts a dashed thing on the header
%   \begin{tikzpicture}
%   \fill[pattern=dots, pattern color=color1, overlay] (-0.2,0.2) rectangle (17,4.4);
%   \end{tikzpicture}

    \begin{tikzpicture}[radius=1cm,delta angle=180, overlay]
    \node[circle,draw=color1,inner sep=1.3cm,fill overzoom image=/home/pierre/Documents/.jpg] (A) at (15cm,2.8cm) {};
    \end{tikzpicture}


\vspace{0pt}\section{Formation}\vspace{4pt}
    \cventry{something}{something}{}{}{}{}\vspace{-12pt}

\end{document}
3
  • At a guess, in upgrading linux you've updated moderncv and some of the internals of the moderncv package have changed. Possibly adding \newcommand*{\flushmaketitle}{} near the beginning will make the document compile though it will probably not look as you want it. The "You requested package..." warnings will not cause errors or stop compiling and so can be left. What I expect you want to know (outside my knowledge) is what the \flushmaketitle command has been renamed to in the moderncv package.
    – Dai Bowen
    Commented Oct 4, 2016 at 9:05
  • 1
    Do you have an old log file (I mean from the time you can compile the cv)? If yes please check in that log file which (old) version of moderncv you have used. In the current version 2 the command is not defined. Can you explain in short words, what that command should do?
    – Mensch
    Commented Oct 4, 2016 at 9:13
  • 2
    The moderncv class underwent substantial refactoring when stepping the main version number to 2. Unfortunately, there's no hint in the documentation about what happened to \flushmaketitle
    – egreg
    Commented Oct 4, 2016 at 9:14

1 Answer 1

4

Well, in the new version 2.0 of moderncv there was a renaming from old version flushmaketitle to flushmakeheaddetails.

That means you can try to change the error causing command \renewcommand to \newcommand (because the following command has to be defined new now) like

% <=====================================================================
\newcommand*{\flushmaketitle}{%  new version 2.0 flushmaketitle -> flushmakeheaddetails

That compiles for me, but I do not know what you expect and it could be there are other errors now. Please check that with the following MWE:

\documentclass[11pt,a4paper]{moderncv}

\moderncvstyle{banking}
\moderncvcolor{black} 

\usepackage[utf8]{inputenc} 
\usepackage[hscale=0.8, vscale=1, top=2.5cm]{geometry}
%\usepackage{libertine}
%\usepackage[sfdefault, light]{roboto}  %% Option 'sfdefault' only if the base font of the document is to be sans serif
\usepackage[T1]{fontenc}
\usepackage[skins]{tcolorbox}
\renewcommand{\sfdefault}{phv}
\renewcommand{\seriesdefault}{l}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\usetikzlibrary{patterns}
\usepackage{booktabs}

\definecolor{color0}{rgb}{0.,0.,0.}       
\definecolor{color1}{rgb}{0., 0.6, 0.8}  

\makeatletter
\renewcommand{\familydefault}{\sfdefault}

% <=====================================================================
\newcommand*{\flushmaketitle}{%  new version 2.0 flushmaketitle -> flushmakeheaddetails
  \strut\usebox{\maketitlebox}%
  \savebox{\maketitlebox}{}%
  \savebox{\maketitletempbox}{}%
  \setlength{\maketitleboxwidth}{0pt}%
}

\renewcommand*{\maketitle}{
  \setlength{\maketitlewidth}{0.7\textwidth}
  \parbox{\maketitlewidth}{
    \raggedright

  \namestyle{\@firstname~\@lastname}\\
  \vspace{0.2cm}
  \addressfont\color{color2}%
  \vspace{0.1cm}
  \ifthenelse{\isundefined{\@addressstreet}}{}{%
    \addtomaketitle{\addresssymbol\@addressstreet}%
    \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}
    %
    \flushmaketitle 
    \@firstmaketitleelementtrue}
  }
                     %}
                    \addtomaketitle{\emaillink{\@email}}

                    \collectionloop{phones}{\addtomaketitle{\@mobile}}
                    \vspace{0.1cm}

                    \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}%
                    \ifthenelse{\isundefined{\@title}}{}{\addtomaketitle{\@title}}%
                    %\ifthenelse{\isundefined{\@fax}}{}{\addtomaketitle{\@fax}}%
                                    \vspace{0.1cm}
                    \flushmaketitle}\\[2.5em]}

\newcommand{\cfbox}[2]{%
  \colorlet{currentcolor}{.}%
  {\color{#1}%
  \fbox{\color{currentcolor}#2}}%
}

%\patchcmd{\maketitle}{\\[2.5em]}{\hfill\raisebox{-1.5cm}{\cfbox{color1}{\includegraphics[width=80pt]{/home/pierre/Documents/Personnel/CVFR/moi1}}}\\[2.5em]}
\makeatother

\firstname{Pierre}
\familyname{Doe}
\address{Street}{Lane}
\mobile{+60669412}
\email{[email protected]}
\extrainfo{age\hspace{7pt}} 
\title{\hspace{1pt}} 
\fax{} 


\begin{document}  
\makecvtitle
\nopagenumbers{}

% this puts a dashed thing on the header
%   \begin{tikzpicture}
%   \fill[pattern=dots, pattern color=color1, overlay] (-0.2,0.2) rectangle (17,4.4);
%   \end{tikzpicture}

    \begin{tikzpicture}[radius=1cm,delta angle=180, overlay]
    \node[circle,draw=color1,inner sep=1.3cm,fill overzoom image=example-image-a.jpg] (A) at (15cm,2.8cm) {}; % image=/home/pierre/Documents/.jpg
    \end{tikzpicture}


\vspace{0pt}\section{Formation}\vspace{4pt}
    \cventry{something}{something}{}{}{}{}\vspace{-12pt}

\end{document}

I changed the image file name too and get then the result:

enter image description here

Is that close to that what you need? If not the only chance is to install the old version of moderncv or change your code to be able to use verion 2.0 (that would be better in my eyes ...)

2
  • thank you again! However this is not exactly what I had: the name is in the middle (I put it flushed left for balance, iirc I had a casual header and a banking body). Also, the orders of the fields have changed (for instance the field on the right of the vertical bar is now my nationality). And finally and that's what I'm trying to figure atm, is how to get rid of icons. Using \moderncvicons{} instead of \moderncvicons{awesome} does not work...
    – pierre
    Commented Oct 4, 2016 at 13:31
  • I did not unfortunately. However I reinstalled the 1.5.1 version and can provide you with a visual:dropbox.com/s/zdc62dy34oexp8o/CV_test.pdf?dl=0
    – pierre
    Commented Oct 5, 2016 at 12:03

You must log in to answer this question.

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