Document ClassesLetter Signature on the Right and Postscript

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
Fibonacci
Posts: 37
Joined: Tue Jan 25, 2011 1:16 am

Letter Signature on the Right and Postscript

Post by Fibonacci »

Hello,

I'm trying to use the newlfm class to write letters, but there are a couple of things I haven't been able to do.

First, it's customary in some places to have the signature aligned on the right side, but everything before that (including the closing line) on the left. I have not found a way to achieve that in "newlfm".

Second, I can't find a command to add a postscript, or anything after the signature (equivalent to the \cc, \encl and \ps commands of the original letter class). Instead, everything I write after the newlfm environment appears on the next page.

MWE:

Code: Select all

\documentclass[stdletter]{newlfm}

\greetto{Dear Name}
\closeline{This should be left-aligned}
\namefrom{This should be right-aligned}

\begin{document}
\begin{newlfm}

\end{newlfm}
This should not appear on the next page.
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Letter Signature on the Right and Postscript

Post by localghost »

Fibonacci wrote:[…] First, it's customary in some places to have the signature aligned on the right side, but everything before that (including the closing line) on the left. I have not found a way to achieve that in "newlfm". […]
There is the class option sigleft. But this aligns the closing line as well as the signature to the left. The output you want to have seems not to be planned in this class. I suggest to write a feature suggestion to the author for more flexibility. Finally you could use another letter class.
Fibonacci wrote:[…] Second, I can't find a command to add a postscript, or anything after the signature (equivalent to the \cc, \encl and \ps commands of the original letter class). Instead, everything I write after \end{newlfm} appears on the next page.[…]
The \ps command works inside the newlfm environment. But presumably not as you expect it. Where is this postscript going to appear? This might be another feature suggestion you could write to the author.


Thorsten
Fibonacci
Posts: 37
Joined: Tue Jan 25, 2011 1:16 am

Letter Signature on the Right and Postscript

Post by Fibonacci »

I will probably just use a different class. I've just moved from letter, so I'm open to suggestions. Do you recommend any particular class which supports those two features?
Fibonacci wrote: The \ps command works inside the newlfm environment. But presumably not as you expect it. Where is this postscript going to appear?
The postscript should appear right after the signature, as it does in a letter document. I see that doesn't work on this class – whatever I write inside \ps appears wherever I put the \ps command.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Letter Signature on the Right and Postscript

Post by localghost »

Fibonacci wrote:I will probably just use a different class. I've just moved from letter, so I'm open to suggestions. Do you recommend any particular class which supports those two features? […]
First I thought of scrlttr2 from KOMA-Script. Although it is very flexible, it doesn't support what you want.
Fibonacci wrote:[…] The postscript should appear right after the signature, as it does in a letter document. I see that doesn't work on this class – whatever I write inside \ps appears wherever I put the \ps command.
So let's get back to a dirty hack with newlfm. It sets the sigleft option and abuses the \namefrom macro.

Code: Select all

\documentclass[stdletter,sigleft]{newlfm}
\usepackage[T1]{fontenc}

\newcommand*{\cls}[1]{\textsf{#1}}
\newcommand*{\cmd}[1]{\texttt{\textbackslash #1}}
\newcommand*{\env}[1]{\texttt{#1}}
\newcommand*{\pkg}[1]{\textsf{#1}}

\greetto{Dear members,}
\closeline{This should be left-aligned}
\namefrom{%
  \makebox[\linewidth][r]{This should be right-aligned}\\[\baselineskip]
  PS: This is a postscript.%
}

\begin{document}
  \begin{newlfm}
    I'm trying to use the \cls{newlfm} class to write letters, but there are a couple of things I haven't been able to do.

    First, it's customary in some places to have the signature aligned on the right side, but everything before that (including the closing line) on the left. I have not found a way to achieve that in \cls{newlfm}.

    Second, I can't find a command to add a postscript, or anything after the signature (equivalent to the \cmd{cc}, \cmd{encl} and \cmd{ps} commands of the original letter class). Instead, everything I write after \env{newlfm} appears on the next page.
  \end{newlfm}
\end{document}
This is intentionally not a minimal example. The new commands for the formatting of commands, environments as well as class and package names are only gadgetry here to format the text of your question in the letter text.
Post Reply