1

How do you define the fromaddress position and size using a scrlttr2 template?

For the receiver's address, it can be done as follows

%These commands work
\@setplength{toaddrhpos}{1cm}
\@setplength{toaddrvpos}{1cm}
\@setplength{toaddrheight}{5cm}
\@setplength{toaddrwidth}{10cm}

but if the sender's address is defined as follows,

\setkomavar{fromaddress}{Road \\ Street \\ Town}

Then the following should affect the fromaddress location

%These commands don't work
\@setplength{fromaddrhpos}{1cm}
\@setplength{fromaddrvpos}{1cm}
\@setplength{fromaddrheight}{5cm}
\@setplength{fromaddrwidth}{10cm}

Unfortunately, these commands are not recognised? Must the fromaddress location be defined differently?

Below is a minimal example of the letter

\documentclass[
    pagenumber=false, 
    parskip=half,
    fromalign=right,
    foldmarks=false, 
    addrfield=true, 
    backaddress=off
    ]{scrlttr2}

\usepackage[T1]{fontenc} % For extra glyphs (accents, etc)
\usepackage{stix} % Use the Stix font by default
\usepackage[english]{babel}

\renewcommand*{\raggedsignature}{\raggedright} % Stop the signature from indenting
\makeatletter
  \@setplength{toaddrhpos}{2.5cm}
  \@setplength{toaddrvpos}{0.5cm}
  \@setplength{toaddrheight}{3.5cm}
  \@setplength{toaddrwidth}{10cm} 
\makeatother


\setkomavar{fromname}{Joe Bloggs} % Your name used in the from address

\setkomavar{fromaddress}{Street \\ Town \\ City} % Your address

\setkomavar{signature}{Joe Bloggs} % Your name used in the signature

\date{\today} % Date of the letter

%----------------------------------------------------------------------------------------
 
\begin{document}

%----------------------------------------------------------------------------------------
%   ADDRESSEE
%----------------------------------------------------------------------------------------
 
\begin{letter}{Joe Blogg's Friend \\ Street \\ Town \\ City} 

%----------------------------------------------------------------------------------------
%   LETTER CONTENT
%----------------------------------------------------------------------------------------

\opening{Dear Joe Blogg's Friend,}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam aliquet tellus vel justo porta et semper libero rutrum. Duis vestibulum sagittis aliquam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus ac velit eu dolor lobortis fringilla. Quisque imperdiet porta ante in pretium. Maecenas facilisis varius metus et blandit. Proin rhoncus arcu non ante elementum non vehicula sem varius. Morbi feugiat, elit eget tristique posuere, urna eros vestibulum nibh, at tempus neque justo nec enim.

Curabitur id est enim. Suspendisse potenti. Fusce eleifend sodales tortor, a interdum tortor sollicitudin vel. Morbi vel tellus enim, eget hendrerit ligula. Proin molestie suscipit erat, eget consectetur orci convallis at. Ut vestibulum, odio vitae blandit dignissim, dui magna auctor leo, at molestie augue magna sed nisi. Phasellus ipsum magna, fringilla id tempor id, tristique vitae mauris. Maecenas sed orci vel eros consectetur ultrices.

Mauris enim velit, feugiat at venenatis eu, scelerisque vitae mauris. Nullam accumsan facilisis mauris sagittis iaculis. Mauris condimentum dictum libero. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nullam consequat malesuada feugiat. Vestibulum tempor commodo turpis id gravida.

\closing{Sincerely,}

\end{letter}
 
\end{document}
2
  • Welcome to TeX.SE! With an current version of KOMA-Script you can use command \setplength ...
    – Mensch
    Oct 20, 2021 at 21:26
  • In the documentation you can see in table 4.2 all defined pseudo lengthes. Your last listed pseudo length are not defined ... Can you please show a short TeX code with your letter without personal informations in your question?
    – Mensch
    Oct 20, 2021 at 21:37

1 Answer 1

1

The address of the sender is located in a field called "location". The pseudo length definition for location are:

 %These commands do work for location <==================================
\setplength{lochpos}{1cm}
\setplength{locvpos}{1cm}
\setplength{locheight}{5cm}
\setplength{locwidth}{10cm}

With the following compiling TeX code (included option visualize to show the location field and others ...)

\documentclass[%
  pagenumber=false, 
  parskip=half,
  fromalign=locationright, % <==========================================
  foldmarks=false, 
  addrfield=true, 
  backaddress=off,
  visualize, % <========================================= to show fields
]{scrlttr2}

\usepackage[T1]{fontenc} % For extra glyphs (accents, etc)
\usepackage{stix} % Use the Stix font by default
\usepackage[english]{babel}

\renewcommand*{\raggedsignature}{\raggedright} % Stop the signature from indenting

\setplength{toaddrhpos}{2.5cm}
\setplength{toaddrvpos}{0.5cm}
\setplength{toaddrheight}{3.5cm}
\setplength{toaddrwidth}{10cm} 

\setkomavar{fromname}{Joe Bloggs} % Your name used in the from address
\setkomavar{fromaddress}{Street \\ Town \\ City} % Your address
\setkomavar{signature}{Joe Bloggs} % Your name used in the signature
\setkomavar{date}{\today} % Date of the letter <=========================

%These commands do work for location <==================================
\setplength{lochpos}{1cm}
\setplength{locvpos}{1cm}
\setplength{locheight}{5cm}
\setplength{locwidth}{10cm}
\showfields{head,address,location,refline,foot} % <======= for visualize

%----------------------------------------------------------------------------------------
 
\begin{document}

%----------------------------------------------------------------------------------------
%   ADDRESSEE
%----------------------------------------------------------------------------------------
 
\begin{letter}{Joe Blogg's Friend \\ Street \\ Town \\ City} 

%----------------------------------------------------------------------------------------
%   LETTER CONTENT
%----------------------------------------------------------------------------------------

\opening{Dear Joe Blogg's Friend,}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam aliquet 
tellus vel justo porta et semper libero rutrum. Duis vestibulum sagittis 
aliquam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Phasellus ac velit eu dolor lobortis fringilla. Quisque imperdiet porta 
ante in pretium. Maecenas facilisis varius metus et blandit. Proin 
rhoncus arcu non ante elementum non vehicula sem varius. Morbi feugiat, 
elit eget tristique posuere, urna eros vestibulum nibh, at tempus neque 
justo nec enim.

Curabitur id est enim. Suspendisse potenti. Fusce eleifend sodales tortor, a interdum tortor sollicitudin vel. Morbi vel tellus enim, eget hendrerit ligula. Proin molestie suscipit erat, eget consectetur orci convallis at. Ut vestibulum, odio vitae blandit dignissim, dui magna auctor leo, at molestie augue magna sed nisi. Phasellus ipsum magna, fringilla id tempor id, tristique vitae mauris. Maecenas sed orci vel eros consectetur ultrices.

Mauris enim velit, feugiat at venenatis eu, scelerisque vitae mauris. Nullam accumsan facilisis mauris sagittis iaculis. Mauris condimentum dictum libero. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nullam consequat malesuada feugiat. Vestibulum tempor commodo turpis id gravida.

\closing{Sincerely,}

\end{letter}
 
\end{document}

you get the following result:

resulting part of pdf

1
  • @esdd Yep, I oversaw that, thanks.
    – Mensch
    Oct 21, 2021 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.