0

This is perhaps the companion question to Adding text immediately after the main text of a scrlttr2 letter.

I have a use case where I want to make a comment on a letter before actually starting the salutation (e.g. Dear...). I'd like it to look like a normal paragraph, but it doesn't matter if it doesn't have an indentation.

In this case, it's a short comment on the letter's addressee.

So, this naturally comes after the subject, and before the \opening. Does scrlttr2 provide any support for this? I could not find anything.

I tried adding some text after \begin{letter} and before \opening, but it just ended up in the middle of the address. I also looked through the KOMA-Script documentation, but did not find anything relevant.

MWE follows:

\RequirePackage{iftex}
\RequireLuaTeX
\documentclass[12pt]{scrlttr2}
\usepackage{fontspec}
\setmainfont[Scale=0.93]{TeX Gyre Schola}
\begin{document}
\setkomavar{fromname}{Harry Potter}
\setkomavar{fromaddress}{The Cupboard under the Stairs\\ 4 Privet Drive\\ Little Whinging, Surrey}
\setkomavar{firsthead}{%                                                                                                        
    {\fontspec{TeX Gyre Chorus}                                                                                                 
      \usekomavar{fromname}\\                                                                                                   
      \usekomavar{fromaddress}\\                                                                                                
    }                                                                                                                           
  }%                                                                                                                            
\def\today{3rd December, 1999}
\begin{letter}{Ronald Weasley\\The Burrow\\
    Ottery St Catchpole, Devon,\\
    West Country, England}

  (I am sending this letter via regular mail, not owl.)% Comment to be placed between subject and opening.

  \opening{Dear Ron,}
  Looking forward to my visit!
  \closing{Yours,}
\end{letter}
\end{document}
5
  • 4
    On the linked question you got -1 from Henri Menke because you had 3k reputation and didn't provide an MWE - now it's my turn to downvote, four years and 4k reputation later.
    – Marijn
    Commented Nov 29, 2021 at 15:09
  • I solved this issue by adding after \opening this code: \llap{\begin{picture}(0,0) \put(0,147){ \emph{My comment}} \end{picture}}
    – Keks Dose
    Commented Nov 30, 2021 at 9:32
  • 1
    If you want the comment below the subject: \setkomavar{subject}{Subject\par\normalfont\normalsize\normalcolor Comment}. This works even if you use option subject=titled.
    – esdd
    Commented Nov 30, 2021 at 10:23
  • @KeksDose Thank you for the suggestion. But it seems better if the comment is integrated into the letter format in some way. But do leave an answer if you wish. Commented Dec 3, 2021 at 18:50
  • Hi @esdd. I tried your suggestion. It would be nice if there was a custom field for such a purpose, but I can understand if there is not. The problem with adding it to the Subject is that there is then no space between the Subject and the comment. I tried adding space, but I guess it didn't work because it's in a box? In any case, feel free to write an answer. Commented Dec 3, 2021 at 20:23

1 Answer 1

1

If you want the comment below the subject:

\setkomavar{subject}{Subject\par\normalfont\normalsize\normalcolor Comment}

This works even if you use option `subject=titled*.

Example:

\documentclass[
  12pt,% default with scrlttr2
  %subject=titled
]{scrlttr2}
\usepackage{fontspec}
\setmainfont[Scale=0.93]{TeX Gyre Schola}
\begin{document}
\setkomavar{fromname}{Harry Potter}
\setkomavar{fromaddress}{The Cupboard under the Stairs\\ 4 Privet Drive\\ Little Whinging, Surrey}
\setkomavar{firsthead}{%
  {\fontspec{TeX Gyre Chorus}
    \usekomavar{fromname}\\
    \usekomavar{fromaddress}
  }
}
\setkomavar{date}{3rd December, 1999}% do not redefine \today
\begin{letter}{Ronald Weasley\\The Burrow\\
  Ottery St Catchpole, Devon,\\
  West Country, England}
\setkomavar{subject}{
  A long, long, long, long, long, long letter subject that spans over more than one line
  \par\bigskip
  \normalfont\normalsize\normalcolor
  (I am sending this letter via regular mail, not owl.)% Comment to be placed between subject and opening.
}

  \opening{Dear Ron,}
  Looking forward to my visit!
  \closing{Yours,}
\end{letter}
\end{document}

Result:

enter image description here

or with enabled option subject=titled:

enter image description here

2
  • Looks good, thank you. Can you elaborate on why \bigskip works here, and \vspace and variants like \\[ ] don't? Commented Dec 4, 2021 at 18:36
  • 1
    You can replace \bigskip by \vspace{...}. It is also possible to replace \par\bigskip} by \\[...]. Then, in case of option subject=titled, the comment is intented like the subject text. But it is of course not possible to use \par\\[...].
    – esdd
    Commented Dec 4, 2021 at 19:04

You must log in to answer this question.

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