Feb 10

Letter writing in Latex

Latex is widely known in technical writer’s society. As an engineering, I am also fond of latex specially while writing complicated equations. However, I’ve found later that latex isn’t only good in technical writing but also normal day to day writing can be done with it. Currently for any writing I use latex: from my CV, letter writing to very good looking presentation. This post is about writing letter in latex. Later I’ll try to add some post about preparing presentation using latex.

I was using latex letter class for a long time (please take a look at the link if you want to know details about letter writing), however, I was not satisfied with the layout. Later, I’ve found at least 5 more classes to write letter using latex.

  1. akletter: This is a class file for business letters specially in German format. Moreover, I’ve found it difficult to customize. You can take a look at the document to know more about it.
  2. newlfm: This class file can be used to write letters, faxes and memos. You can write business letter as well as standard letters. Very flexible.
  3. dinbrief: Very good for German letter writing format. I use it often since I’m located in Germany.
  4. brief: I didn’t try it. Bundled with Dutch ntgclass.
  5. scrlttr2: Most flexible of all. It is bundled with Koma-Script.

Since I use dinbrief and scrlttr2, I’ll give a little bit details about each of them.

dinbrief

I took this example from the documentation of dinbrief:

documentclass[12pt]{dinbrief}
usepackage{german}
address{R”udiger Kurz\
Am See 1\
76133 Karlsruhe}
backaddress{R. Kurz, Am See 1, 76133 Karslruhe}
signature{R”udiger Kurz}
place{Karlsruhe}
begin{document}
phone{0721}{222222}
begin{letter}{Deutsche Bundespost\
Fernmeldeamt Karlsruhe\
Postfach 7300\[medskipamount]
{bf 76131 Karlsruhe}}
yourmail{01.04.93}
sign{123456}
subject{Betrieb eines Mikrowellensenders}
opening{Sehr geehrte Damen und Herren,}
anbei sende ich Ihnen eine Kopie der bisherigen Genehmigung f”ur
unseren Mikrowellenherd…
… Ihre Bem”uhungen im voraus vielen Dank.
closing{Mit freundlichen Gr”u”sen,}
ps{Wir bitten um schnelle Erledigung.}
cc{Deutsche Bundespost\
Karlsruher Privatfunk \
S”uddeutscher Rundfunk}
encl{Abschrift der Urkunde}
end{letter}
end{document}

Most of the commands are self explanatory. Specials are:

  • backaddress: A single line address that is shown through the windowed envelope.
  • yourmail, sign: These are the reference of the letter.

Please take a look at the output of this akletter (Don’t be angry since it is in German ;).

Pdf output: letter_dinbrief

scrlttr2

First take a look at this example:

documentclass[paper=a4]{scrlttr2}
usepackage[english]{babel}
KOMAoptions{fromalign=left, fromlogo=false, addrfield=true,
backaddress=on, subject=titled, subject=left,foldmarks=on,
fromphone=on,fromemail=true}
setkomavar{fromname}{Thomas Mustermann}
setkomavar{signature}{Thomas Mustermann}
setkomavar{fromaddress}{Some street 23\Postcode City}
setkomavar{fromemail}{t.mustermann@domain.com}
setkomavar{fromphone}{00000000}
setkomavar{subject}{Here goes the subject of the letter}
begin{document}
begin{letter}{Some firm\some area\some postcode\some country}
opening{Dear Ladies and Gentlemen,}
this is the main text
closing{yours sincerely\ mbox{}}
ps
Take care. this is postscript.
encl{enclosures}
cc{additional addressees}
end{letter}
end{document}

You should read the document (scrguien.pdf) of Koma-script to write this most flexible letter. There are thousand of options you can customize. I explain the KOMAoptions used in this letter.

  • fromalign: alignment of from address. Can be on the left or right.
  • fromlogo: you can put the company logo. true or false.
  • addrfield: whether an address field would be there or not.
  • backaddress: just like dinbrief class, for windowed envelope.
  • subject: whether the word subject is written on the subject field or not, position of the subject and locate before or after opening.
  • foldmark: to put a letter into an envelope, need to fold it. Whether the foldmark would be there or not.
  • fromphone, frommail: phone number and mail address would be included in the from address or not.

Then you setup all the koma-variable in the letter. The output of this code is here: letter_scrlttr2

Please give some time to read the document of scrlttr2 to optimize the letter for your purpose.

Feb 04

Pdftex warning: Found pdf version 1.5, allowed maximum 1.4

While compiling the pdftex in texniccenter, I had come up with this warning: Found pdf version 1.5, allowed maximum 1.4. To remove this warning following steps should be done:

  1. Find the configuration file (pdftex.cfg) of pdftex. For my miktex installation it resides in: C:Program FilesMiKTeX 2.7pdftexconfig
  2. Open the file in text editor.
  3. Find the line “pdf_minorversion 4″ and change 4 to 5
  4. Save the file and update the format settings (Miktex 2.x –> settings –> update formats)

Now compile the file once again. You’ll not see the warning. ;)

» Newer posts