I have taken the simple example from the KOMA script guide from page 166-167 (pdf). I now wish to introduce a company name in the line before (or after) my name. I would naively do so by changing
\setkomavar{fromname}{John Public}
to
\setkomavar{fromname}{Company Name\\John Public}
However, this breaks compilation. The error message is
! Undefined control sequence.
\@gnewline ...\@nolnerr \else \unskip \reserved@e
{\reserved@f #1}\nobreak \...
l.24 \closing{Expecting an invitation}
Consequently, removing the \closing{}
command correctly renders the document, but, obviously, without a closing. Note, that I am not actually concerned about the closing, I just want it to work as usual.
Questions:
- How do I properly add a company name to the
from
variables, i.e., the return address? - What causes this weird error?
Full example:
\documentclass[foldmarks=true,foldmarks=blmtP,
fromalign=false,fromrule=afteraddress,
fromphone,fromemail,
version=last]{scrlttr2}
\usepackage[english]{babel}
\begin{document}
%\setkomavar{fromname}{John Public}
\setkomavar{fromname}{Company Name\\John Public}
\setkomavar{fromaddress}{Valley 2\\
54321 Public-Village}
\setkomavar{fromphone}{0\,12\,34~56\,78}
\setkomavar{fromemail}{Peter@Public.invalid}
\begin{letter}{%
Joana Public\\
Hillside 1\\
12345 Public-City%
}
\opening{Dear chairman,}
the last general meeting was about one year ago.
I want to remind you, that the constitution of our
club advises you to make a general meeting every
six month. Because of this I expect the executive
board to detain such a meeting immediately.
\closing{Expecting an invitation}
\ps PS: I hope you accept this as an friendly
demand note.
\setkomavar*{enclseparator}{Enclosure}
\encl{Compendium of the constitution with the
general meeting paragraphs.}
\cc{executive board\\all members}
\end{letter}
\end{document}
Best Answer
0. The hack
The hack that (for the time being) may solve your problem, is using
\linebreak
instead of\\
.(Works for me; your mileage may vary!)
1. Company name in signature
To add the company name in the signature, you may try to redefine the KOMA-variable
signature
. Here is how I have set up my system:In a general company .LCO
In my personal .LCO
Using
\closing
gives me the desired output. I load the company .LCO and my personal .LCO in a template .tex-file.\providecaptionname
gives you the possibility to usebabel
and multiple language. I use\linebreak\
instead of\\
, and2. Company name in back address
To have company name in back address line (see manual page 160 ff.):
3. Company name in first page header
You have to redefine
firsthead
to achieve this: