Parskip 正在将我的页脚向下移动

Parskip 正在将我的页脚向下移动

为什么页脚(包含银行信息)被 parskip 向下移动了?

\documentclass[fontsize=12pt,
               DIN, A4,
               parskip=full, % removing this prevents the shift
              ]{scrlttr2}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[ngerman]{babel}

\usepackage[margin=20mm,
            inner=25mm,
            outer=20mm,
            bottom=30mm,
            ]{geometry}

\usepackage{ebgaramond}
\usepackage{blindtext}

\setlength{\footskip}{10mm}

% set the pagemark (page x of y)
\renewcommand*\pagemark{%
    \usekomafont{pagenumber}{\pagename~\thepage~von~\letterlastpage}%
    }

\setkomavar{firstfoot}{\hfill\pagemark}

% create pagemark also on first page
\newcommand{\originalopening}{}
\let\originalopening\opening
\renewcommand{\opening}[1]{\originalopening{#1}\thispagestyle{plain}}

\KOMAoptions{fromalign=off,
             pagenumber=botright,
            }

\newkomavar[BIC]{BIC}

\setkomavar{firstfoot}{%
    \hrule\vspace*{0.5em}\noindent%
    \usekomavar*{frombank}~\usekomavar{frombank} \hfill Sparkasse Deutschland \hfill
    \usekomavar*{BIC}~\usekomavar{BIC}}

% ===================================

\setkomavar{frombank}[IBAN]{DE98~1605~0000~7512~0130~19}
\setkomavar{BIC}{WELADED2PMB}

\setkomavar{toaddress}{Musterstraße 1}
\setkomavar{fromname}{Donald Duck \textit{\&} Daisy Duck}
\setkomavar{fromaddress}{Am Geldspeicher 1, 12345 Entenhausen}

\begin{document}
    \begin{letter}{Max Mustermann\\Musterstraße 1\\12345 Musterstadt}
        \opening{Hello,}
        \Blindtext
        \closing{Mit freundlichen Grüßen}
    \end{letter}
\end{document}

当我取消注释时,页脚会向上移动,尽管页脚中parskip=full没有。\par

答案1

\hrule至少,如果您不了解此原语的详细信息,则不应在 LaTeX 中使用低级 TeX 原语。由于它不会切换到水平模式,因此它不会开始段落。因此,在您的代码中,将开始一个新段落,并使用\noindent选项的设置。parskip

一个可能的改变是使用\hrulefill并开始新的一行\\[<distance>]

\documentclass[fontsize=12pt,
               DIN, A4,
               parskip=full, % removing this prevents the shift
              ]{scrlttr2}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[ngerman]{babel}

\usepackage[margin=20mm,
            inner=25mm,
            outer=20mm,
            bottom=30mm,
            ]{geometry}

\usepackage{ebgaramond}
\usepackage{blindtext}

\setlength{\footskip}{10mm}

% set the pagemark (page x of y)
\renewcommand*\pagemark{%
    \usekomafont{pagenumber}{\pagename~\thepage~von~\letterlastpage}%
    }

\setkomavar{firstfoot}{\hfill\pagemark}

% create pagemark also on first page
\newcommand{\originalopening}{}
\let\originalopening\opening
\renewcommand{\opening}[1]{\originalopening{#1}\thispagestyle{plain}}

\KOMAoptions{fromalign=off,
             pagenumber=botright,
            }

\newkomavar[BIC]{BIC}

\setkomavar{firstfoot}{%
  \hrulefill\\% You could also use something like \\[.5em] to move the following text down.
    \usekomavar*{frombank}~\usekomavar{frombank} \hfill Sparkasse Deutschland \hfill
    \usekomavar*{BIC}~\usekomavar{BIC}}

% ===================================

\setkomavar{frombank}[IBAN]{DE98~1605~0000~7512~0130~19}
\setkomavar{BIC}{WELADED2PMB}

\setkomavar{toaddress}{Musterstraße 1}
\setkomavar{fromname}{Donald Duck \textit{\&} Daisy Duck}
\setkomavar{fromaddress}{Am Geldspeicher 1, 12345 Entenhausen}

\begin{document}
    \begin{letter}{Max Mustermann\\Musterstraße 1\\12345 Musterstadt}
        \opening{Hello,}
        \Blindtext
        \closing{Mit freundlichen Grüßen}
    \end{letter}
\end{document}

或者您可以在本地更改选项parskip

\documentclass[fontsize=12pt,
               DIN, A4,
               parskip=full, % removing this prevents the shift
              ]{scrlttr2}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[ngerman]{babel}

\usepackage[margin=20mm,
            inner=25mm,
            outer=20mm,
            bottom=30mm,
            ]{geometry}

\usepackage{ebgaramond}
\usepackage{blindtext}

\setlength{\footskip}{10mm}

% set the pagemark (page x of y)
\renewcommand*\pagemark{%
    \usekomafont{pagenumber}{\pagename~\thepage~von~\letterlastpage}%
    }

\setkomavar{firstfoot}{\hfill\pagemark}

% create pagemark also on first page
\newcommand{\originalopening}{}
\let\originalopening\opening
\renewcommand{\opening}[1]{\originalopening{#1}\thispagestyle{plain}}

\KOMAoptions{fromalign=off,
             pagenumber=botright,
            }

\newkomavar[BIC]{BIC}

\setkomavar{firstfoot}{%
  \KOMAoptions{parskip=false}%
    \hrule\vspace{.5em}\noindent
    \usekomavar*{frombank}~\usekomavar{frombank} \hfill Sparkasse Deutschland \hfill
    \usekomavar*{BIC}~\usekomavar{BIC}}

% ===================================

\setkomavar{frombank}[IBAN]{DE98~1605~0000~7512~0130~19}
\setkomavar{BIC}{WELADED2PMB}

\setkomavar{toaddress}{Musterstraße 1}
\setkomavar{fromname}{Donald Duck \textit{\&} Daisy Duck}
\setkomavar{fromaddress}{Am Geldspeicher 1, 12345 Entenhausen}

\begin{document}
    \begin{letter}{Max Mustermann\\Musterstraße 1\\12345 Musterstadt}
        \opening{Hello,}
        \Blindtext
        \closing{Mit freundlichen Grüßen}
    \end{letter}
\end{document}

相关内容