0

The KOMA Script guide says on page 214:

The reference line can actually be longer than just one line. It is printed only if at least one of variables for the reference line is not empty. Only non-empty fields will be printed. To set a seemingly empty field, you can provide content for the variable that appears empty, such as \mbox{}. If the reference line is omitted, the description and contents of the date variable are printed in its place.

Further on page 215:

The date is usually output as part of the reference line. If all other elements of the reference line are empty, a date line consisting of the location and the date is printed instead. (Emphasis mine)

I would like to combine these options. That is, I would like to have a reference line with information such as an invoice number, but I would also like the date to be printed as location, date; e.g. Birmingham, 15th August 2023

A MWE that displays the date with location as I would like it would be:

\documentclass{scrlttr2}
\setkomavar{place}{Birmingham}
\begin{document}
\begin{letter}{Recipients, Inc.\\1 High Street\\London\\AB1 2CD}
\opening{Dear Sirs or Madams,}
Please acknowledge this letter.
\closing{Yours faithfully}
\end{letter}
\end{document}

In this example, instead of a reference line the date is output as Birmingham, August 15, 2023. (The US date format versus UK is not of concern here.)

A MWE that includes other reference line data would be:

\documentclass{scrlttr2}
\setkomavar{place}{Birmingham}
\setkomavar{invoice}{123456789}
\begin{document}
\begin{letter}{Recipients, Inc.\\1 High Street\\London\\AB1 2CD}
\opening{Dear Sirs or Madams,}
Please acknowledge this letter.
\closing{Yours faithfully}
\end{letter}
\end{document}

In this MWE, the invoice no. is included in the reference line. The date is printed on the right as August 15, 2023 under a smaller text saying Date as part of the reference line.

Is there a way to have the date displayed as in the first MWE but a reference line as in the second MWE (the small text saying Date should be omitted)?

Obviously, a quick and cheap hack is to add \setkomavar{date}[]{Birmingham, \today} to the preamble. Or, for the more versatile option: \setkomavar{date}[]{\usekomavar{place}, \today}. But is there not a more elegant option that I could select to achieve this?

Jan
  • 829

0 Answers0