I'm looking to change the width of the \title
environment in the moderncv
template.
As it is now, the maximum width of the title under my name goes all the way to the "address"/information box on the right.
I'm looking to change the width of the \title
environment in the moderncv
template.
As it is now, the maximum width of the title under my name goes all the way to the "address"/information box on the right.
The "header" (or title) under the classic
moderncv
style is comprised of three components: name, details, picture
Each are set in a box, but the width of the name box is calculated to fit exactly within the remaining text block if no other width is specified. So, unfortunately, there's no easy way to specify the gap between these boxes. Some options exist though:
The following patch (with the aid of etoolbox
) of \makecvtitle
allows you to specify a length \namedetailsgap
. Add this to your moderncv
preamble:
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\patchcmd{\makecvtitle}% <cmd>
{\textwidth}% <search>
{\textwidth-\namedetailsgap}% <replace>
{}{}% <success><failure>
\newlength{\namedetailsgap}\setlength{\namedetailsgap}{50pt}% Specify gap
For example, the above patch changes this:
into this:
(For better line-spacing of multi-line titles, use \title{<title>\endgraf}
.)
Set the \title
using \parbox[b]{\linewidth-<len>}{<title>}
where you specify the length <len>
. For example, output similar to the above is obtained via
\title{\parbox[b]{\linewidth-50pt}{<title>}}
(No need for \endgraf
or \par
here, since \parbox
does this automatically.)
Manually fiddle around with the length \makecvtitlenamewidth
. As stated in the example template.tex
,
...for the
classic
style, if you want to force the width allocated to your name and avoid line breaks. Be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...
The default is 0pt
, which implies an automatic calculation of the required width to fit within the remainder of \textwidth
after the details and picture boxes have been set.
Ah! I just found a way to limit the size of it in the ugly way.
Just take the line which is broades in the address/information field and write
\phantom{....}
in front of it. This "pushes" the title to the left. :-)
So my broadest field in the address field is \extrainfo, so I just put...
\extrainfo{\phantom{....}The extra information on me that was the broadest line in the information part}
...until I was happy with the subtitle lenght.