Scrlttr2 - 将日期从收件人和发件人地址的下方移动到两者之间

Scrlttr2 - 将日期从收件人和发件人地址的下方移动到两者之间

默认sclttr2行为的格式如下:

RIGHT_ALIGNED(发件人地址)
LEFT_ALIGNED(收件人地址)
RIGHT_ALIGNED(日期)

我想将其更改为:

RIGHT_ALIGNED(发件人地址)
RIGHT_ALIGNED(日期)
LEFT_ALIGNED(收件人地址)

它们之间留有合理的间隙。我正在使用

\documentclass[
fontsize=11pt,
paper=a4,
parskip=full,
enlargefirstpage=off,
fromalign=right,
fromphone=off,
fromrule=off,
addrfield=on,
backaddress=off,
foldmarks=no,
pagenumber=false,
refline=nodate,
]{scrlttr2}
\usepackage{lipsum}
\usepackage[british]{babel}
\usepackage{tabularx}
\usepackage{booktabs}
\LoadLetterOption{DIN}
\setkomavar{fromname}{NAME}
\setkomavar{fromaddress}{ADDRESS\\ADDRESS\\ADDRESS\\ADDRESS\\ADDRESS\\ADDRESS\\ADDRESS\\}
\setkomavar{location}{\usekomavar{date}}
\begin{document}
    \begin{letter}{address}
    \opening{}
        \begin{center}  
            \begin{tabular}{cccccc}
                \toprule
                Item & Unit Price & Quantity & Sub-Total & VAT \% & VAT\\
                \bottomrule
            \end{tabular}
        \end{center}
    \closing{}
    \end{letter}
\end{document}

成功将日期置于两个地址之间,但将其置于非常靠近发件人地址底线的位置(有时会将其叠加到发件人地址上)。它也没有完全右对齐日期,它比上面的地址离右边距远几毫米。我猜这与\vboxXeLaTeX 抱怨的过满有关:

Class scrlttr2 Warning: head of first page is 13.0448pt too high.
(scrlttr2)              You have to change `firstheadvpos'
(scrlttr2)              or you have to define a smaller
(scrlttr2)              head of first page using \setkomavar.
(scrlttr2)              Because of this too high head of first page
(scrlttr2)              you've got an overfull \vbox message on input line 30.

我猜解决方案就是,正如它所说的\setkomavar,但我不知道将其设置为何。

答案1

一种可能性是

\setkomavar{location}{\par\bigskip\raggedleft\usekomavar{date}}

在此处输入图片描述

相关内容