newlfm 套件缺少記錄的 \greettoskipbefore 指令

newlfm 套件缺少記錄的 \greettoskipbefore 指令

在使用 寫信時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 文件中定義為臨時 hack?

編輯:這是一個 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 求職信不顯示“Sincerely, My Name”, 例如)。但這不是重點…

跳過的\@greet@to@sk@a目的是在「」子句之後放置一個skip ,是的,有一個伴隨的,大概是在「」子句之前提供一個。然而,沒有提供正式的方法來設定這個長度。這個「缺少」跳過的位置與「ess」子句(由 length 提供)之後的ip位於同一位置(垂直),該子句有一個可用的設定宏:agreet to\@greet@to@sk@bskip bgreet toskato addr\@addr@to@sk@a

\def\addrtoskipafter#1{\setlength{\@addr@to@sk@a}{#1}}%

因此,設定此跳過而不是丟失的跳過可能就足夠了。這是一個最小的例子(取自TeX 求職信不顯示“Sincerely, My Name”) 突出顯示此效果:

在此輸入影像描述

\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在「問候」之後插入:

在此輸入影像描述

相關內容