7

I'd like to have 3 lines for address with moderncv style. So I've added this lines in my file

\makeatletter
\renewcommand*{\address}[3]{\def\@addressstreet{#1}\def\@addresscity{#2}\def\@addresscountry{#3}}
\makeatother

\address{Street }{town}{Country}

but nothing has changed. Can anybody tell me how can I do?

2 Answers 2

3

The easiest solution is to simply use multi-line arguments, i.e. \address{Street}{Town\\Country}.

Your definition doesn't work, because \address only stores the information. The actual printing is done by the \maketitle command, which is redefined in the corresponding .sty file, i.e. moderncvthemeclassic.sty.

2
  • 2
    Sorry but this doesn't work. I get this error message "!Argument of \@firstoftow has an extra"
    – Hamed
    Dec 2, 2012 at 19:44
  • I would correct here, using multi-line arguments is allowed only for the first one \address{Street\\Town}{Country}
    – Hamed
    Oct 1, 2015 at 11:27
8

moderncv has changed its syntax again so my old answer no longer works for a number of reasons. Anyway things are now much simpler because version 2.0.0 of moderncv now provides a command \makenewline that can be inserted in to the arguments of \address. Thus you can write

\address{street and number}{postcode city\makenewline county\makenewline country}

to place several arguments in the second part.

Sample output

\documentclass{moderncv}

\moderncvstyle{classic}

\name{John}{Doe}

\address{street and number}{postcode city\makenewline
county\makenewline country} 

\begin{document}

\makecvtitle

\end{document}
0

You must log in to answer this question.

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