更改 modernCV、oldstyle 中的职位个人信息

更改 modernCV、oldstyle 中的职位个人信息

我正在尝试用 LaTeX 制作带有类的简历moderncv。经过几天的搜索,我终于找到了一个我喜欢的模板,但是有一个问题我尝试了两天都没能解决。如果有人能帮助我,我将不胜感激。

求职信的右侧和简历的左侧有一个定义的列,属于一些个人信息,如姓名,地址,电子邮件等,如您在屏幕截图中看到的那样

屏幕截图 1(求职信): https://ibb.co/m8wqc7 截图 2(简历): https://ibb.co/gcvix7

我不想有这个列,所以将其宽度设置为零,但你可以想象,情况变得越来越糟。

有什么办法可以将此信息的位置更改为求职信页面的顶部,请参阅此屏幕截图:https://ibb.co/iiLQc7

并删除简历中的信息部分,并在一个部分中正常定义它们:参见截图:https://ibb.co/bF0Qc7

这是我使用的 LATEX 代码:

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


\moderncvstyle{oldstyle} 
\moderncvcolor{blue} 
\usepackage[utf8]{inputenc} 
\usepackage[ngerman]{babel} 
\usepackage[scale=0.75]{geometry} 
\setlength{\hintscolumnwidth}{5cm} 

% personal data 
\name{Peter}{Bode} 
\title{M.Sc.} 
\address{Glücksstr. 13}{55444 Glücksdorf}{Deutschland \medskip}
\phone[mobile]{+49~(176)~111~2222} 
\email{[email protected]} 
\photo[3,0cm][0.2pt]{image.jpg}
%-------------------------------------------------------------------- 
% content 
%------------------------------------------------------------------- 
\begin{document} 

% cover letter............. 

 \recipient{Max Mustermann AG}{Personalwesen \\ Hans-Beispiel-Straße 2 \\ 55555 Beispielhausen} 

\date{\today} 
\opening{Sehr geehrter Damen und Herren,} 
\closing{Mit freundlichen Grüßen, \vspace{0,3cm} \\ 
%\includegraphics[width=4.5cm]{image.png}  
\vspace{-2,0cm}} 
%\enclosure[Anhänge]{Lebenslauf, Zeugnisse} % use an optional argument to  use a string other than "Enclosure", or redefine \enclname 
\makelettertitle 

Texts in cover letter!!!


\bigskip 


\makeletterclosing 


% CV...................... 
\newpage

\makecvtitle 

\section{Ausbildung} 
\cventry{10/04--05/05}{Master}{Karl Tux Institut für Technologie}{}{\textit{Note: 1,1}}{Pinguinkunde, Hauptfächer Prokrastination und Bummelei I, Celebrare maximus und systematische Zeitverschwendung.} 

\cventry{10/96--07/02}{Abitur}{Hans Pinguin Gymnasium}{Tuxdorf}{\textit{Note: "`sehr gut"'}}{Allgemeine Hochschulreife, Technisches Gymnasium} 

\section{Masterarbeit} 
\cvitem{Thema}{\emph{Pressures Produced When Penguins Pooh -- Calculations on Avian Defaecation", Note: 1,0}} 
\cvitem{Betreuer}{Prof. Dr. Tom Tux, Dipl.-Ing. Tina Tinker} 
\cvitem{Abstrakt}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.} 

\section{Bachelorarbeit} 
\cvitem{Thema}{\emph{Untersuchung der Gleitfähigkeit von Bananenschalen, Note: 1,5}} 
\cvitem{Betreuer}{Prof. Dr. Andreas Code, Dipl.-Ing. Johan Github} 


\newpage 

\section{Berufserfahrung} 


\section{Praktika} 


\section{Soziales Engagement} 


\section{Sprachen} 
\cvitemwithcomment{Deutsch}{Muttersprache}{} 
\cvitemwithcomment{Englisch}{Verhandlungssicher}{} 
\cvitemwithcomment{Spanisch}{Gute Kenntnisse}{} 
\cvitemwithcomment{Portugisisch}{Grundkenntnisse}{} 

\section{EDV} 
\cvdoubleitem{Betriebssysteme}{Windows, Linux}{Programmieren}{Java, C, Python} 
\cvdoubleitem{Office}{Microsoft Office, LibreOffice}{CAD}{SolidWorks} 
\cvdoubleitem{Mathematik}{OriginPro, Maple}{Textsatz}{\LaTeX} 

\section{Referenzen} 
\cvitem{Prof. Dr.-Ing. habil. Tom Tuxer}{Fraunhofer Institut für Pinguinkunde, [email protected], (098)~7654~321} 

\nocite{*} 
\bibliographystyle{plain} 
\bibliography{publications} % 'publications' is the name of a BibTeX file 


\clearpage 

\end{document} 

答案1

使用您所使用的oldstyleclass样式moderncv(版本 2.0.0),您需要重新定义这两个命令\makeletterhead\makecvhead获得您想要的内容。

在命令中\makeletterhead你需要将详细信息上移,例如:

\renewcommand*{\makeletterhead}{%
  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  \leftskip=0pt% needs to be set before \recomputeletterlengths
  \recomputeletterlengths%
  % sender contact info
  \if@details% % <======================================================
    \hspace{0pt}%
    \marginpar{%
      \addressfont\textcolor{color2}{%
        {\bfseries\@firstname~\@lastname}\@firstdetailselementfalse%
        \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\hbox to 1.0em{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}%
        \ifthenelse{\isundefined{\@email}}{}{\makenewline\hbox to 1.0em{\emailsymbol}~\emaillink{\@email}}%
        \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~\httplink{\@homepage}}%
        \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
          \makenewline\hbox to 1.0em{\csname\collectionloopkey socialsymbol\endcsname}~\collectionloopitem}%
        \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}}%
    % ensure no extra spacing after \makelettertitle due to a possible blank line
    %\ignorespacesafterend% not working
    \par\vspace{-\baselineskip}\vspace{-\parskip}\fi
  % recipient block
  {\addressfont%
    {\bfseries\upshape\@recipientname}\\%
    \@recipientaddress}\\[1em]%
  % date
  \@date\\[2em]%
  % opening
  \@opening\\[1.5em]%
  }

在命令中,\makecvhead您可以简单地注释掉详细信息并添加您自己的所需内容\section

\renewcommand*{\makecvhead}{
  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  \recomputecvlengths%
  % optional picture box
  \newbox{\makecvheadpicturebox}%
  \savebox{\makecvheadpicturebox}{%
    \ifthenelse{\isundefined{\@photo}}%
    {}%
    {%
      \color{color1}%
      \setlength\fboxrule{\@photoframewidth}%
      \ifdim\@photoframewidth=0pt%
        \setlength{\fboxsep}{0pt}\fi%
      \framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
  % name and optional title
  \newlength{\makecvheadpicturewidth}\settowidth{\makecvheadpicturewidth}{\usebox{\makecvheadpicturebox}}%
  \newlength{\makecvheadnamewidth}\setlength{\makecvheadnamewidth}{\textwidth-\makecvheadpicturewidth}%
  \begin{minipage}[b]{\makecvheadnamewidth}%
    \namestyle{\@firstname\ \@lastname}%
    \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
  \end{minipage}%
  % optional photo
  \usebox{\makecvheadpicturebox}\\[2.5em]%
  % optional quote
  \ifthenelse{\isundefined{\@quote}}%
    {}%
    {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
  % optional details
  %\if@details%
    %\makecvheadinfo{%
      %\addressfont\color{color2}%
      %\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\hbox to 1.0em{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}%
      %\ifthenelse{\isundefined{\@email}}{}{\makenewline\hbox to 1.0em{\emailsymbol}~\emaillink{\@email}}%
      %\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~\httplink{\@homepage}}%
      %\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
        %\makenewline\hbox to 1.0em{\csname\collectionloopkey socialsymbol\endcsname}~\collectionloopitem}%
      %\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi
      }

因此,有了完整的 MWE

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

\moderncvstyle{oldstyle} 
\moderncvcolor{blue} 

\usepackage[utf8]{inputenc} 
\usepackage[ngerman]{babel} 
\usepackage[scale=0.75]{geometry} 
\setlength{\hintscolumnwidth}{5cm} 

\usepackage{blindtext}

\makeatletter % <=======================================================
\renewcommand*{\makeletterhead}{%
  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  \leftskip=0pt% needs to be set before \recomputeletterlengths
  \recomputeletterlengths%
  % sender contact info
  \if@details% % <======================================================
    \hspace{0pt}%
    \marginpar{%
      \addressfont\textcolor{color2}{%
        {\bfseries\@firstname~\@lastname}\@firstdetailselementfalse%
        \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\hbox to 1.0em{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}%
        \ifthenelse{\isundefined{\@email}}{}{\makenewline\hbox to 1.0em{\emailsymbol}~\emaillink{\@email}}%
        \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~\httplink{\@homepage}}%
        \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
          \makenewline\hbox to 1.0em{\csname\collectionloopkey socialsymbol\endcsname}~\collectionloopitem}%
        \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}}%
    % ensure no extra spacing after \makelettertitle due to a possible blank line
    %\ignorespacesafterend% not working
    \par\vspace{-\baselineskip}\vspace{-\parskip}\fi
  % recipient block
  {\addressfont%
    {\bfseries\upshape\@recipientname}\\%
    \@recipientaddress}\\[1em]%
  % date
  \@date\\[2em]%
  % opening
  \@opening\\[1.5em]%
  }


\renewcommand*{\makecvhead}{
  % recompute lengths (in case we are switching from letter to resume, or vice versa)
  \recomputecvlengths%
  % optional picture box
  \newbox{\makecvheadpicturebox}%
  \savebox{\makecvheadpicturebox}{%
    \ifthenelse{\isundefined{\@photo}}%
    {}%
    {%
      \color{color1}%
      \setlength\fboxrule{\@photoframewidth}%
      \ifdim\@photoframewidth=0pt%
        \setlength{\fboxsep}{0pt}\fi%
      \framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
  % name and optional title
  \newlength{\makecvheadpicturewidth}\settowidth{\makecvheadpicturewidth}{\usebox{\makecvheadpicturebox}}%
  \newlength{\makecvheadnamewidth}\setlength{\makecvheadnamewidth}{\textwidth-\makecvheadpicturewidth}%
  \begin{minipage}[b]{\makecvheadnamewidth}%
    \namestyle{\@firstname\ \@lastname}%
    \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
  \end{minipage}%
  % optional photo
  \usebox{\makecvheadpicturebox}\\[2.5em]%
  % optional quote
  \ifthenelse{\isundefined{\@quote}}%
    {}%
    {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
  % optional details
  %\if@details%
    %\makecvheadinfo{%
      %\addressfont\color{color2}%
      %\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\hbox to 1.0em{\csname\collectionloopkey phonesymbol\endcsname}~\collectionloopitem}%
      %\ifthenelse{\isundefined{\@email}}{}{\makenewline\hbox to 1.0em{\emailsymbol}~\emaillink{\@email}}%
      %\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\hbox to 1.0em{\homepagesymbol}~\httplink{\@homepage}}%
      %\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
        %\makenewline\hbox to 1.0em{\csname\collectionloopkey socialsymbol\endcsname}~\collectionloopitem}%
      %\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi
      }
\makeatother



% personal data 
\name{Peter}{Bode} 
\title{M.Sc.} 
\address{Glücksstr. 13}{55444 Glücksdorf}{Deutschland \medskip}
\phone[mobile]{+49~(176)~111~2222} 
\email{[email protected]} 
\photo[3.0cm][0.2pt]{example-image}
%-------------------------------------------------------------------- 
% content 
%------------------------------------------------------------------- 
\begin{document} 

% cover letter............. 

 \recipient{Max Mustermann AG}{Personalwesen \\ Hans-Beispiel-Straße 2 \\ 55555 Beispielhausen} 

\date{\today} 
\opening{Sehr geehrter Damen und Herren,} 
\closing{Mit freundlichen Grüßen, \vspace{0,3cm} \\ 
%\includegraphics[width=4.5cm]{image.png}  
\vspace{-2,0cm}} 
%\enclosure[Anhänge]{Lebenslauf, Zeugnisse} % use an optional argument to  use a string other than "Enclosure", or redefine \enclname 
\makelettertitle 

\blindtext


\bigskip 


\makeletterclosing 


% CV...................... 
\newpage

\makecvtitle 

\section{Persönliche Daten} % <=========================================
\cvitem{Adresse}{Glücksstr. 13, 55444 Glücksdorf}
\makeatletter
\ifthenelse{\isundefined{\@email}}{}{\cvitem{\emailsymbol}{\emaillink{\@email}}}
\makeatother

\section{Ausbildung} 
\cventry{10/04--05/05}{Master}{Karl Tux Institut für Technologie}{}{\textit{Note: 1,1}}{Pinguinkunde, Hauptfächer Prokrastination und Bummelei I, Celebrare maximus und systematische Zeitverschwendung.} 

\cventry{10/96--07/02}{Abitur}{Hans Pinguin Gymnasium}{Tuxdorf}{\textit{Note: "`sehr gut"'}}{Allgemeine Hochschulreife, Technisches Gymnasium} 

\section{Masterarbeit} 
\cvitem{Thema}{\emph{Pressures Produced When Penguins Pooh -- Calculations on Avian Defaecation", Note: 1,0}} 
\cvitem{Betreuer}{Prof. Dr. Tom Tux, Dipl.-Ing. Tina Tinker} 
\cvitem{Abstrakt}{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.} 

\section{Bachelorarbeit} 
\cvitem{Thema}{\emph{Untersuchung der Gleitfähigkeit von Bananenschalen, Note: 1,5}} 
\cvitem{Betreuer}{Prof. Dr. Andreas Code, Dipl.-Ing. Johan Github} 


\newpage 

\section{Berufserfahrung} 


\section{Praktika} 


\section{Soziales Engagement} 


\section{Sprachen} 
\cvitemwithcomment{Deutsch}{Muttersprache}{} 
\cvitemwithcomment{Englisch}{Verhandlungssicher}{} 
\cvitemwithcomment{Spanisch}{Gute Kenntnisse}{} 
\cvitemwithcomment{Portugisisch}{Grundkenntnisse}{} 

\section{EDV} 
\cvdoubleitem{Betriebssysteme}{Windows, Linux}{Programmieren}{Java, C, Python} 
\cvdoubleitem{Office}{Microsoft Office, LibreOffice}{CAD}{SolidWorks} 
\cvdoubleitem{Mathematik}{OriginPro, Maple}{Textsatz}{\LaTeX} 

\section{Referenzen} 
\cvitem{Prof. Dr.-Ing. habil. Tom Tuxer}{Fraunhofer Institut für Pinguinkunde, [email protected], (098)~7654~321} 

%\nocite{*} 
%\bibliographystyle{plain} 
%\bibliography{publications} % 'publications' is the name of a BibTeX file 


\clearpage 

\end{document} 

您将获得以下结果页面:

letter page

cv page

相关内容