1

I am writing a letter using KOMA-scripts scrlttr2-class. I would like to add a list of attachments at the end, and I would like that list to be at the same height as the closing, but on the right side of the document. Something like this:

Kind regards,                                                 Attachments:
                                                                * Attachment one
                                                                * Attachment two
My Name

It does not seem to be possible to put the \closing into a tabular. Is there any way to achieve this?

2

You could use a minipage instead of the tabular, somthing like:

\begin{minipage}{.5\textwidth}
  \closing{Kind regards,}
\end{minipage}%
\begin{minipage}{.5\textwidth}
  Attachments
   Att 1\\
   Att 2
\end{minipage}
  • Thanks! I didn't try this because I thought if it doesn't work in a tabular, why should it work in a minipage? Seems I was wrong. – Björn Pollex Jun 8 '11 at 12:43
  • 1
    your solution doesn't produce, in general, the desired vertical alignment. – Gonzalo Medina Jun 8 '11 at 23:40
2

Placing the \closing command inside a minipage and the Attachments into another one will not produce, in general, the desired alignment, as can be seen in the following example:

\documentclass{scrlttr2}

\begin{document}

\begin{minipage}{.5\textwidth}
  \closing{Kind regards,}
\end{minipage}%
\begin{minipage}{.5\textwidth}
  Attachments\\
   Att 1\\
   Att 2\\
   Att 3\\
   Att 4
\end{minipage}

\end{document}

resulting in

which shows that the line "Kind regards," is not aligned with the "Attachments" line (using the optional argument for the minipages placement won't make things any better).

One possible solution is to use the minipages inside the \closing command:

\documentclass{scrlttr2}

\begin{document}

\closing{
\parbox{\textwidth}{\begin{minipage}[t]{.5\textwidth}
Kind regards,
\end{minipage}%
\begin{minipage}[t]{.5\textwidth}
Attachments\\
Att 1\\
Att 2\\
Att 3\\
Att 4
\end{minipage}
}}

\end{document}

The result:

EDIT: and the necessary modification for the signature:

\documentclass{scrlttr2}

\setkomavar{signature}{\hspace*{1.5em}My Name}

\begin{document}

\closing{\raggedright
\parbox{\textwidth}{\begin{minipage}[t]{.5\textwidth}
Kind regards,
\end{minipage}%
\begin{minipage}[t]{.5\textwidth}
Attachments\\
Att 1\\
Att 2\\
Att 3\\
Att 4
\end{minipage}
}}

\end{document}
  • 1
    I just tested this, and it does not work either, because of the way KOMA automatically puts the name below the closing. The name will now appear in the center of the page, below the last line of the attachments. You can reproduce this by adding \setkomavar{fromname}{My Name} to the preamble. – Björn Pollex Jun 10 '11 at 9:35
  • @Space_C0wb0y: I couldn't possible guess all the settings of your particular document. Anyway, the solution is simple, see my updated answer. – Gonzalo Medina Jun 10 '11 at 14:54
  • This is an extreme ugly hack, isn't it? And the vertical position of the signature will depend on the number of attachments. – Schweinebacke Jun 3 '17 at 13:18
1

I would patch \closing to add the new attachment block, e.g., using a tabular:

\documentclass{scrlttr2}
\usepackage{mwe}

\usepackage{xpatch}
\makeatletter
\xpatchcmd{\closing}{%
    \parbox{\@tempdima}{\raggedsignature\strut\ignorespaces
      #1\ifhmode\unskip\strut\\[\useplength{sigbeforevskip}]
        \else\vskip \useplength{sigbeforevskip}\fi
      \strut\ignorespaces
      \usekomavar{signature}\ifhmode\unskip\strut\fi}%
}{%
    \parbox[t]{\@tempdima}{\raggedsignature\strut\ignorespaces
      #1\ifhmode\unskip\strut\\[\useplength{sigbeforevskip}]
        \else\vskip \useplength{sigbeforevskip}\fi
      \strut\ignorespaces
      \usekomavar{signature}\ifhmode\unskip\strut\fi}%
    \hfill
    \begin{tabular}[t]{@{}l@{}}
      \usekomavar*{attachments}\\
      \usekomavar{attachments}
    \end{tabular}
    \par
    \nobreak\vskip\baselineskip
}{}{}
\makeatother
\let\raggedsignature\raggedright

\newkomavar[Attachments]{attachments}

\begin{document}

\setkomavar{attachments}{Att 1\\Att 2\\Att 3\\Att 4}
\begin{letter}{You\\There}
\opening{Hello,}
\blindtext

\closing{Kind regards,}
\end{letter}
\end{document}

enter image description here

If you don't want the attachment block being right aligned, you can change the \hfill before the tabular. You could even define a new pseudo-length to have the distance configurable.

Note, I've not only added the tabular but also changed the \parbox to have it top aligned.

But note, that the patch above moves down the signature (as Gonzalo's answer does too). You could avoid this by adding \smash (here without changes \raggedsignature to see this difference too):

\documentclass{scrlttr2}
\usepackage{mwe}

\usepackage{xpatch}
\makeatletter
\xpatchcmd{\closing}{%
    \parbox{\@tempdima}{\raggedsignature\strut\ignorespaces
      #1\ifhmode\unskip\strut\\[\useplength{sigbeforevskip}]
        \else\vskip \useplength{sigbeforevskip}\fi
      \strut\ignorespaces
      \usekomavar{signature}\ifhmode\unskip\strut\fi}%
}{%
    \parbox[t]{\@tempdima}{\raggedsignature\strut\ignorespaces
      #1\ifhmode\unskip\strut\\[\useplength{sigbeforevskip}]
        \else\vskip \useplength{sigbeforevskip}\fi
      \strut\ignorespaces
      \usekomavar{signature}\ifhmode\unskip\strut\fi}%
    \hfill
    \smash{\begin{tabular}[t]{@{\textbullet\enskip}l@{}}
      \multicolumn1{@{}l@{}}{\usekomavar*{attachments}}\\
      \usekomavar{attachments}
    \end{tabular}}%
    \par
    \nobreak\vskip\baselineskip
}{}{}
\makeatother

\newkomavar[Attachments]{attachments}

\begin{document}

\setkomavar{signature}{It's me}
\setkomavar{attachments}{Att 1\\Att 2\\Att 3\\Att 4}
\begin{letter}{You\\There}
\opening{Hello,}
\blindtext

\closing{Kind regards,}
\end{letter}
\end{document}

enter image description here

But in this case the attachments could run into the bottom margin and even below it.

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.