在使用写信时newlfm
,我尝试使用\greettoskipbefore
第 8 页的命令手动的我收到了“未定义控制序列”错误。查看来源,看起来这个特定的命令还没有被定义,而其他每个跳过命令,例如\greettoskipafter
:
\def\greettoskipafter#1{\setlength{\@greet@to@sk@a}{#1}}%
\define@key{ov}{greettoskipafter}{\setlength{\@greet@to@sk@a}{#1}}%
作为一个完全不懂原始 TeX 的 LaTeX 初学者,我对此感到很困惑。手动添加\greettoskipbefore
和重新编译newlfm
似乎是一种选择,但这意味着我的文档只能在我的系统上编译,直到此包的作者修复此问题。考虑到该包 5 年没有更新,这可能不会很快发生;这引出了我的问题:是否可以\greettoskipbefore
在我的 LaTeX 文档中将其定义为临时黑客攻击?
编辑:这是一个 MWE
\documentclass[11pt,busletternofrom]{newlfm}
\newlfmP{noLines}
\PhrRegard{RE}
\dateset{\today}
\namefrom{John Smith}
\newcommand{\companyname}{Netgear}
\newcommand{\shortcompanyname}{Netgear}
\nameto{Darryl Simpson}
\addrto{
\companyname \\
13911 Wireless Way, Suite 200 \\
Richmond, BC V6V 3B9 \\
}
\regarding{Hardware Design Engineer}
\greetto{Dear Mr. Simpson,}
\closeline{Sincerely,}
\begin{document}
\begin{newlfm}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{newlfm}
\end{document}
答案1
我从来没有真正看到过使用特定于信件的文档类的必要性,因为在标准范围内写一封信很容易article
文档类别(参见撰写正式信函和TeX 求职信不显示“谨上,我的名字”,例如)。但这不是重点...
跳过的\@greet@to@sk@a
目的是将sk
ip放在a
“ greet
to
”子句之后,是的,有一个附带的\@greet@to@sk@b
,大概是为了skip
b
在“ greet
to
”子句之前提供一个 e。但是,没有提供设置此长度的正式方法。这个“缺失”跳过的位置与“ ess”子句之后的sk
ip位于同一位置(垂直方向) (由 length 提供),它有一个可用的设置宏:a
to
addr
\@addr@to@sk@a
\def\addrtoskipafter#1{\setlength{\@addr@to@sk@a}{#1}}%
因此,设置这个跳过而不是缺失的跳过可能就足够了。这是一个最小的例子(取自TeX 求职信不显示“谨上,我的名字”)突出了这种效果:
\documentclass[10pt,stdletter]{newlfm}
\usepackage{charter}
\widowpenalty=1000
\clubpenalty=1000
\newsavebox{\Luiuc}
\sbox{\Luiuc}{%
\parbox[b]{1.75in}{%
\vspace{0.5in}%
\includegraphics[height=2\baselineskip]{example-image}%
}%
}%
\makeletterhead{Uiuc}{\Lheader{\usebox{\Luiuc}}}
\newlfmP{headermarginskip=20pt}
\newlfmP{sigsize=50pt}
\newlfmP{dateskipafter=20pt}
\newlfmP{addrfromphone}
\newlfmP{addrfromemail}
\PhrPhone{Phone}
\PhrEmail{Email}
\lthUiuc
\namefrom{Matthew J.\ Miller}
\addrfrom{%
439 Coordinated Science Laboratory\\
1308 West Main Street\\
Urbana, IL 61801
}
\phonefrom{217-244-6024}
\emailfrom{[email protected]}
\addrto{%
Faculty Search Committee\\
Department of Computer Science\\
Clemson University\\
Clemson, SC 29634-0974}
\addrfromskipbefore{-4\baselineskip}% Skip before "From Address" clause
\addrtoskipafter{4\baselineskip}% Skip after "To Address" clause
\greetto{To Whom It May Concern,}
\closeline{Sincerely,}
\begin{document}
\begin{newlfm}
I am writing to apply for the position of assistant
professor in Clemson University's Computer Science Department. I plan to receive my
Ph.D.\ degree from the University of Illinois at
Urbana-Champaign in Summer of 2006. My adviser is
Prof.\ Nitin H.\ Vaidya, and my general areas of interest
include wireless and sensor network performance and security.
Having many friends and family in the area, I would be
most enthused to return to the South permanently by accepting
a position at your institution.
In my graduate work, I focus on the design of
energy-efficient protocols and secure key distribution.
More specifically, I have explored various techniques at
multiple layers of the network stack to effectively reduce
the energy consumption of wireless communication. In security,
my work was the first to propose leveraging channel diversity
for sensor network key distribution. My research appears in
the \textit{IEEE Transactions on Mobile Computing} journal as
well as \textit{Infocom 2006} and \textit{ICDCS 2005},
prestigious conferences in the areas of networking and distributed
systems, respectively.
Enclosed is my curriculum vitae (including a list of
publications), contact information for my references, a research
statement, and a teaching statement. All of my publications and
presentations are available at:
http://www.crhc.uiuc.edu/$\sim$mjmille2/publications/
Please let me know if there are any other materials
or information that will assist you in processing my application.
Thank you for your consideration. I look forward to
hearing from you.
\end{newlfm}
\end{document}
作为一个相当大胆的替代方案,您可以创建自己的更新newlfm-fix.sty
(在local/texmf
包含所有必要修复的文件夹中)。更新应该在您需要使用它们时加载(\usepackage{newlfm-fix}
),但它们必须随您一起带到其他发行版。一旦更新到newlfm
发行(...顺便联系软件包作者),您可以停止包含您的newlfm-fix.sty
。
您还可以使用 添加空格\\[<len>]
,因为其中的某些组件newlfm
是用 设置的tabular
。例如,使用
\regarding{Hardware Design Engineer\\[4\baselineskip]}
4\normalbaselineskip
在“regards”后插入: