19

I'm increasingly fed up with the arbitrary restrictions that the standard LaTeX letter class has. Today I discovered that the table environment is not defined in the standard letter class, which means one can't use labels or captions.

CTAN has a list of letter related packages. Can anyone suggest a good LaTeX letter class to work with for general use? I'd like something as flexible and with as few restrictions as possible, well maintained, not excessively complicated to use, and not buggy. I was earlier recommended newlfm (on comp.text.tex). That post was about the fact that the letter class does not allow the addition of a subject.

A similar question has been asked already, "A clean letter class for office use, including serial letters", where scrlttr2 is recommended.

Faheem Mitha
  • 7,778

2 Answers2

18

I recommend using the scrlttr2 class.

  • It is extremely flexible
  • It is actively maintained
  • It is stable since many years; if there would occur any bug I'm sure the author would deal with it quickly
  • There are templates (German example)
  • The class includes concepts which distinguish it from other classes, such as variables, pseudo lengths
  • You can use option files to store macros or to extend functionality
  • You could even use \section, \subsection, \subsubsection, \paragraph and \minisec: the KOMA-Script author provides the option file sections.lco for it, with an example
  • It benefits from features of the KOMA-Script bundle
  • You can use scrpage2 with it for header and footer
  • You can use tables and figures with captions, for example if you load the float and the caption package
  • Here's a German presentation about separation of content and presentation using scrlttr2: briefdemo.pdf (source code)

Originally, the KOMA-Script manual, including the sclttr2 documentation, has been written in German, also published as a book. There's an english translation, which could be a bit behind the most current features (currently 2011-05-30).

As a general remark: I expect a letter class to provide letter functionality, a book class to offer book features etc. - not a class to do all. There are many classes for different purposes and even if one uses two classes, the results can be merged.

Skillmon
  • 60,462
Stefan Kottwitz
  • 231,401
  • Thanks for the recommendation. I see scrlttr2 allows use of a subject. Do you know whether you can use the table environment, or is this something I'll have to find out for myself? – Faheem Mitha Aug 06 '11 at 23:43
  • It doesn't look like the table environment is defined here either. What a drag. Does anyone know why it isn't? – Faheem Mitha Aug 07 '11 at 08:12
  • @Faheem: Floats are not defined by the letter classes are these are unlikely to be appropriate. You can use a tabular just fine, but it will not float (or have a caption). – Joseph Wright Aug 07 '11 at 11:39
  • @Faheem: it's because floating tables and figures are very unusual in letters. It's more common to write a letter and to provide another possibly big document as appendix, for separate use. – Stefan Kottwitz Aug 07 '11 at 11:47
  • @Faheem: your question is very general, about suggesting a letter class for general use. Perhaps post a specific follow-up question such as "How can I use tables with captions with scrlttr2" or similar. It's possible. – Stefan Kottwitz Aug 07 '11 at 11:49
  • @Stefan: Ok, will do. I don't see why a LaTeX class should second guess possible uses. What is the harm to allowing floats? – Faheem Mitha Aug 07 '11 at 12:58
  • @Joseph: I don't understand what you mean by appropriate. What about a letter as part of a scientific correspondence? This could reasonably be expected to have tables and/or figures in it. – Faheem Mitha Aug 07 '11 at 13:00
  • @Faheem: Quite apart from the fact that nowadays you'd send an e-mail, I really can't imagine that many people would every want to include a floating figure in a letter. It's also worth bearing in mind that for the letter class, this was a decision made when computational resources were much more limited and the saving on omitting this functionality was probably worth it. If/when we get LaTeX3 done, the plan would be to have functionality essentially the same across classes. – Joseph Wright Aug 07 '11 at 13:16
  • 1
    @Faheem: even in a scientific correspondence, separating letter and document would be a good idea. For example, the document could be fowarded without the letter or it could be worked on, such as revised and sent back. – Stefan Kottwitz Aug 07 '11 at 13:17
  • 2
    Please note, that the author of KOMA-Script no longer supports section.lco and instead recommends the use of the scrletter package together with a documentclass such as scrartcl. – Sebastian Schrader Jun 18 '19 at 20:32
  • The link above is dead, but I found an archived copy on IA, which is https://web.archive.org/web/20210125170801/https://komascript.de/comment/4905. The relevant (German) comment is almost at the end of the page. Here is the English translation, courtesy of Google. – Faheem Mitha Mar 03 '22 at 10:12
  • "Now obsolete It should be noted that the scrletter package is now included in KOMA-Script. This allows writing a scrlttr2 style letter with the classes scrbook, scrreprt or scrartcl. This allows you to use all the options of these classes, not just structuring commands, but also the table of contents, bibliography, index, floating environments, etc. in a letter. The use of section.lco is therefore no longer recommended. The support for this lco file is definitely ended." – Faheem Mitha Mar 03 '22 at 10:12
7

I've never quite seen the advantage of a letter class. I just use article class (plus a letterhead package that I wrote for my university.) Using the article class obviously solves the problems with respect to undefined environments in (some of) the letter classes.

For mail merge type documents I use the datatool package, which allows me to store the addresses in a .csv file and allows an unlimited number of fields as needed. The documentation has examples of using it for mail merge. Here's an example of how I use it: Example of mailmerge package with an Excel spreadsheet. But my needs are quite minimal, so this may not be the best solution for everyone.

Alan Munn
  • 218,180
  • 1
    I don't understand why a reply basically saying that a letter class is not useful is voted up so much. Is this really something that many of you believe? – Faheem Mitha Aug 07 '11 at 12:58
  • 2
    I think this discussion shouldn't take place in the comments, so I've replied in chat. What's "useful" is a pretty subjective (and your question borders on that, too.) The main functionality that I have for letters is (i) my university letterhead and (ii) mail merge capability. (i) can't be solved by a generic letter class, and (ii) can be solved very well with datatool. So for me, (and others, I suspect) there's no need for a specific letter class. – Alan Munn Aug 07 '11 at 13:18
  • Is your package for the letterhead publicly available? If so, you could answer http://tex.stackexchange.com/q/296443/5645 – Martin Thoma Feb 29 '16 at 07:19
  • @MartinThoma no my package is only distributed internally. But it doesn't provide the functionality you seek anyway. – Alan Munn Feb 29 '16 at 13:48