修改 moderncv 中的标题/头部(\moderncvstyle{classic})

修改 moderncv 中的标题/头部(\moderncvstyle{classic})

你好,我使用 moderncv 生成了以下输出: 在此处输入图片描述

但我想要以下内容:

在此处输入图片描述

您能否告诉我我可以修改代码中的哪些部分?否则,您能否提出另一种解决方案来实现所需的布局?

\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass[11pt,a4paper,sans]{moderncv} 
\moderncvstyle{classic}
\moderncvcolor{blue2} 
\usepackage{etoolbox} 
\usepackage[scale=0.8]{geometry}

\usepackage{selinput}
\SelectInputMappings{%
  adieresis={ä},
  eacute={é},
  Lcaron={Ľ},
}

\usepackage[symbol,bottom]{footmisc}



\makeatletter
\renewcommand*{\makecvtitle}{
\recomputecvlengths
\def\phonesdetails{}
\collectionloop{phones}{
\protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}
\def\socialsdetails{}
\collectionloop{socials}{
\protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}
\newbox{\makecvtitledetailsbox}
\savebox{\makecvtitledetailsbox}{
\addressfont\color{color2}
\begin{tabular}{p{0.25\linewidth}p{0.25\linewidth}}
\ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet
& 
\phonesdetails 
\\
\ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}
&   
\ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}
\\
\ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}
&\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}
 \socialsdetails
 \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}
\end{tabular}}
\newbox{\makecvtitlepicturebox}
\savebox{\makecvtitlepicturebox}{
\ifthenelse{\isundefined{\@photo}}
 {
    \@initializelength{\makecvtitlepicturewidth}
    \settowidth{\makecvtitlepicturewidth}{0pt}
  }
  {
   \setlength\fboxrule{\@photoframewidth}
   \ifdim\@photoframewidth=0pt
     \setlength{\fboxsep}{0pt}\fi
   {\color{color1}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}
    \@initializelength{\makecvtitlepicturewidth}
    \settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}
  }
{\raggedright\namefont{\color{color2!50}\@firstname} {\color{color2}\@lastname}}
\\[-.35em]
\ifthenelse{\equal{\@title}{}}{}{\\[1em]\null\hfill\titlestyle{\@title}}\\[0.5em]
\usebox{\makecvtitledetailsbox}
\hfill\usebox{\makecvtitlepicturebox}
    \parbox[b]{\textwidth-\makecvtitlepicturewidth}{}
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\null\hfill\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\hfill\null\\[2.5em]}}%
\par}%
\makeatother


\title{super mega manager of all R\&D departments, with many years of experience in e-commerce, administration and HR}
\name{John}{Doe}
\address{Street St., 167}{8888 Town}{Country}
\phone{+1~(234)~567~890}
\email{[email protected]}  
\social[linkedin][www.linkedin.com/in/marc.zuck/]{marc the manager} 
\photo[150pt][0pt]{pictures/picture} 



\let\originalrecomputecvlengths\recomputecvlengths
\renewcommand*{\recomputecvlengths}{
\originalrecomputecvlengths
\setlength{\quotewidth}{0.8\textwidth}}

\usepackage{ragged2e} 
\renewcommand*{\quotefont}{\large\slshape\justifying}
\renewcommand{\quotestyle}[1]{\quotefont\color{color1}#1}

\quote{this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote}

\begin{document}

\makecvtitle % Print the CV title

\end{document}

有谁能帮忙吗?

答案1

这种方法使用小页面来组织标题元素。

A

% !TeX TS-program = pdflatex

\PassOptionsToPackage{dvipsnames}{xcolor}
\documentclass[11pt,a4paper,sans]{moderncv} 
\moderncvstyle{classic}
\moderncvcolor{blue} 

\usepackage[scale=0.8]{geometry}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage{ragged2e} 

\usepackage{showframe} % show margin <<<<<<<<<<<<<<<<<<<<<

\makeatletter
\renewcommand*{\makecvhead}{% changed <<<<<<<<<<<<<<<<<<<<<<
    \recomputecvlengths
    \def\phonesdetails{}
    \collectionloop{phones}{
    \protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}
    \def\socialsdetails{}
    \collectionloop{socials}{
    \protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}
    \newlength{\leftside}
    \setlength{\leftside}{0.95\textwidth-\@photowidth}
    \begin{minipage}{\leftside}{%
        \raggedright\namefont{\color{color2!50}\@firstname} {\color{color2}\@lastname}}
        \vspace*{2em}\\
        \titlestyle{\@title}
        \vspace*{2em}\\ 
        \addressfont\color{color2}
        \begin{tabular}{p{0.5\leftside}p{0.45\leftside}}
            \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet
            & 
            \phonesdetails 
            \\
            \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}
            &   
            \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}
            \\
            \ifthenelse{\equal{\@addresscountry}{}}{}{\makenewline\@addresscountry}}
            &\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}
            \socialsdetails
            \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}
        \end{tabular}           
    \end{minipage}\hfill
    \begin{minipage}{%
            \@photowidth}{\includegraphics[width=\@photowidth]{\@photo}}
    \end{minipage}\vspace*{2em}\\
    \ifthenelse{\isundefined{\@quote}}%
        {}%
        {\begin{minipage}{%
                \quotewidth}\centering\quotestyle{\@quote}
        \end{minipage}\vspace*{2em}\\
        }%
}% end makecvhead
\makeatother

\title{super mega manager of all R\&D departments, with many years of experience in e-commerce, administration and HR}
\name{John}{Doe}
\address{Street St., 167}{8888 Town}{Country}
\phone{+1~(234)~567~890}
\email{[email protected]}  
\social[linkedin][www.linkedin.com/in/marc.zuck/]{marc the manager} 
\photo[150pt][0pt]{picture} 

\renewcommand*{\recomputecvheadlengths}{%
\setlength{\quotewidth}{0.8\textwidth}}
\renewcommand*{\quotefont}{\large\slshape\justifying}
\renewcommand{\quotestyle}[1]{\quotefont\color{color1}#1}

\quote{This is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote, this is a very long quote}


\begin{document}    

\makecvtitle

Some other text

\end{document}

如果没有照片,请使用\photo[0pt][0pt]{picture}

相关内容