0

Using emacs org-mode and the koma letter script, how can I set the vertical address position?

The 1manual at p.484 displays a nice 2overview of position possibilities. However, neither of these lines result as expected:

#+LATEX_HEADER: \setplength{toaddrvpos}{5cm}

#+LATEX_HEADER: \@setplength{toaddrvpos}{5cm}

Example.org

#+LATEX_CLASS: default-koma-letter
#+LATEX_HEADER: \setkomavar{signature}{\includegraphics[height=1cm]{signature.png}\\\usekomavar{fromname}}
#+LCO: SN
#+LANGUAGE: en
#+LATEX_HEADER: \setplength{toaddrvpos}{5cm}

#+AUTHOR: Bugs Bunny
#+TO_ADDRESS: Batman
#+SUBJECT: My subject
#+OPENING: My opening
#+CLOSING: My closing
#+FROM: From me

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec hendrerit tempor
tellus. Donec pretium posuere tellus. Proin quam nisl, tincidunt et, mattis
eget, convallis nec, purus. Cum sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus. Nulla posuere. Donec vitae dolor.
Nullam tristique diam non turpis. Cras placerat accumsan nulla. Nullam rutrum.
Nam vestibulum accumsan nisl.

Footnotes

1 http://texdoc.net/texmf-dist/doc/latex/koma-script/scrguien.pdf

2 img

3
  • 1
    You have to ensure that SN.lco is loaded before you change the pseudolength to an own value. So maybe it is the same issue as in your previous question? And the same solution?
    – esdd
    Apr 13, 2019 at 1:01
  • Thank you. Tried these as well: #+LATEX_HEADER: \AtBeginLetter{\renewcommand{\@setplength{toaddrvpos}{10cm}}} #+LATEX_HEADER: \AtBeginLetter{\renewcommand{@setplength{toaddrvpos}{10cm}}} #+LATEX_HEADER: \AtBeginLetter{\@setplength{toaddrvpos}{10cm}} #+LATEX_HEADER: \AtBeginLetter{@setplength{toaddrvpos}{10cm}}
    – jjk
    Apr 13, 2019 at 6:26
  • 2
    It is recommended to use a user defined lco file for basic settings like setting of pseudo-lengths (and even variables like fromname). In this lco file you could also use \LoadLetterOption{SN}. If you'd do so, you could simply replace #+LCO: SN by #+LCO:MyBasics. esdd has shown this solution already in her answer to your previous question. Apr 13, 2019 at 6:33

1 Answer 1

2

Define an own lco file (recommended solution):

\ProvidesFile{mySN.lco}[2019/04/13 letter-class-option]
\LoadLetterOption{SN}
\let\raggedsignature=\raggedright
\setplength{toaddrvpos}{10cm}
\endinput

Then

\documentclass[foldmarks,backaddress=false]{scrlttr2}
\usepackage{lipsum}% only for dummy text

\LoadLetterOption{visualize}% can be used only in preamble
\showfields{address}% visualize the position of the address field

\usepackage{graphicx}
\LoadLetterOption{mySN}% load the user defined lco file
\setkomavar{fromname}{Bugs Bunny}
\setkomavar{subject}{My Subject}
\setkomavar{signature}{\includegraphics[height=1cm]{example-image}\\\usekomavar{fromname}}

\begin{document}
\begin{letter}{Batman}
\opening{My opening}
\lipsum[1]
\closing{My closing}
\end{letter}
\end{document}

results in

screenshot

With older KOMA-Script versions (3.25 or earlier) you have to replace \setplength by \@setplength in the lco file.


With \AtBeginLetter and SN.lco:

\documentclass[foldmarks,backaddress=false]{scrlttr2}
\usepackage{lipsum}% only for dummy text

\LoadLetterOption{visualize}% can be used only in preamble
\showfields{address}% visualize the position of the address field

\usepackage{graphicx}
\AtBeginLetter{%
  \renewcommand{\raggedsignature}{\raggedright}%
  \setplength{toaddrvpos}{10cm}%
}
\LoadLetterOption{SN}
\setkomavar{fromname}{Bugs Bunny}
\setkomavar{subject}{My Subject}
\setkomavar{signature}{\includegraphics[height=1cm]{example-image}\\\usekomavar{fromname}}

\begin{document}
\begin{letter}{Batman}
\opening{My opening}
\lipsum[1]
\closing{My closing}
\end{letter}
\end{document}

The result is the same as above.

Note: With older KOMA-Script versions (3.25 or earlier) and this solution you have to replace

\setplength{toaddrvpos}{10cm}%

by

\makeatletter\@setplength{toaddrvpos}{10cm}\makeatother

because \AtBeginLetter is used in the preamble of the document.

0

You must log in to answer this question.

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