如何以经典风格将个人信息放在 moderncv 标题左侧

如何以经典风格将个人信息放在 moderncv 标题左侧

moderncv我找到了如何使用和样式自定义我的简历classic,但我找不到如何将我的名字放在稍高一点的位置,并将我的个人信息放在左边,就在我的名字下面,因为除了照片,我不喜欢它。如果标题可以放在页眉的中间就太好了。

要修改的标题...

感谢您的帮助,不想回到 Word,在 LaTeX 中做这件事非常有趣。

@Gonzalo Medina:好的,这就是我想要的:)你是最棒的,谢谢你,现在如果我想减少姓名和信息之间的间距,我该怎么做?:

在此处输入图片描述

@Gonzalo Medina:好的,这是我的 .tex 文件的开头:

\documentclass[10pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}                
\usepackage[applemac] {inputenc}
\usepackage[french] {babel} 
\usepackage[scale=0.9]{geometry}

\photo[100pt]{Photo_cv.jpg}
\firstname{NAME}
\familyname{NAME}
\title{}
\address{ADRESS}{ZIP CODE CITY}    
\mobile{NUMBER}                    
\email{Email}            
\extrainfo{birthdate\\ Nationality- driving license}

\begin{document}
\maketitle

真的非常感谢。

编辑 18/12 : @Gonzalo Medina:嗨,谢谢你的回答,现在好多了,虽然还有一点空间,但已经变小了。标题只是个问题,在我的文件中,如果我在 \title{} 中输入标题,就会出现错误(见下面的错误图片),但如果我让它为空,它就可以正常工作……不明白为什么,也许是字体问题,就像错误所说的那样。

问题

我认为这是 .sty 文件中的这一行,它给出了这个错误:“\renewcommand*{\titlestyle}1{{\titlefont\text{color2}{#1}}}"

答案1

这是一种可能性,重新定义\makecvtitle如下moderncvstyleclassic.sty

\documentclass{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}

\makeatletter
\renewcommand*{\makecvtitle}{%
  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  \recomputecvlengths%
  % optional detailed information box
  \newbox{\makecvtitledetailsbox}%
  \savebox{\makecvtitledetailsbox}{%
    \addressfont\color{color2}%
    \begin{tabular}[b]{@{}p{10cm}@{}}%
      \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet %
        \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}} % if \addresstreet is defined, \addresscity will always be defined but could be empty
      \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}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
      \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
    \end{tabular}
  }%
  % optional photo (pre-rendering)
  \newbox{\makecvtitlepicturebox}%
  \savebox{\makecvtitlepicturebox}{%
    \ifthenelse{\isundefined{\@photo}}%
    {}%
    {%
     % \hspace*{\separatorcolumnwidth}%
      \color{color1}%
      \setlength{\fboxrule}{\@photoframewidth}%
      \ifdim\@photoframewidth=0pt%
        \setlength{\fboxsep}{0pt}\fi%
      \framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
  % name and title
  \newlength{\makecvtitledetailswidth}\settowidth{\makecvtitledetailswidth}{\usebox{\makecvtitledetailsbox}}%
  \newlength{\makecvtitlepicturewidth}\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
  \ifthenelse{\lengthtest{\makecvtitlenamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvtitlenamewidth=0pt)
    {\setlength{\makecvtitlenamewidth}{\textwidth-\makecvtitlepicturewidth
}}%
    {}%
 % \begin{minipage}[b]{\makecvtitlenamewidth}%
    \raggedright\namestyle{\@firstname\ \@familyname}\par\medskip%
    \ifthenelse{\equal{\@title}{}}{}{{\centering\titlestyle{\@title}\par}\medskip}%
  %\hfill%
  % detailed information
%  \llap{
%
\usebox{\makecvtitledetailsbox}%
%\end{minipage}\ignorespaces%
%}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvtitlenamewidth is forced
  % optional photo (rendering)
  \usebox{\makecvtitlepicturebox}\\[2.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 \makecvtitle
\makeatother

\firstname{John}
\familyname{Doe}
\firstname{John}
\familyname{Doe}
\title{Title}
\address{street and number}{postcode city}
\mobile{+1~(234)~567~890}
\phone{+2~(345)~678~901}
\fax{+3~(456)~789~012}
\email{[email protected]}
\homepage{www.johndoe.com}
\extrainfo{additional information}
\photo[64pt][0.4pt]{ctanlion}    
\quote{some optional quote}

\begin{document}

\makecvtitle
\section{Education}

\end{document}

在此处输入图片描述

对原始问题进行编辑后,出现了一个新的变体:

\documentclass[10pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}                
\usepackage[applemac] {inputenc}
\usepackage[french] {babel} 
\usepackage[scale=0.9]{geometry}

\makeatletter
\renewcommand*{\makecvtitle}{%
  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  \recomputecvlengths%
  % optional detailed information box
  \newbox{\makecvtitledetailsbox}%
  \savebox{\makecvtitledetailsbox}{%
    \addressfont\color{color2}%
    \begin{tabular}[b]{@{}p{10cm}@{}}%
      \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet %
        \ifthenelse{\equal{\@addresscity}{}}{}{\makenewline\@addresscity}} % if \addresstreet is defined, \addresscity will always be defined but could be empty
      \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}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
      \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}%
    \end{tabular}
  }%
  % optional photo (pre-rendering)
  \newbox{\makecvtitlepicturebox}%
  \savebox{\makecvtitlepicturebox}{%
    \ifthenelse{\isundefined{\@photo}}%
    {}%
    {%
     % \hspace*{\separatorcolumnwidth}%
      \color{color1}%
      \setlength{\fboxrule}{\@photoframewidth}%
      \ifdim\@photoframewidth=0pt%
        \setlength{\fboxsep}{0pt}\fi%
      \framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
  % name and title
  \newlength{\makecvtitledetailswidth}\settowidth{\makecvtitledetailswidth}{\usebox{\makecvtitledetailsbox}}%
  \newlength{\makecvtitlepicturewidth}\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
  \ifthenelse{\lengthtest{\makecvtitlenamewidth=0pt}}% check for dummy value (equivalent to \ifdim\makecvtitlenamewidth=0pt)
    {\setlength{\makecvtitlenamewidth}{\textwidth-\makecvtitlepicturewidth
}}%
    {}%
 % \begin{minipage}[b]{\makecvtitlenamewidth}%
    \raggedright\namestyle{\@firstname\ \@familyname}\par\medskip%
    \ifthenelse{\equal{\@title}{}}{\vskip-25pt}{{\centering\titlestyle{\@title}\par}\medskip}%
  %\hfill%
  % detailed information
%  \llap{
%
\usebox{\makecvtitledetailsbox}%
%\end{minipage}\ignorespaces%
%}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvtitlenamewidth is forced
  % optional photo (rendering)
  \usebox{\makecvtitlepicturebox}\\[2.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 \makecvtitle
\makeatother

\photo[100pt]{ctanlion}
\firstname{NAME}
\familyname{NAME}
\address{ADRESS}{ZIP CODE CITY}    
\mobile{NUMBER}                    
\email{Email}            
\extrainfo{birthdate\\ Nationality- driving license}

\begin{document}
\maketitle
\end{document}

我更改了我的其中一张图片文件所用图片的名称(由 Duane Bibby 绘制的 CTAN 狮子图)。

相关内容