我正在尝试根据moderncv
以下链接中给出的一些基本设计()在乳胶中创建我的简历:
关联
如何创建带有banking
标题样式和classic
正文样式的简历?
我从以下内容复制moderncvstylebanking.sty
并放在\begin{document}
\makeatletter
% symbols
\renewcommand*{\mobilesymbol}{\marvosymbol{72}~}
\renewcommand*{\phonesymbol}{\marvosymbol{84}~}
\renewcommand*{\faxsymbol}{\marvosymbol{117}~}
\renewcommand*{\emailsymbol}{\marvosymbol{66}~}
\renewcommand*{\homepagesymbol}{{\Large\marvosymbol{205}}~}
% commands
\newcommand*{\maketitlesymbol}{%
{~~~{\rmfamily\textbullet}~~~}}% the \rmfamily is required to force Latin Modern fonts when using sans serif, as OMS/lmss/m/n is not defined and gets substituted by OMS/cmsy/m/n
% internal command to add an element to the footer
% it collects the elements in a temporary box, and checks when to flush the box
\newsavebox{\maketitlebox}%
\newsavebox{\maketitletempbox}%
\newlength{\maketitlewidth}%
\newlength{\maketitleboxwidth}%
\newif\if@firstmaketitleelement\@firstmaketitleelementtrue%
% adds an element to the maketitle, separated by maketitlesymbol
% usage: \addtomaketitle[maketitlesymbol]{element}
\newcommand*{\addtomaketitle}[2][\maketitlesymbol]{%
\if@firstmaketitleelement%
\savebox{\maketitletempbox}{\usebox{\maketitlebox}#2}%
\else%
\savebox{\maketitletempbox}{\usebox{\maketitlebox}#1#2}\fi%
\settowidth{\maketitleboxwidth}{\usebox{\maketitletempbox}}%
\ifnum\maketitleboxwidth<\maketitlewidth%
\savebox{\maketitlebox}{\usebox{\maketitletempbox}}%
\@firstmaketitleelementfalse%
\else%
\flushmaketitle{}\\%
\savebox{\maketitlebox}{#2}%
\savebox{\maketitletempbox}{#2}%
\settowidth{\maketitleboxwidth}{\usebox{\maketitlebox}}%
\@firstmaketitleelementfalse\fi}
% internal command to flush the maketitle
\newcommand*{\flushmaketitle}{%
\strut\usebox{\maketitlebox}%
\savebox{\maketitlebox}{}%
\savebox{\maketitletempbox}{}%
\setlength{\maketitleboxwidth}{0pt}}
\renewcommand*{\maketitle}{%
\setlength{\maketitlewidth}{0.8\textwidth}%
\hfil%
\parbox{\maketitlewidth}{%
\centering%
% name and title
\namestyle{\@firstname~\@familyname}%
\ifthenelse{\isundefined{\@title}}{}{\titlestyle{~|~\@title}}\\%
% detailed information
\addressfont\color{color2}%
\ifthenelse{\isundefined{\@addressstreet}}{} {\addtomaketitle{\addresssymbol\@addressstreet}%
\ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~] {\@addresscity}}\flushmaketitle\@firstmaketitleelementtrue\\}% if \addresstreet is defined, \addresscity will always be defined but could be empty
\ifthenelse{\isundefined{\@mobile}}{} {\addtomaketitle{\mobilesymbol\@mobile}}%
\ifthenelse{\isundefined{\@phone}}{} {\addtomaketitle{\phonesymbol\@phone}}%
\ifthenelse{\isundefined{\@fax}}{}{\addtomaketitle{\faxsymbol\@fax}}%
\ifthenelse{\isundefined{\@email}}{} {\addtomaketitle{\emailsymbol\emaillink{\@email}}}%
\ifthenelse{\isundefined{\@homepage}}{}{%
\ifthenelse{\equal{\@homepagetitle}{}}% \homepagetitle could be empty
{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}%
{\addtomaketitle{\homepagesymbol\httplink[\@homepagetitle] {\@homepage}}}}%
\ifthenelse{\isundefined{\@extrainfo}}{} {\addtomaketitle{\@extrainfo}}%
\flushmaketitle}\\[2.5em]}% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \maketitle
%-------------------------------------------------------------------------------
% resume style definition
%-------------------------------------------------------------------------------
% fonts
\renewcommand*{\namefont}{\Huge\bfseries\upshape}
\renewcommand*{\titlefont}{\Huge\mdseries\upshape}
\renewcommand*{\addressfont}{\normalsize\mdseries\upshape}
\renewcommand*{\quotefont}{\large\slshape}
\renewcommand*{\sectionfont}{\Large\bfseries\upshape}
\renewcommand*{\subsectionfont}{\large\upshape\fontseries{sb}\selectfont}
\renewcommand*{\hintfont}{\bfseries}
% styles
\renewcommand*{\namestyle}[1]{{\namefont\textcolor{color1}{#1}}}
\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2!85}{#1}}}
\renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color1}{#1}}}
\renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}}
\renewcommand*{\sectionstyle}[1]{{\sectionfont\textcolor{color1}{#1}}}
\renewcommand*{\subsectionstyle}[1]{{\subsectionfont\textcolor{color1}{#1}}}
\renewcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}}
% lengths
\newlength{\quotewidth}
\newlength{\hintscolumnwidth}
\setlength{\hintscolumnwidth}{0.3\textwidth}%
\newlength{\separatorcolumnwidth}
\setlength{\separatorcolumnwidth}{0.025\textwidth}%
\newlength{\maincolumnwidth}
\newlength{\doubleitemcolumnwidth}
\newlength{\listitemsymbolwidth}
\settowidth{\listitemsymbolwidth}{\listitemsymbol}
\newlength{\listitemmaincolumnwidth}
\newlength{\listdoubleitemmaincolumnwidth}
% commands
\renewcommand*{\recomputecvlengths}{%
\setlength{\quotewidth}{0.65\textwidth}%
% main lenghts
\setlength{\maincolumnwidth}{\textwidth}%
% listitem lengths
\setlength{\listitemmaincolumnwidth}{\maincolumnwidth- \listitemsymbolwidth}%
% doubleitem lengths
\setlength{\doubleitemcolumnwidth}{\maincolumnwidth- \separatorcolumnwidth}%
\setlength{\doubleitemcolumnwidth}{0.5\doubleitemcolumnwidth}%
% listdoubleitem lengths
\setlength{\listdoubleitemmaincolumnwidth}{\maincolumnwidth- \listitemsymbolwidth-\separatorcolumnwidth-\listitemsymbolwidth}%
\setlength{\listdoubleitemmaincolumnwidth} {0.5\listdoubleitemmaincolumnwidth}%
% fancyhdr lengths
\renewcommand{\headwidth}{\textwidth}%
% regular lengths
\setlength{\parskip}{0\p@}}
\renewcommand*{\makecvtitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
\maketitle%
% 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 \maketitle}
\makeatother
出现以下错误:
! LaTeX Error: Command \quotewidth already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.96 \newlength{\quotewidth}
?
! LaTeX Error: Command \hintscolumnwidth already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.97 \newlength{\hintscolumnwidth}
?
! LaTeX Error: Command \separatorcolumnwidth already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.99 \newlength{\separatorcolumnwidth}
?
! LaTeX Error: Command \maincolumnwidth already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.101 \newlength{\maincolumnwidth}
?
! LaTeX Error: Command \listitemsymbolwidth already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.103 \newlength{\listitemsymbolwidth}
?
! LaTeX Error: Command \listitemmaincolumnwidth already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.105 \newlength{\listitemmaincolumnwidth}
?
! LaTeX Error: Command \listdoubleitemmaincolumnwidth already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.106 \newlength{\listdoubleitemmaincolumnwidth}
?
答案1
Classmoderncv
在单独的文件中定义几种样式sty
。您有两种可能性:
- 创建新样式并将其包含在 moderncv 中。这并不容易,因为您必须更改大量文件来构建类
moderncv
。方法二更简单。 - 更改现有样式之一(通常不使用的样式),并将破解
sty
文件添加到您的 cv 文件所在的同一目录中mwe-moderncv.tex
。但请注意:这是一个肮脏的破解!
第三种可能性是使用内置样式,例如mystyle.sty
,这样人们就可以根据需要更改样式。我想我会建议的作者moderncv
这样做。
我决定使用方法 2,因此我更改oldstyle
了moderncv
。:
有了这两条线
\moderncvhead{3}
\moderncvbody{1}
我们定义我们想要 (1. 行) 银行风格标题和 (2. 行) 经典正文,采用黑客风格。因此,我们得到了完整的黑客版本
破解版本moderncvstyleoldstyle.sty
(与您的简历位于同一目录):
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{moderncvstyleoldstyle}[2015/07/28 v2.0.0 modern curriculum vitae and letter style scheme: oldstyle hacked by John]
\DeclareOption*{}%
%\ExecuteOptions{mixedrules,left}
\ProcessOptions*\relax%
%-------------------------------------------------------------------------------
% fonts & icons
%-------------------------------------------------------------------------------
% TeX Gyre Pagella font
\IfFileExists{tgpagella.sty}%
{%
\RequirePackage{tgpagella}%
\renewcommand*{\familydefault}{\rmdefault}}%
{}
% symbols
\moderncvicons{marvosym} % marvosym awesome
%-------------------------------------------------------------------------------
% header, body & footer
%-------------------------------------------------------------------------------
\moderncvhead{3} % <====================================================
\moderncvbody{1} % <====================================================
\endinput
现在我们可以使用破解的sty
文件来创建我们mwe-moderncv.tex
想要的简历:
\listfiles % to check easy the used versions
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{oldstyle} % <============== hacked version!!!!!!!!!!!!!!!
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
%\setlength{\hintscolumnwidth}{3cm}
% 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]{example-image-a}
\quote{Some quote}
\setlength{\footskip}{66pt}
\begin{document}
\makecvtitle
\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description} % arguments 3 to 6 can be left empty
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}
\end{document}
请检查结果日志文件,在日志文件末尾可以看到已使用的软件包和版本的列表,其中包含
moderncvstyleoldstyle.sty 2015/07/28 v2.0.0 modern curriculum vitae and letter style scheme: oldstyle hacked by John
然后破解版(你看被 John 入侵?) 被使用并且你应该看到以下结果:
答案2
事实证明
\moderncvstyle{classic}
\moderncvheader{3}
尝试实现银行标头 + 经典主体不起作用。但是
\moderncvstyle{banking}
\moderncvbody{1} % classic body
运行完美,满足您的需求。以下是 MWE:
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{banking}
\moderncvbody{1} % classic body
\name{John}{Doe}
\title{The 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}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}
\end{document}