![如何让页脚中的两封电子邮件保持在同一行?](https://linux22.com/image/360633/%E5%A6%82%E4%BD%95%E8%AE%A9%E9%A1%B5%E8%84%9A%E4%B8%AD%E7%9A%84%E4%B8%A4%E5%B0%81%E7%94%B5%E5%AD%90%E9%82%AE%E4%BB%B6%E4%BF%9D%E6%8C%81%E5%9C%A8%E5%90%8C%E4%B8%80%E8%A1%8C%EF%BC%9F.png)
当我将比例增加到 时left=4cm, right=3cm
,页脚中的第二封电子邮件将移至下一行。因此,使用与以下信函模板中相同的比例,我如何才能让页脚中的两封电子邮件保持在同一行,也就是说,如何防止第二封电子邮件阻止进入下一行。
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{casual}
\moderncvcolor{blue}
\usepackage[utf8]{inputenc}
\usepackage[scale=0.95, top=1cm, bottom=2cm, left=4cm, right=3cm]{geometry}
\renewcommand*{\addressfont}{\small\mdseries}
\name{John}{Templeton}
\title{Resumé title}
\address{36 Mauniour, Valybir, Alcansa}{}{United States}
\phone[mobile]{+19193433283}
\email{[email protected]}
\extrainfo{\emailsymbol\emaillink{r\[email protected]}}
\newlength{\currentparskip}
\begin{document}
\recipient{Department of Philology \\
Faculty of Humanities \\
University California\\
Elgsdelaan 1105 \\
1081 HV California\\
[email protected]\\
Job number:5675}{}
\date{\today}
\opening{To whom it may concern,}
\closing{Yours sincerely,\vspace{-0.5cm}}
\makelettertitle
\setlength{\currentparskip}{\parskip}
\setlength{\parskip}{\currentparskip}
The body of the letter
\vspace{0.5cm}
\enclosure [\upshape Attached]{\upshape resume, writing sample.}
\makeletterclosing
\clearpage
\end{document}
答案1
嗯,一种可能性是将页脚()的定义宽度改得0.8\textwidth
稍微长一点。
你moderncvfooti.sty
会发现定义
% lengths
\@initializelength{\footwidth}%
\renewcommand*{\recomputefootlengths}{%
\setlength{\footwidth}{0.8\textwidth}}
将以下代码添加到你的前言中并改变其宽度:
\renewcommand*{\recomputefootlengths}{%
\setlength{\footwidth}{0.85\textwidth}} % original: 0.8\textwidth
使用以下 MWE
\documentclass[11pt,a4paper,sans]{moderncv}
% moderncv themes
\moderncvstyle{casual}
\moderncvcolor{blue}
% character encoding
\usepackage[utf8]{inputenc}
% adjust the page margins
\usepackage[scale=0.95, top=1cm, bottom=2cm, left=4cm, right=3cm,showframe]{geometry} % left=4cm, right=3cm left=2cm, right=1cm
\usepackage{blindtext} % to generate dummy text <===========================
%\setlength{\hintscolumnwidth}{3cm}
%\setlength{\makecvtitlenamewidth}{10cm}
% lengths
%\@initializelength{\footwidth}%
\renewcommand*{\recomputefootlengths}{% <======================================
\setlength{\footwidth}{0.85\textwidth}} % original: 0.8\textwidth <==========
\renewcommand*{\addressfont}{\small\mdseries}
% personal data
\name{John}{Templeton}
\title{Resumé title} % optional, remove / comment the line if not wanted
\address{36 Mauniour, Valybir, Alcansa}{}{United States}% optional, remove / comment the line if not wanted; the "postcode city" and and "country" arguments can be omitted or provided empty
\phone[mobile]{+19193433283} % optional, remove / comment the line if not wanted
\email{[email protected]}
\extrainfo{\emailsymbol\emaillink{r\[email protected]}}
\newlength{\currentparskip}
\begin{document}
%----- letter ---------------------------------------------------------
% recipient data
\recipient{Department of Philology \\
Faculty of Humanities \\
University California\\
Elgsdelaan 1105 \\
1081 HV California\\
[email protected]\\
Job number:5675}{}
\date{\today}
\opening{To whom it may concern,}
\closing{Yours sincerely,\vspace{-0.5cm}}
\makelettertitle
\setlength{\currentparskip}{\parskip}% save the value of paragraph spacing
\setlength{\parskip}{\currentparskip}% restore the value
The body of the letter
\blindtext
\vspace{0.5cm}
\enclosure [\upshape Attached]{\upshape resume, writing sample.}
\makeletterclosing
\clearpage
\end{document}
得到结果:
在 1.3.0 版本中,文件 中定义了cv (命令)和字母( )moderncv
的页脚。\makecvfooter
\makeletterfooter
moderncvstylecasual.sty
要更改命令,\makeletterfooter
您可以使用以下代码:
\patchcmd{\makeletterfooter}{\setlength{\footerwidth}{0.8\textwidth}}{\setlength{\footerwidth}{0.85\textwidth}}{}{} % <==========
((如果您需要它来更改命令\makecvfooter
:
\patchcmd{\makecvfooter}{\setlength{\footerwidth}{0.8\textwidth}}{\setlength{\footerwidth}{0.85\textwidth}}{}{} % <==========
以下 MWE 仅适用于 1.3.0 版本
\documentclass[11pt,a4paper,sans]{moderncv}
% moderncv themes
\moderncvstyle{casual}
\moderncvcolor{blue}
% character encoding
\usepackage[utf8]{inputenc}
% adjust the page margins
\usepackage[scale=0.95, top=1cm, bottom=2cm, left=4cm, right=3cm,showframe]{geometry} % left=4cm, right=3cm left=2cm, right=1cm
\usepackage{blindtext} % to generate dummy text <===========================
%\setlength{\hintscolumnwidth}{3cm}
%\setlength{\makecvtitlenamewidth}{10cm}
\patchcmd{\makeletterfooter}{\setlength{\footerwidth}{0.8\textwidth}}{\setlength{\footerwidth}{0.85\textwidth}}{}{} % <==========
\renewcommand*{\addressfont}{\small\mdseries}
% personal data
\firstname{John} % Your first name
\familyname{Templeton} % Your last name
\title{Resumé title}
\address{36 Mauniour, Valybir, Alcansa}{}{United States}
\mobile{+19193433283}
\email{[email protected]}
\extrainfo{\emailsymbol\emaillink{r\[email protected]}}
\newlength{\currentparskip}
\begin{document}
%----- letter ---------------------------------------------------------
% recipient data
\recipient{Department of Philology \\
Faculty of Humanities \\
University California\\
Elgsdelaan 1105 \\
1081 HV California\\
[email protected]\\
Job number:5675}{}
\date{\today}
\opening{To whom it may concern,}
\closing{Yours sincerely,\vspace{-0.5cm}}
\makelettertitle
\setlength{\currentparskip}{\parskip}% save the value of paragraph spacing
\setlength{\parskip}{\currentparskip}% restore the value
The body of the letter
\blindtext
\vspace{0.5cm}
\enclosure [\upshape Attached]{\upshape resume, writing sample.}
\makeletterclosing
\clearpage
\end{document}