moderncv-Klasse: Einrückung im Adressabschnitt verhindern, nachdem dieser linksbündig ausgerichtet wurde

moderncv-Klasse: Einrückung im Adressabschnitt verhindern, nachdem dieser linksbündig ausgerichtet wurde

Ich verwende die moderncv-Klasse (http://www.ctan.org/pkg/moderncv), um meinen Lebenslauf zu schreiben. Um den Adressabschnitt zu ändern, habe ich moderncvstyleclassic.sty geändert.

Ich möchte den Text des Adressabschnitts linksbündig ausrichten (was funktioniert hat), habe jetzt aber das Problem, dass die erste Zeile der Adresse (addressstreet) eingerückt ist.

Meine Frage ist: Wie verhindere ich diese Einrückung der ersten Zeile innerhalb dieser Informationsbox?

Bisher habe ich keine Lösung für dieses Problem gefunden.

Code inmoderncvstyleclassic.stymit meiner Änderung kommentiert:

%% code above omitted
      % optional detailed information box
      \newbox{\makecvtitledetailsbox}%
      \savebox{\makecvtitledetailsbox}{%
        \addressfont\color{color2}%
        \begin{tabular}[b]{@{}l@{}}%% MY MODIFICATION <<-- l for left-justified (instead of "r")
          \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\@addressstreet%\addresssymbol##
            \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}}% if \addresstreet is defined, \addresscity will always be defined but could be empty
            \ifthenelse{\isundefined{\@countryinfo}}{}{\makenewline\@countryinfo}%%##moved up to use as country
          \ifthenelse{\isundefined{\@mobile}}{}{\makenewline\mobilesymbol\@mobile}%
          \ifthenelse{\isundefined{\@phone}}{}{\makenewline\phonesymbol\@phone}%
          \ifthenelse{\isundefined{\@fax}}{}{\makenewline\faxsymbol\@fax}%
          \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
          \ifthenelse{\isundefined{\@homepage}}{}{%
        \ifthenelse{\equal{\@homepagetitle}{}}% \homepagetitle could be empty
        {\makenewline\homepagesymbol\httplink{\@homepage}}%
        {\makenewline\homepagesymbol\httplink[\@homepagetitle]{\@homepage}}}% 
          \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%##moved up to use as country
        \end{tabular}
      }% 
      %% code below omitted

Antwort1

Verwenden des \patchcmdMakros:

\makeatletter
\patchcmd{\makecvtitle}{@{}r@{}}{@{}l@{}}{}{}
\patchcmd{\makecvtitle}{\makenewline\addresssymbol\@addressstreet}{\addresssymbol\@addressstreet\makenewline}{}{}
\makeatother

nach der Stildeklaration.

Vor:

Bildbeschreibung hier eingeben

Nach:

Bildbeschreibung hier eingeben

Oder wenn Sie die .sty-Datei manuell bearbeiten möchten (was nicht empfohlen wird), ändern Sie einfach von:

\makenewline\addresssymbol\@addressstreet

Zu:

\addresssymbol\@addressstreet\makenewline

Um die Zusatzinformationen auch unter der Stadt einzufügen, verwenden Sie den folgenden Befehlssatz anstelle des vorherigen:

\makeatletter
\patchcmd{\makecvtitle}{@{}r@{}}{@{}l@{}}{}{}
\patchcmd{\makecvtitle}{\makenewline\addresssymbol\@addressstreet}{\addresssymbol\@addressstreet\makenewline}{}{}
\patchcmd{\makecvtitle}{\makenewline\@extrainfo}{}{}{}
\patchcmd{\makecvtitle}{\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}{\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}\makenewline\@extrainfo}{}{}
\makeatother

Ergebnis:

Bildbeschreibung hier eingeben

Das countryFeld ist optional, wenn Sie es addresswie folgt festlegen:

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

du hast ein Land. Ansonsten so:

\address{street and number}{postcode city}

Sie werden kein Land haben (wie in meinem letzten Bild).

Komplette MWE

  \documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}

\makeatletter
\patchcmd{\makecvtitle}{@{}r@{}}{@{}l@{}}{}{}
\patchcmd{\makecvtitle}{\makenewline\addresssymbol\@addressstreet}{\addresssymbol\@addressstreet\makenewline}{}{}
\patchcmd{\makecvtitle}{\makenewline\@extrainfo}{}{}{}
\patchcmd{\makecvtitle}{\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}{\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}\makenewline\@extrainfo}{}{}
\makeatother

\moderncvcolor{blue}
\usepackage[scale=0.75]{geometry}

% personal data
\name{John}{Doe}
\title{Resumé title}
\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}                         
\social[linkedin]{john.doe}                        
\social[twitter]{jdoe}                             
\social[github]{jdoe}                              
\extrainfo{additional information}                 
\photo[64pt][0.4pt]{picture}                       
\quote{Some quote}                                 

\begin{document}
\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\end{document}

verwandte Informationen