无法使用 newlfm.cls 将日期左对齐

无法使用 newlfm.cls 将日期左对齐

可能重复:
Tex 求职信未显示“谨上,我的名字”

以下是我当前的输出:

在此处输入图片描述

我无法使顶部的日期与文本对齐,该日期在上图中用红色圈出。

这是我的源代码.tex

 \documentclass[11pt,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=-40pt}
 \newlfmP{sigsize=50pt}
 \newlfmP{dateskipafter=33pt}
 \newlfmP{addrfromphone}
 \newlfmP{addrfromemail}
 \PhrPhone{Phone}
 \PhrEmail{Email}

 \lthUiuc

 \namefrom{Matthew J.\ Miller}
 \addrfrom{%
         \today\\
 ]
         Predrag Puno\v{s}evac\\
         Science Laboratory\\
         Some University\\
         Urbana, IL 61801
 }
 \phonefrom{217-244-6024}
 \emailfrom{[email protected]}

 \addrto{%
 Faculty Search Committee\\
 Department of Computer Science\\
 Clemson University\\
 Clemson, SC 29634-0974}

 \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
      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.cls

 \DeclareOption{dateright}{\setboolean{@dt@l}{false}\setboolean{@dt@c}{false}}%
 \define@key{ov}{dateright}[true]{\iffixq{#1}{\setboolean{@dt@l}{false}\setboolean{@dt@c}     {false}}}%
 \def\dateright#1{\iffixq{#1}{\setboolean{@dt@l}{false}\setboolean{@dt@c}{false}}}%
 \DeclareOption{dateleft}{\setboolean{@dt@l}{true}\setboolean{@dt@c}{false}}%
 \define@key{ov}{dateleft}[true]{\iffixq{#1}{\setboolean{@dt@l}{true}\setboolean{@dt@c}     {false}}}%
 \def\dateleft#1{\iffixq{#1}{\setboolean{@dt@l}{true}\setboolean{@dt@c}{false}}}%
 \DeclareOption{datecenter}{\setboolean{@dt@l}{false}\setboolean{@dt@c}{true}}%
 \define@key{ov}{datecenter}[true]{\iffixq{#1}{\setboolean{@dt@l}{false}\setboolean{@dt@c}     {true}}}%
 \def\datecenter#1{\iffixq{#1}{\setboolean{@dt@l}{false}\setboolean{@dt@c}{true}}}%

答案1

解释

  1. 放入\newlfmP{dateleft}你的序言中。
  2. \addfrom{}命令和\dateset{}代码中存在范围错误。我已相应地将它们分开。
  3. 此外,在第 (2) 项中,您尝试使用 结束{]我已修复该问题。
  4. 我把所有字母选项都设置为只有一个\newlfmP,以使序言更具可读性。
  5. 我注释了您原始代码的某些部分,以便它可以在我的计算机上编译。您可以稍后取消注释。

代码

\documentclass[11pt,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{%
    dateleft,
    headermarginskip=-40pt,
    sigsize=50pt,
    dateskipafter=33pt,
    addrfromphone,
    addrfromemail,
           }
 \PhrPhone{Phone}
 \PhrEmail{Email}

% \lthUiuc
%% There was a scoping error with the commands \addfrom{} and \dateset{} in your code.
 \namefrom{Matthew J.\ Miller}
 \addrfrom{
 Predrag Puno\v{s}evac\\
 Science Laboratory\\
 Some University\\
 Urbana, IL 61801
 }%
 \dateset{\today }
 \phonefrom{217-244-6024}
 \emailfrom{[email protected]}

 \addrto{%
 Faculty Search Committee\\
 Department of Computer Science\\
 Clemson University\\
 Clemson, SC 29634-0974}

 \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
      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}

输出

在此处输入图片描述


编辑

从你的帖子中看不出你想要什么。但你为什么要这么做?这样做是有原因的,你可以通过选项、和\dateset来控制它的位置。正如所提到的dateleftdatecenterdateright沃纳,你可以把这句话写到你的序言中。

 \dateset{}
 \namefrom{Matthew J.\ Miller}
 \addrfrom{
 \today\\[12pt]
 Predrag Puno\v{s}evac\\
 Science Laboratory\\
 Some University\\
 Urbana, IL 61801
 }%

您可以替换12pt为您喜欢的任意长度。

我的建议是,你要么按照这里的建议去做,要么在 Tex 中应用 Werner 的建议求职信未显示“谨上,我的名字”

另外,我看到您给出了headermarginskip一个负值。这样做会使您的下一页从顶部边距规则上方开始。这是一个似乎有效的代码。根据您的喜好进行调整。

\documentclass[11pt,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{ %
            dateleft,
            sigright,
            addrfromskipbefore=12pt,
            headermarginskip=0pt,
            topmarginskip=0pt,
            sigsize=0pt,
            dateskipbefore=0pt,
            dateskipafter=24pt,
            closeskipbefore=10pt, 
            sigskipbefore=0pt,
            footermarginsize=0.5in,
            }
 \PhrPhone{Phone}
 \PhrEmail{Email}

% \lthUiuc
 \dateset{}
 \namefrom{Matthew J.\ Miller}
 \addrfrom{
 \today\\[12pt]
 Predrag Puno\v{s}evac\\
 Science Laboratory\\
 Some University\\
 Urbana, IL 61801
 }%
 \phonefrom{217-244-6024}
 \emailfrom{[email protected]}

 \addrto{%
 Faculty Search Committee\\
 Department of Computer Science\\
 Clemson University\\
 Clemson, SC 29634-0974}

 \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
      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}

相关内容