I would like to add a extra information, but before the address information line, and after my name, of course.
How can I do that?
The following minimal example patches \maketitle
to insert a macro that contains "extra information" in the title for the moderncv
banking
style. The command used to adjust this "extra information" is \someextrainfo{<stuff>}
. You can also adjust the font, if needed, using \someextrainfofont{<font>}
. Note that you may have to reset any such font changes using \addressfont{<font>}
, as fonts are set using switches.
\documentclass{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\maketitle}% <cmd>
{\addressfont\color{color2}}% <search>
{\@someextrainfofont\color{color2}%
\ifcsdef{@someextrainfo}{\@someextrainfo\\}{}%
\addressfont}% <replace>
{}{}% <success><failure>
\providecommand{\@someextrainfofont}{}
\newcommand{\someextrainfo}[1]{\gdef\@someextrainfo{#1}}
\newcommand{\someextrainfofont}[1]{\gdef\@someextrainfofont{#1}}
\makeatother
\usepackage{libertine}
\usepackage[scale=0.75]{geometry}
\name{John}{Doe}
\someextrainfo{some extra information}
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{[email protected]}
\homepage{www.johndoe.com}
\quote{Some quote}
\begin{document}
\makecvtitle
\section{A test section}
Some test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text
\end{document}
\extrainfo
already existed, sorry. I've updated that to use \somextrainfo
(and \somextrainfofont
).
Finally, I edit Wener's code. Just to make a difference between the default extrainfo and this new extrainfo
The following minimal example patches `\maketitle` to insert a macro that contains "extra information" in the title for the [`moderncv`](http://ctan.org/pkg/moderncv) `banking` style. The command used to adjust this "extra information" is `\extrainfo{<stuff>}`. You can also adjust the font, if needed, using `\extrainfofont{<font>}`. Note that you may have to reset any such font changes using `\addressfont{<font>}`, as fonts are set using *switches*.
\documentclass{moderncv}
\moderncvstyle{banking}
\moderncvcolor{blue}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\maketitle}% <cmd>
{\addressfont\color{color2}}% <search>
{\@extrainfofont\color{color2}%
\ifcsdef{@extrainf}{\@extrainf\\}{}%
\addressfont}% <replace>
{}{}% <success><failure>
\providecommand{\@extrainfofont}{}
\newcommand{\extrainf}[1]{\gdef\@extrainf{#1}}
\newcommand{\extrainfofont}[1]{\gdef\@extrainfofont{#1}}
\makeatother
\usepackage{libertine}
\usepackage[scale=0.75]{geometry}
\name{John}{Doe}
\extrainf{some extra information}
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{[email protected]}
\homepage{www.johndoe.com}
\quote{Some quote}
\begin{document}
\makecvtitle
\section{A test section}
Some test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text test text
\end{document}
\documentclass ...
and ending with\end{document}
so as people here can reproduce your situation and help you.\title{more informations}