删除 LaTeX 信件包 scrrttr2 中发件人/收件人之间的垂直空白

删除 LaTeX 信件包 scrrttr2 中发件人/收件人之间的垂直空白

我正在使用響鳴2包裹。

我研究了很多关于如何处理发件人收件人部分(仅在第一页的顶部)大小的问题。使用该geometry包不起作用,因为它不会影响发件人和收件人文本框,只会影响正文。但是,我无法找到该问题的解决方案。我找到了 scrlttr2 包这里,但没有办法“伪长度”(第 166 页)来减少发送者和接收者之间的空白。

我想减少这个空间:

在此处输入图片描述

这是我的代码,发件人信息在一个文件中sender.lco

\documentclass[
    sender,
    paper=a4,
    version=last,
    firstfoot=false,
    fontsize=10pt,
    DIV=13,
    BCOR=0mm]{scrlttr2}
\parskip3mm
\parindent5mm 
\usepackage[english,ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}

\usepackage{lmodern}
\renewcommand*\familydefault{\sfdefault}
\usepackage[T1]{fontenc}

\usepackage{changepage}

\changepage{1cm}{0cm}{-1cm}{0cm}{0cm}{0cm}{0cm}{0cm}{0cm}

\begin{document}


\setkomavar{subject}{Reference: Letter }
\setkomavar{date}{ \today}
\setkomavar{place}{XXX}

\setplength[]{baselineskip}{0.25cm}

% Set recipient of letter
\begin{letter}{
    \textbf{TO}:  
XXX\\
XXX\\
XXX
}
\opening{To whom it may concern,}

% Write here your Letter text. You can choose here the language for typeset. ("english", or "ngerman")
\selectlanguage{english}

Body texttttttttttttttttt

\closing{Respectfully Yours,} % use "Mit freundlich Grüßen" i.e. 
\end{letter}

\end{document}

答案1

你可以使用

\LoadLetterOption{visualize}
\showfields{head,address,refline}

可视化第一个标题、地址字段和参考行的位置(示例中仅为日期)。

也许您只是想加载字母类别选项DINmtext.lco

\documentclass[
    %sender,% there is no sender.lco given in the question
    paper=a4,
    version=last,
    firstfoot=false,
    enlargefirstpage,% <- added
    fontsize=10pt,
    DIV=13,
    BCOR=0mm,
    DINmtext
    ]{scrlttr2}
\setkomavar{fromname}{Max Mustermann}% <- added
\setkomavar{fromaddress}{YYY\\YYY}%<- added

\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc}% needed with old (outdated) TeX distributions
\usepackage[english,ngerman]{babel}
\usepackage{csquotes}
\usepackage{lmodern}

\setparsizes{3mm}{5mm}{0pt plus 1fil}% par skip 3mm, par indent 5mm
\renewcommand*\familydefault{\sfdefault}

%\usepackage{changepage}
%\changepage{1cm}{0cm}{-1cm}{0cm}{0cm}{0cm}{0cm}{0cm}{0cm}

\usepackage{blindtext}% only for dummy text
% visualize positions of head, address, refline in the example:
\LoadLetterOption{visualize}
\showfields{head,address,refline}

\begin{document}
%\setplength[]{baselineskip}{0.25cm}% undefined

\begin{letter}{
    \textbf{TO}:  
XXX\\
XXX\\
XXX
}
\setkomavar{subject}{Reference: Letter }
\setkomavar{date}{ \today}
\setkomavar{place}{XXX}
\selectlanguage{english}
\opening{To whom it may concern,}
\Blindtext[2]
\closing{Respectfully Yours,} % use "Mit freundlich Grüßen" i.e. 
\end{letter}
\end{document}

在此处输入图片描述


免责声明:我不会改变地址栏的位置和/或引用行(日期),也不会改变地址栏的大小。如果你这样做,你就不能使用窗口包围。

但如果您确实想这样做,可以调整地址字段和重新行的垂直位置。但是,地址字段中的反向地址是无用的。

\documentclass[
    %sender,% there is no sender.lco given in the question
    paper=a4,
    version=last,
    firstfoot=false,
    enlargefirstpage,% <- added
    fontsize=10pt,
    DIV=13,
    BCOR=0mm,
    addrfield=topaligned,% <- added: top align address in address field
    backaddress=false% <- added: back address is useless, if the position of address field is changed
    ]{scrlttr2}
\setkomavar{fromname}{Max Mustermann}% <- added
\setkomavar{fromaddress}{YYY\\YYY}%<- added

\usepackage[T1]{fontenc}
%\usepackage[utf8]{inputenc}% needed with old (outdated) TeX distributions
\usepackage[english,ngerman]{babel}
\usepackage{csquotes}
\usepackage{lmodern}

\setparsizes{3mm}{5mm}{0pt plus 1fil}% par skip 3mm, par indent 5mm
\renewcommand*\familydefault{\sfdefault}

%\usepackage{changepage}
%\changepage{1cm}{0cm}{-1cm}{0cm}{0cm}{0cm}{0cm}{0cm}{0cm}

\setplength{toaddrvpos}{\useplength{firstheadvpos}}
\addtoplength{toaddrvpos}{5\baselineskip}% adjust height reserved for first page header plus vertical sep before address field

\setplength{backaddrheight}{0pt}% remove space for backaddress
\setplength{toaddrheight}{5\baselineskip}% adjust height reserved for address

\setplength{refvpos}{\useplength{toaddrvpos}}
\addtoplength{refvpos}{\useplength{toaddrheight}}
\addtoplength{refvpos}{\baselineskip}% adjust sep between address field and refline


\usepackage{blindtext}% only for dummy text
% visualize positions of head, address, refline in the example:
\LoadLetterOption{visualize}
\showfields{head,address,refline}

\begin{document}
%\setplength[]{baselineskip}{0.25cm}% undefined

\begin{letter}{
    \textbf{TO}:  
XXX\\
XXX\\
XXX
}
\setkomavar{subject}{Reference: Letter }
\setkomavar{date}{ \today}
\setkomavar{place}{XXX}
\selectlanguage{english}
\opening{To whom it may concern,}
\Blindtext[2]
\closing{Respectfully Yours,} % use "Mit freundlich Grüßen" i.e. 
\end{letter}
\end{document}

在此处输入图片描述

相关内容