texblog

LaTeX’s alternative letter class newlfm

A while ago, I wrote a post on how to write a letter using LaTeX. That post was based on the standard documentclass letter. Letters look different in different parts of the world. Furthermore, the standard class has certain limitations. Therefore, it is not surprising that a number of alternative letter classes and packages were created, including newlfm, dinbrief (german), akletter, formlett, the KOMA-script class scrlttr2, and others. This post introduces the letter class newlfm and some of its features.

 
The name newlfm, which stands for “New letter, fax, and memo document class for LaTeX”, suggests that this is an extensive class and so is its documentation.

Therefore, let me start with an example and then go into the different elements of creating a letter with newlfm.

\documentclass[12pt,stdletter,orderfromtodate,sigleft]{newlfm}
\usepackage{blindtext, xfrac}

\newlfmP{dateskipbefore=50pt}
\newlfmP{sigsize=50pt}
\newlfmP{sigskipbefore=50pt}

\newlfmP{Headlinewd=0pt,Footlinewd=0pt}

\namefrom{Sherlock Holmes}
\addrfrom{%
	221B Baker Street\\
	London, UK
}

\addrto{%
	Basil of Baker Street\\
	221$\sfrac{1}{2}$ Baker Street\\
	London, UK
}

\dateset{January 6, 1914}

\greetto{To Whom It May Concern,}

\closeline{Sincerely,}

\begin{document}
\begin{newlfm}
\blindtext
\end{newlfm}
\end{document}

 
The documentclass options

\documentclass[12pt,stdletter,orderfromtodate,sigleft]{newlfm}

The main format of the letter (or memo) is set through a class option argument. Here I used stdletter which by default places the date, from-address, closing, signature, and name on the right. I then moved the signature to the left (sigleft) and reordered the date to appear after the to-address (orderfromtodate).

The lists of standard layouts and options below were taken from the documentation.

 
Layout space adjustments

\newlfmP{dateskipbefore=50pt}
\newlfmP{sigsize=50pt}
\newlfmP{sigskipbefore=50pt}
\newlfmP{Headlinewd=0pt,Footlinewd=0pt}

The document class defines a number of length variables (horizontal and vertical) to make changes to the standard layouts defined. These variables are adjusted through the \newlfmP macro. I increased the space before date and change spacing around the signature. Furthermore, I wanted to get rid of the header and footer lines which are printed be default.

See the documentation for a list of horizontal length variables.

 
Setting the fields

\namefrom{Sherlok Holmes}
\addrfrom{%
	221B Baker Street\\
	London, UK
}

\addrto{%
	Basil of Baker Street\\
	221$\sfrac{1}{2}$ Baker Street\\
	London, UK
}

\dateset{January 6, 1914}

\greetto{To Whom It May Concern,}
\closeline{Sincerely,}

To set the fields, the class uses predefined macros, similar to the standard letter class. I only used the standard macros to set the addresses, date, greeting and closing. Additional address item macros are given in the list below.

 
The letter text

\begin{document}
\begin{newlfm}
\blindtext
\end{newlfm}
\end{document}

Nothing special here except for the newlfm-environment. Omitting the environment prints the text only, not creating a letter.

Exit mobile version