我有一个用例,我想在实际开始称呼之前对信件发表评论(例如亲爱的......)。我希望它看起来像一个普通的段落,但如果它没有缩进也没关系。
在这种情况下,这是对信件收件人的简短评论。
因此,这自然位于主题之后,之前\opening
。scrlttr2 是否为此提供任何支持?我找不到任何东西。
我尝试在 之后\begin{letter}
和 之前添加一些文本\opening
,但它最终只是出现在地址中间。我也查看了 KOMA-Script 文档,但没有找到任何相关内容。
MWE 如下:
\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}
答案1
如果您想在主题下发表评论:
\setkomavar{subject}{Subject\par\normalfont\normalsize\normalcolor Comment}
即使您使用选项“subject=titled*”,这也有效。
例子:
\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}
结果:
或启用选项subject=titled
: