2

Using emacs org-mode and the koma letter script, how can I align the signature part to the left? Setting raggedsignature as suggested in other posts, makes no difference

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

#+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.

img

1

I am not familiar with emacs org-mode. But I get a similar result using the following MWE:

\documentclass[foldmarks,backaddress=false]{scrlttr2}
\usepackage{lipsum}% only for dummy text
\usepackage{graphicx}
\renewcommand\raggedsignature{\raggedright}
\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}

In the SN.lco you can find

\let\raggedsignature=\centering

which overwrites the \renewcommand\raggedsignature{\raggedright}.

So you have to ensure that SN.lco is loaded before your own redefinition of \raggedsignature. Maybe you can ensure this by changing the order of the code in your org file? If this is not possible, there are two other suggestions below.


Using \AtBeginLetter

\documentclass[foldmarks,backaddress=false]{scrlttr2}
\usepackage{lipsum}% only for dummy text
\usepackage{graphicx}
\AtBeginLetter{\renewcommand{\raggedsignature}{\raggedright}}% <- changed
\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}

Result:

enter image description here

Another possibility is \AfterFile{SN.lco}{\renewcommand{\raggedsignature}{\raggedright}}.


Using a custom lco file:

You could define your own lco file mySN.lco:

\ProvidesFile{mySN.lco}[2019/03/31 letter-class-option]
\LoadLetterOption{SN}
\let\raggedsignature=\raggedright
\endinput

Place this file in a directory where LaTeX will find it. Then you can use mySN instead SN to get the desired result:

\documentclass[foldmarks,backaddress=false]{scrlttr2}
\usepackage{lipsum}% only for dummy text
\usepackage{graphicx}
\LoadLetterOption{mySN}% <- changed
\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.

  • 1
    #+LATEX_HEADER: \AtBeginLetter{\renewcommand{\raggedsignature}{\raggedright}} did the trick – 412p9wej Mar 31 '19 at 15:12

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.