modernCV -- Änderungen im Header (moderncvheadi) vornehmen

Layout von Seiten, Rändern, Fusszeilen, usw, modifizieren


platzhirsch
Forum-Newbie
Forum-Newbie
Beiträge: 9
Registriert: Fr 20. Jul 2012, 00:28

modernCV -- Änderungen im Header (moderncvheadi) vornehmen

Beitrag von platzhirsch »

Hallo Zusammen,

ich versuche verzweifelt den Header für den modernCV zu ändern.

Und zwar handelt es sich um moderncvstyleclassic mit dem Header 1.

Mit dem aktuellen Header sieht es aus wie in "beispiel1". Die Details (Anschrift) scheinen an das Foto gebunden zu sein. Ich würde es gerne wie in "beispiel2" darstellen können.

Kann jemand im Code für den moderncvheadi die entsprechenden Zeilen ausfindig machen und Hinweise geben welche Änderungen notwendig sind, um das Layout wie in "beispiel2" dargestellt zu bekommen?

Ich hoffe das funktioniert mit dem Minimalbeispiel :)

Danke!
\documentclass[11pt,a4paper,sans]{moderncv}       
\moderncvstyle{classic}                            
\moderncvcolor{black}                              
\usepackage[utf8]{inputenc}  
\usepackage{graphicx}
\usepackage[scale=0.75, top=2.5cm, bottom=2.5cm]{geometry}
\setlength{\hintscolumnwidth}{3.07cm}            
\usepackage[ngerman]{babel}
\usepackage{ifsym}
\usepackage{setspace}
% personal data
\name{Vorname}{Nachname}%
\title{Titel}%
\address{\textifsymbol{18} Straße und Nr.}{PLZ Ort}{}  
\phone[mobile]{+49~(123)~456789}                   
\email{email@gmx.de}                 
\photo[156pt][2pt]{pic}  

%----------------------------------------------------------------------------------

\begin{document}
\makecvhead


\section{Studium}

\cventry{year--year}{Job title}{Employer}{City}{}{Description line 1\newline{}Description line 2}
%\subsection{Miscellaneous}

\clearpage

\end{document}


%% end of file `template.tex'. 


moderncvheadi:
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvheadi}[2015/07/28 v2.0.0 modern curriculum vitae and letter header variant: 1]

% details options: "details" (default) or "nodetails"
\@initializeif{\if@details}\@detailsfalse
\DeclareOption{details}   {\@detailstrue}
\DeclareOption{nodetails} {\@detailsfalse}

% left/right options: "left" (default) or "right"
\@initializeif{\if@left} \@leftfalse
\DeclareOption{left}    {\@lefttrue\@rightfalse}
\@initializeif{\if@right}\@rightfalse
\DeclareOption{right}   {\@leftfalse\@righttrue}

\DeclareOption*{}% avoid choking on unknown options
\ExecuteOptions{details,left}
\ProcessOptions*\relax% \ProcessOptions* processes the options in the order provided (i.e., with the later ones possibly overriding the former ones), while \ProcessOptions processes them in the order of the package


%-------------------------------------------------------------------------------
%                required packages
%-------------------------------------------------------------------------------


%-------------------------------------------------------------------------------
%                overall head definition
%-------------------------------------------------------------------------------
% fonts
\renewcommand*{\namefont}{\fontsize{32}{36}\mdseries\upshape} %
\renewcommand*{\titlefont}{\LARGE\mdseries\upshape}
\renewcommand*{\addressfont}{\small\mdseries\upshape}
\renewcommand*{\quotefont}{\large\slshape}

% styles
\renewcommand*{\namestyle}[1]{{\namefont\textcolor{color0}{#1}}}
\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2}{#1}}}
\renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color2}{#1}}}
\renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}}


%-------------------------------------------------------------------------------
%                resume head definition
%-------------------------------------------------------------------------------
% lengths
\@initializelength{\quotewidth}
% optional makecvheadname width to force a certain width (if set/remains to 0pt, the width is calculated automatically)
\@initializelength{\makecvheadnamewidth}
\renewcommand*{\recomputecvheadlengths}{%
  \setlength{\quotewidth}{0.65\textwidth}}

% commands
\renewcommand*{\makecvhead}{%
  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  \recomputecvlengths%
  % optional detailed information (pre-rendering)
  \@initializebox{\makecvheaddetailsbox}%
  \if@details%
    \def\phonesdetails{}%
    \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
      \protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
    \def\socialsdetails{}%
    \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
      \protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
    \savebox{\makecvheaddetailsbox}{%
      \addressfont\color{color2}%
      \if@left\begin{tabular}[b]{@{}r@{}}\fi%
      \if@right\begin{tabular}[b]{@{}l@{}}\fi%
        \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
          \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
          \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
        \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict
        \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
        \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
        \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict
        \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
      \end{tabular}
    }\fi%
  % optional photo (pre-rendering)
  \@initializebox{\makecvheadpicturebox}%
  \savebox{\makecvheadpicturebox}{%
    \ifthenelse{\isundefined{\@photo}}%
      {}%
      {%
        \if@left%
          \hspace*{\separatorcolumnwidth}\fi%
        \color{color1}%
        \setlength{\fboxrule}{\@photoframewidth}%
        \ifdim\@photoframewidth=0pt%
          \setlength{\fboxsep}{0pt}\fi%
        \framebox{\includegraphics[width=\@photowidth]{\@photo}}}%
        \if@right%
          \hspace*{\separatorcolumnwidth}\fi}%
  % name and title (pre-rendering)
  \@initializelength{\makecvheaddetailswidth}\settowidth{\makecvheaddetailswidth}{\usebox{\makecvheaddetailsbox}}%
  \@initializelength{\makecvheadpicturewidth}\settowidth{\makecvheadpicturewidth}{\usebox{\makecvheadpicturebox}}%
  \ifthenelse{\lengthtest{\makecvheadnamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvheadnamewidth=0pt)
    {\setlength{\makecvheadnamewidth}{\textwidth-\makecvheaddetailswidth-\makecvheadpicturewidth}}%
    {}%
  \@initializebox{\makecvheadnamebox}%
  \savebox{\makecvheadnamebox}{%
    \begin{minipage}[b]{\makecvheadnamewidth}%
      \if@left\raggedright\fi%
      \if@right\raggedleft\fi%
      \namestyle{\@firstname\ \@lastname}%
      \ifthenelse{\equal{\@title}{}}{}{\\[1.15em]\titlestyle{\@title}}%
    \end{minipage}}% [1.25em]
  % rendering
  \if@left%
    \usebox{\makecvheadnamebox}%
    \hfill%
    \llap{\usebox{\makecvheaddetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvheadnamewidth is forced
    \usebox{\makecvheadpicturebox}\fi%
  \if@right%
    \usebox{\makecvheadpicturebox}%
    \rlap{\usebox{\makecvheaddetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvheadnamewidth is forced
    \hfill%
    \usebox{\makecvheadnamebox}\fi%
  \\[3.5em]% Anfang Text [3.5em]
  % optional quote
  \ifthenelse{\isundefined{\@quote}}%
    {}%
    {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
  \par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvhead


%-------------------------------------------------------------------------------
%                letter head definition
%-------------------------------------------------------------------------------
% lengths
%\renewcommand*{\recomputeletterheadlengths}{}

% commands
\renewcommand*{\makeletterhead}{%
  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  \recomputeletterlengths%
  % sender contact info
  \hfill%
  \begin{minipage}{.5\textwidth}%
    % optional detailed information
    \if@details%
      \raggedleft%
      \addressfont\textcolor{color2}{%
        {\bfseries\upshape\@firstname~\@lastname}\@firstdetailselementfalse%
        % optional detailed information
        \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet%
          \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty
          \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}%
        \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
          \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%
        \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
        \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
        \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi%
    \end{minipage}\\[1em]
  % recipient block
  \begin{minipage}[t]{.5\textwidth}
    \raggedright%
    \addressfont%
    {\bfseries\upshape\@recipientname}\\%
    \@recipientaddress%
  \end{minipage}
  % date
  \hfill% US style
%  \\[1em]% UK style
  \@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900"
  % opening
  \raggedright%
  \@opening\\[1.5em]%
  % ensure no extra spacing after \makelettertitle due to a possible blank line
%  \ignorespacesafterend% not working
  \hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}}


\endinput


%% end of file `moderncvheadi.sty'.

moderncvstyleclassic:
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvstyleclassic}[2015/07/28 v2.0.0 modern curriculum vitae and letter style scheme: classic]

% head section alignment options: "left" (default) or "right"
\@initializecommand{\moderncvstyleheadoptions}{}
\DeclareOption{right} {\edef\moderncvstyleheadoptions{\moderncvstyleheadoptions,right}}
\DeclareOption{right}{\edef\moderncvstyleheadoptions{\moderncvstyleheadoptions,left}}

\DeclareOption*{}% avoid choking on unknown options
\ExecuteOptions{left}
\ProcessOptions*\relax% \ProcessOptions* processes the options in the order provided (i.e., with the later ones possibly overriding the former ones), while \ProcessOptions processes them in the order of the package

%-------------------------------------------------------------------------------
%                fonts & icons
%-------------------------------------------------------------------------------
% Latin Modern fonts
%\ifxetexorluatex
%  \setmainfont{Latin Modern Roman}
%  \setsansfont{Latin Modern Sans}
%  \setmathfont{Latin Modern Math}
%\else
  \IfFileExists{lmodern.sty}%
    {\RequirePackage{lmodern}}%
    {}
%\fi

% symbols
\moderncvicons{marvosym}


%-------------------------------------------------------------------------------
%                header, body & footer
%-------------------------------------------------------------------------------
\moderncvhead[\moderncvstyleheadoptions]{1}
\moderncvbody{1}


\endinput


%% end of file `moderncvstyleclassic.sty'.
Dateianhänge
Aktueller Header
Aktueller Header
beispiel1.jpg (60.12 KiB) 4216 mal betrachtet
So sollte der neue Header aussehen
So sollte der neue Header aussehen
beispiel2.jpg (60.81 KiB) 4221 mal betrachtet

Gast

Beitrag von Gast »

Ich verstehe ja nicht, warum so viele Leute diese Klasse ohne Anleitung verwenden. Aber ohne es getestet zu haben: Setze mal \makecvheadnamewidth auf eine Länge, so dass Vorname und Nachname in eine Zeile passen. Ersetze außerdem das \hfill nach \usebox{\makecvheadnamebox} durch \par.

Wie gesagt: Ungetestet und so AFAIK auch nicht dokumentiert.

Antworten