1

Why is the footer (containing the bank information) shifted down by 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}

When I uncomment parskip=full the footer gets shifted up although there is no \par in the footer..

cabohah
  • 11,455
mrCarnivore
  • 1,505
  • 2
    there is a \par at the \noindent, use e.g. \hrule\vspace*{\dimexpr 0.5em-\parskip}\noindent or reset \parskip locally. – Ulrike Fischer Apr 19 '23 at 15:11
  • @UlrikeFischer: Removing \noindent did not work. I had tried that before. How do I reset \parskip locally? Of course -\parskip does work but why is it even necessary? – mrCarnivore Apr 19 '23 at 15:14
  • there is a paragraph between the rule and when the text start, use \setlength to reset the parskip. – Ulrike Fischer Apr 19 '23 at 15:15
  • @UlrikeFischer: Is there an implicit \par after \hrule as part of \hrule itself? Is there no easy ways to prevent it without removing it again afterwards with -\parskip? – mrCarnivore Apr 19 '23 at 21:13
  • 1
    AFAIK the low level TeX primitive \hrule does not switch to horizontal mode. So the \noindent results in switching to horizontal mode and therefore to start a new paragraph. IMHO: Using low level commands like \hrule, \hbox etc. is always dangerous, if you do not know, what you are doing. In LaTeX they should not be used as user commands. It is mostly recommended to use LaTeX user commands like \rule, \hrulefill, \mbox etc. – cabohah Apr 20 '23 at 09:33

1 Answers1

3

You should not use low level TeX primitive \hrule in LaTeX, at least, if you don't know the details of this primitive. Because it does not switch to horizontal mode, it does not start the paragraph. So the \noindent in your code starts a new paragraph an the setting of option parskip is used.

One possible change would be to use \hrulefill and just start a new line using \\[<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{&amp;} 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}

Or you can locally change option 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{&amp;} 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}

cabohah
  • 11,455