[Tex/LaTex] How to get US letter output from KOMA-Script’s scrlttr2 class

koma-scriptpaper-sizescrlttr2

I use KOMA-Script for most everything, including correspondence. This is painless when I am using A4 paper, but when I try to use US letter, the problems start.

With the scrartcl class, \KOMAoptions{paper=letter} does the trick.

With the scrlttr2 class:

If the default class option file is used (DIN.lco, I believe), then \KOMAOptions{paper=letter} has no effect. The document compiles with this warning:

Class scrlttr2 Warning: Letter option file `DIN.lco'
(scrlttr2) needs paper size `a4'.
(scrlttr2) Current paper size is not `a4'!
(scrlttr2) You should add `paper=a4' at the
(scrlttr2) option list of \documentclass!
(scrlttr2) Maybe you know what you are doing,
(scrlttr2) so I do not change this myself.

and the output is A4.

If I use UScommercial9.lco without paper=letter, it compiles with this warning:

Class scrlttr2 Warning: Letter option file `UScommercial9.lco'
(scrlttr2)              needs paper size `letter'.
(scrlttr2)              Current paper size is not `letter'!
(scrlttr2)              You should add `paper=letter' at the
(scrlttr2)              option list of \documentclass!
(scrlttr2)              Maybe you know what you are doing,
(scrlttr2)              so I do not change this myself.

If I use the UScommercial9.lco, as in this MWE:

\documentclass[UScommercial9]{scrlttr2}
\usepackage[english]{babel}

\listfiles

\KOMAoptions{paper=letter,fromphone=true,fromfax=false}

\begin{document}

\setkomavar{fromname}{Stephen Bosch}
\setkomavar{fromaddress}{10 Lemon Lane \\ Sour Orchards BC V0E 0B0}
\setkomavar{fromphone}{+1 250 377 4141}

\begin{letter}{Tremulor Nocharme \\ Compliance Officer \\ Special TPS Police
\\ Fram Jammer Building \\ 320, 220 -- 4 Street \\ Treacleton AB T0M 0M0}

\setkomavar{subject}{Late TPS reports 2008, 2009, 2010, 2011, 2012}

\opening{Dear Mr. Nocharme,}

Attached please find the TPS reports you requested. Please accept my apologies for the delay.\\

\closing{Sincerely,}

\end{letter}

\end{document}

I no longer receive the warning, but the output is still A4.

In addition, when I try to simplify my MWE further by removing the

\usepackage[english]{babel}

line, I get a series of very strange errors:

! Undefined control sequence.
\select@language ... \@empty }\languageshorthands 
                                                  {none}\babel@beginsave \cs...
l.8 \begin{document}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
\select@language ...me \relax \babel@savevariable 
                                                  \lefthyphenmin \babel@save...
l.8 \begin{document}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

! Undefined control sequence.
\select@language ...hyphenmin \babel@savevariable 
                                                  \righthyphenmin \expandaft...
l.8 \begin{document}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Class scrlttr2 Info: used language is `english'.
(scrlttr2)           Supported languages are `english', `UKenglish',
(scrlttr2)           `british', `american', `USenglish',
(scrlttr2)           `german', `ngerman', `austrian', `naustrian',
(scrlttr2)           `dutch', `italian', `spanish',
(scrlttr2)           `croatian', `finnish', `norsk' on input line 8.

Note: I get this error even though I have deleted all the output files (including aux)! To my knowledge, KOMA-Script and DIN.lco do not require babel, and yet the error messages suggest that there are babel leftovers somewhere. If so, I know not where, because I have deleted everything that I can see prior to compiling. I have read this post and this post already.

The files used (from \listfiles) are:

 *File List*
scrlttr2.cls    2012/07/29 v3.11b KOMA-Script document class (letter)
scrkbase.sty    2012/07/29 v3.11b KOMA-Script package (KOMA-Script-dependent ba
sics and keyval usage)
 scrbase.sty    2012/07/29 v3.11b KOMA-Script package (KOMA-Script-independent 
basics and keyval usage)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
scrlfile.sty    2012/06/15 v3.12 KOMA-Script package (loading files)
scrsize12pt.clo    2012/07/29 v3.11b KOMA-Script font size class option (12pt)
typearea.sty    2012/07/29 v3.11b KOMA-Script package (type area)
     DIN.lco    2012/07/29 v3.11b KOMA-Script letter-class-option
UScommercial9.lco
 ***********

In case it is relevant, I am using XeTeX when compiling.

Best Answer

Please try the following MWE (I have changed your MWE a little bit). It should do what you want:

\documentclass[UScommercial9,paper=letter]{scrlttr2} % <==== changed
\usepackage[english]{babel}
\usepackage[pass]{geometry}                          % <==== changed

\KOMAoptions{fromphone=true,fromfax=false}           % <==== changed

\begin{document}

\setkomavar{fromname}{Stephen Bosch}
\setkomavar{fromaddress}{10 Lemon Lane \\ Sour Orchards BC V0E 0B0}
\setkomavar{fromphone}{+1 250 377 4141}

\begin{letter}{Tremulor Nocharme \\ Compliance Officer \\ Special TPS Police
\\ Fram Jammer Building \\ 320, 220 -- 4 Street \\ Treacleton AB T0M 0M0}

\setkomavar{subject}{Late TPS reports 2008, 2009, 2010, 2011, 2012}

\opening{Dear Mr. Nocharme,}

Attached please find the TPS reports you requested. Please accept my apologies for the delay.\\

\closing{Sincerely,}

\end{letter}

\end{document}

The trick is that your tex distribution has a standard paper size of A4. With the command \usepackage[pass]{geometry} you advice LaTeX to use the given paper size of the MWE. With pdfLaTeX and XeTeX it works.

Update: I didn't know KOMA-Script option pagesize (thanks @Josef) which also forces LaTeX to write a pdf file with the given paper size, here letter. So you can change my MWE to (only first changed lines):

\documentclass[%
  paper=letter  % paper size
 ,pagesize      % force given paper size in pdf
 ,UScommercial9 % Beta version for testing
]{scrlttr2}
\usepackage[english]{babel}

\KOMAoptions{fromphone=true,fromfax=false}

Update 2: Since KOMA-Script 3.17 option pagesize is default. So you don't need to set it explicitly or to load geometry (Comment of @Schweinebacke).

Related Question