自 2007 年以来,我一直在使用 TeXLive 的 newlfm 进行官方通信。我注意到,自 TeXLive 2009 以来,newlfm 就破坏了向后兼容性。我多次阅读文档(很长),可能不太仔细,但我从未找到解决以下日期烦人问题的方法。这就是我要说的。
日期应与我的名字“Predrag”的首字母对齐。这是源代码
\documentclass[12pt,stdletter,sigleft]{newlfm}
\usepackage{charter}
\widowpenalty=1000
\clubpenalty=1000
\newsavebox{\Luiuc}
\sbox{\Luiuc}{%
\parbox[b]{1.75in}{%
\vspace{0.5in}%
\includegraphics[scale=1.0,ext=.eps]
{figures/UILogoLG3L}%
}%
}%
\makeletterhead{Uiuc}{\Lheader{\usebox{\Luiuc}}}
\newlfmP{headermarginskip=20pt}
\newlfmP{sigsize=50pt}
\newlfmP{dateskipafter=20pt}
\newlfmP{addrfromphone}
\newlfmP{addrfromemail}
\PhrPhone{Phone}
\PhrEmail{Email}
\lthUiuc
\namefrom{Predrag Puno\v{s}evac}
\addrfrom{%
Predrag Puno\v{s}evac\\
Science Laboratory\\
Some University\\
Urbana, IL 61801
}
\phonefrom{000-000-0000}
\emailfrom{[email protected]}
\addrto{%
Faculty Search Committee\\
Department of Science\\
Some University\\
Somewhere, SC 29634-0974}
\greetto{To Whom It May Concern,}
\closeline{Sincerely,}
\begin{document}
\begin{newlfm}
I am writing to apply for the position of bla bla
Thank you for your consideration. I look forward to
hearing from you.
\end{newlfm}
\end{document}
由于上述行为,我已经避免在信件上标注日期好几年了。但是,我决定,如果我不能修复上述软件包,我将至少为信件改用纯 TeX 或 ConTeXt。顺便说一句,我玩 ConTeXt 越多,就越喜欢它。我迫不及待地希望 Mark IV 能够更加成熟。
答案1
也许不是最好的选择,但你可以使用dateno
类选项
\documentclass[12pt,stdletter,sigleft,dateno]{newlfm}
避免自动排版日期然后添加\today
,\addfrom
以继承其对齐方式
\addrfrom{%
\today\\
Predrag Puno\v{s}evac\\
Science Laboratory\\
Some University\\
Urbana, IL 61801
}
下面是使用示例代码部分内容的完整示例(由于我没有实际的图像文件,因此我抑制了使用图像的所有命令):
\documentclass[12pt,stdletter,sigleft,dateno]{newlfm}
\usepackage{charter}
\widowpenalty=1000
\clubpenalty=1000
\newlfmP{headermarginskip=20pt}
\newlfmP{sigsize=50pt}
\newlfmP{dateskipafter=20pt}
\newlfmP{addrfromphone}
\newlfmP{addrfromemail}
\PhrPhone{Phone}
\PhrEmail{Email}
\namefrom{Predrag Puno\v{s}evac}
\addrfrom{%
\today\\
Predrag Puno\v{s}evac\\
Science Laboratory\\
Some University\\
Urbana, IL 61801
}
\phonefrom{000-000-0000}
\emailfrom{[email protected]}
\addrto{%
Faculty Search Committee\\
Department of Science\\
Some University\\
Somewhere, SC 29634-0974}
\greetto{To Whom It May Concern,}
\closeline{Sincerely,}
\begin{document}
\begin{newlfm}
I am writing to apply for the position of bla bla
Thank you for your consideration. I look forward to
hearing from you.
\end{newlfm}
\end{document}
答案2
另一个卑鄙的办法是使用\dateset
,然后\parbox
手动对齐日期。这样你就不需要修改你的地址了,如果你使用信件数据库,这很有用,letrinfo.tex,可能包含许多地址。但是,缺点是每次对新地址进行对齐时都必须手动进行。只需添加以下行:
\dateset{\parbox{width}{\today}}
您需要调整的位置width
,以便日期与地址文本对齐。在我的计算机上,在您的文档中,它大约为 1.8 英寸:
\documentclass[12pt,stdletter,sigleft]{newlfm}
\usepackage{charter}
\newlfmP{headermarginskip=20pt}
\newlfmP{sigsize=50pt}
\newlfmP{dateskipafter=20pt}
\newlfmP{addrfromphone}
\newlfmP{addrfromemail}
\PhrPhone{Phone}
\PhrEmail{Email}
% ***** Manually adjust the position of the date. *****
\dateset{\parbox{1.8in}{\today}}
\namefrom{Predrag Puno\v{s}evac}
\addrfrom{%
Predrag Puno\v{s}evac\\
Science Laboratory\\
Some University\\
Urbana, IL 61801
}
\phonefrom{000-000-0000}
\emailfrom{[email protected]}
\addrto{%
Faculty Search Committee\\
Department of Science\\
Some University\\
Somewhere, SC 29634-0974}
\greetto{To Whom It May Concern,}
\closeline{Sincerely,}
\begin{document}
\begin{newlfm}
I am writing to apply for the position of bla bla
Thank you for your consideration. I look forward to
hearing from you.
\end{newlfm}
\end{document}