![在 moderncv 的求职信中包含签名图片吗?](https://linux22.com/image/275876/%E5%9C%A8%20moderncv%20%E7%9A%84%E6%B1%82%E8%81%8C%E4%BF%A1%E4%B8%AD%E5%8C%85%E5%90%AB%E7%AD%BE%E5%90%8D%E5%9B%BE%E7%89%87%E5%90%97%EF%BC%9F.png)
我使用 moderncv 包创建了一封求职信。我的代码是:
\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[green]{classic}
\usepackage[utf8]{inputenc}
\usepackage{floatflt}
\usepackage{fancyhdr}
\usepackage{geometry}
\geometry{a4paper,left=2cm,right=1cm, top=2cm, bottom=1.5cm,headheight=21pt}
\usepackage{tikz}
\usepackage{wrapfig}
\usepackage{lipsum}
\usepackage{footmisc}
\usepackage{xparse}
\usepackage[firstyear=1996,lastyear=2013]{moderntimeline}
% New page style
\fancypagestyle{myfancy}{
\fancyhead[L]{\parbox[t]{.3333\textwidth}{\sffamily\footnotesize
Teest\\Test}}
\fancyhead[C]{\parbox[t]{.3333\textwidth}{\fixedphonesymbol\sffamily\footnotesize 213123312}}
\fancyhead[R]{\parbox[t]{.3333\textwidth}{\emailsymbol\sffamily\footnotesize [email protected]}}
}
\makeatletter
\let\ps@plain\ps@myfancy
\let\ps@empty\ps@myfancy
\makeatother
\pagestyle{myfancy}
% Redefinitions of \makecvtitle, opening and closing to
% have the desired formatting for first and family names
\makeatletter
\renewcommand*{\makecvtitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
% optional detailed information (pre-rendering)
\def\phonesdetails{}%
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\protected@edef\phonesdetails{\phonesdetails\protect\makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
\def\socialsdetails{}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
\protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
\newbox{\makecvtitledetailsbox}%
\savebox{\makecvtitledetailsbox}{%
\addressfont\color{color2}%
\begin{tabular}[b]{@{}r@{}}%
\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}}%
\phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict
\ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
\socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict
\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-\makecvtitledetailswidth-\makecvtitlepicturewidth}}%
{}%
\begin{minipage}[b]{\makecvtitlenamewidth}%
\namestyle{\@firstname}\par\smallskip\namestyle{\@lastname}%
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
\end{minipage}%
\hfill%
% optional detailed information (rendering)
\llap{\usebox{\makecvtitledetailsbox}}% \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
\renewcommand*{\makeletterclosing}{
\@closing\\[3em]%
{\bfseries\@firstname\\\@lastname}%
\ifthenelse{\isundefined{\@enclosure}}{}{%
\\%
\vfill%
{\color{color2}\itshape\enclname: \@enclosure}}}
\renewcommand*{\makelettertitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputeletterlengths%
% sender contact info
\hfill%
\begin{minipage}{.5\textwidth}%
\raggedleft%
\addressfont\textcolor{color2}{%
{\bfseries\upshape\@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\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}%
\ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}%
\ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httplink{\@homepage}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}%
\end{minipage}\\[1em]
% recipient block
\begin{minipage}[t]{.5\textwidth}
\raggedright%
\addressfont%
{\bfseries\upshape\@recipientname}\\%
\@recipientaddress%
\end{minipage}
% date
\hfill% US style
% \\[1em]% UK style
\@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900"
% opening
\raggedright%
\@opening\\[1.5em]%
% ensure no extra spacing after \makelettertitle due to a possible blank line
% \ignorespacesafterend% not working
\hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}}
\makeatother
\makeatletter
\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}
\makeatother
% for timeline
\makeatletter
\pgfmathsetmacro\tl@textstartabove{\tl@width-2pt}
\NewDocumentCommand\tldatelabelcventryn{O{center}O{color1}mmmmmmm}{%
\pgfmathsetmacro\tl@endyear{\tl@lastyear}%
\pgfmathsetmacro\tl@startfraction{(#3-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
\pgfmathsetmacro\tl@endfraction{(\tl@endyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
\cventry{\tikz[baseline]{%
\useasboundingbox (0,-1.5ex) rectangle (\hintscolumnwidth,1ex);
\fill [\tl@runningcolor] (0,0)
rectangle (\hintscolumnwidth,\tl@runningwidth);
\fill [#2] (0,0)
++(\tl@startfraction*\hintscolumnwidth,0pt)
node [tl@startyear,yshift=5pt,anchor=#1] {#4}
node {$\bullet$};
}
}
{#5}{#6}{#7}{#8}{#9}
}
\newcommand\tllabelcventryn[9][color1]{%
\gdef\Argi{#1}%
\gdef\Argii{#2}%
\gdef\Argiii{#3}%
\gdef\Argiv{#4}%
\gdef\Argv{#5}%
\gdef\Argvi{#6}%
\gdef\Argvii{#7}%
\gdef\Argviii{#8}%
\gdef\Argix{#9}%
\auxtllabelcventryn
}
\def\auxtllabelcventryn#1{%
\gdef\Argx{#1}%
\pgfmathsetmacro\tl@endyear{ifthenelse(\Argiii==0,\tl@lastyear,\Argiii)}
\pgfmathsetmacro\tl@startfraction{(\Argii-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
\pgfmathsetmacro\tl@endfraction{(\tl@endyear-\tl@firstyear)/(\tl@lastyear-\tl@firstyear)}%
\cventry{\tikz[baseline=0pt]{
\fill [\tl@runningcolor] (0,0)
rectangle (\hintscolumnwidth,\tl@runningwidth);
\useasboundingbox (0,-1.5ex)
rectangle (\hintscolumnwidth,1ex);
\fill [\Argi] (0,0)
++(\tl@startfraction*\hintscolumnwidth,0pt)
node [tl@startyear,anchor=north east] {\Argiv} node [tl@startyear,above] {\Argv}
rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width-1pt);
\pgfmathsetlength{\pgf@xa}{\Argiii} \ifdim\pgf@xa=0pt
\shade [left color=\Argi] (\tl@startfraction*\hintscolumnwidth,0)
rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
\else
\fill [\Argi] (\tl@startfraction*\hintscolumnwidth,0)
rectangle (\tl@endfraction*\hintscolumnwidth,\tl@width);
\fi
}
}
{\Argvi}{\Argvii}{\Argviii}{\Argix}{\Argx}%
}
\makeatother
%
\tltextstart[north]{\scriptsize}
\tltextend[south]{\scriptsize}
\firstname{Ctest}
\familyname{test}
\title{Curriculum vit\ae{}}
\address{}{}
\photo[128pt]{picture}
\begin{document}
\recipient{Test}{Test\\Test}
\date{\today}
\opening{Dear Commitee Members:}
\closing{Sincerely yours,}
\enclosure[Attached]{curriculum vit\ae{}}
\makelettertitle
Text a lot of text.
\makeletterclosing
\end{document}
这给出
现在我想在“此致”下方和我的名字上方添加我的手写签名。我该怎么做?
答案1
我将遵循在网上求职申请中添加签名获得签名的电子(矢量化)版本。假设签名名为signature.pdf
。然后,您需要将以下代码添加到文档序言中:
\makeatletter
\renewcommand*{\makeletterclosing}{
\@closing\\[3em]%
\includegraphics{signature}\\% Insert signature
{\bfseries \@firstname~\@lastname}%
\ifthenelse{\isundefined{\@enclosure}}{}{%
\\%
\vfill%
{\color{color2}\itshape\enclname: \@enclosure}}}
\makeatother
上述重新定义\makeletterclosing
仅\includegraphics{signature}\\
在打印姓/名之前插入。您可能希望减少签名结束和开头之后的空间(目前上面列为3em
)。
答案2
实际上,没有必要使用 Daniel 建议的宏,尽管它有效。这里有更简单的方法,它还允许您调整签名大小并减少签名后的垂直空间。我使用了:
\closing{Sincerely yours,\\ \includegraphics[width=4cm]{pictures/Signature} \vspace{-1cm}}
如果你需要调整签名的水平位置,可以使用类似
\closing{Sincerely yours,\\ \hbox{\hspace{-0.6cm} \includegraphics[width=4cm]{pictures/Signature}} \vspace{-1cm}}
答案3
我的解决方案是这样的:
\closing{Mit freundlichem Gruß, }
\vspace{-6em}
\includegraphics[height=3em]{signature.png}
\vspace{6em}
基本上,我将手写签名放在姓名下方,但将其推到两个文本之间。这不是“好”的,但它工作得很快,没有问题。所以对于像写给我的信这样的小项目来说,这是一个足够好的解决方案。
答案4
它可以像这样工作,
\signature{\includegraphics[height=.7in]{Signature.png} \\ Your Name}
这是一个简单易行的技巧之一。