1

Using KOMA letter class scrlttr2, what is the right way to fit a longer address?

What's the right way to change only the address font size?

2
  • What was the result of the update?
    – Sveinung
    Commented Nov 20, 2019 at 8:07
  • I'm actually having trouble with my package manager, so this may be the reason your initial suggestion didn't work. Works with the "legacy" answer, though - thanks!
    – Zubo
    Commented Nov 20, 2019 at 11:12

1 Answer 1

2

Font size

You can change the font size for the address field by using the command \addtokomafont with the field name and the font declaration as arguments:

\addtokomafont{addressee}{\large}  %% or `\small`

Address field

You change the height and width of the address field by setting two different KOMA-script pseudo length, see page 501–502 in the manual. I cite from the manual:

\setplength{toaddrheight}{length }

This pseudo-length defines the height of the address field, including the delivery method. Whether the name and address of the recipient are vertically centred in the address field, taking into account the presence or absence of the delivery method, depends on the addrfield option.

\setplength{toaddrwidth}{length }

This pseudo-length defines the width of the address field. The various predefined lco files use different settings according to the different standards for window envelopes. Typical values are between 70mm and 100 mm.

In the preamble of your letter, you add the two commands, for example:

\setplength{toaddrheight}{50mm}
\setplength{toaddrwidth}{110mm}

You may instead use the command \addtoplength to add to a length to an existing plength:

\addtoplength{toaddrwidth}{10mm} 
\addtoplength{toaddrheight}{10mm}

which will add 1 cm to the existing height and width.

IN CASE OF OUTDATED SYSTEM

If you have an outdated version of KOMA-script you have to use two low level commands instead of the two I suggested:

\makeatletter
\@setplength{toaddrwidth}{105mm}
\@setplength{toaddrheight}{35mm}
\makeatother

Here is an MWE (for an updated system), borrowed from the manual and adapted. Instruction for outdated systems is added as commented code:

enter image description here

\documentclass[visualize]{scrlttr2}
\usepackage{xcolor}
\setkomafont{field}{\color{yellow}}
\setkomafont{measure}{\color{red}\small}
\setkomafont{letter}{\color{green}}
\showfields{head,address,location,refline,foot}
\usepackage[british]{babel}
\usepackage{lipsum}

\addtoplength{toaddrwidth}{30mm} 
\addtoplength{toaddrheight}{10mm}
%% If you have a outdated system, comment out (i.e. add a per cent sign)
%% the two lines above and instead use:

%\makeatletter
%\@setplength{toaddrwidth}{105mm}
%\@setplength{toaddrheight}{35mm}
%\makeatother
%% Remove the % from the for lines (not this line)

\begin{document}
\setkomavar{fromname}{Joe Public}
\setkomavar{fromaddress}{2 Valley\\
SAMPLEBY\\
ZY32 1XW}
\begin{letter}{%
1 Hillside\\
10 Downside\\
112 Uphill on the Upside of the green River behind the bush
SAMPLESTEAD\\
WEARDSHIRE\\
WX12 3YZ\\
A STRANGE COUNTRY%
}
\opening{Hello,}
\lipsum[1]
\closing{Good bye}
\end{letter}
\setlength{\unitlength}{1cm}
\renewcommand*{\unitfactor}{10}
\showISOenvelope{DL}
\end{document}
6
  • Thanks for the answer! However, I get an undefined control sequence. \setplength error when adding the two commands - any idea where that comes from? Same error when using your MWE.
    – Zubo
    Commented Nov 19, 2019 at 21:47
  • I am referring to the MWE you provided. I do have the KOMA letter class, because your MWE works when the two commands are removed.
    – Zubo
    Commented Nov 19, 2019 at 21:51
  • 1
    It seems that you have a really outdated version of KOMA-script, or use Overleaf, which also have a old an outdated system. See updated answer.
    – Sveinung
    Commented Nov 19, 2019 at 21:59
  • No Overleaf, but am currently updating the packages; will comment as soon as it is done, thanks!
    – Zubo
    Commented Nov 19, 2019 at 22:01
  • 1
    I have updated the code with code for font size change. However, since this is a different question, you should have asked a new question.
    – Sveinung
    Commented Nov 19, 2019 at 22:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .