2

I have the following file test.tex:

\documentclass[a4paper,10pt,version=last]{scrlttr2}%,fontsize=10pt

\usepackage{fontspec}% for lualatex 
\usepackage{geometry}
\usepackage[latin]{babel} % for lipsum
\usepackage{lipsum}
\usepackage{showframe}

\setkomavar{subject}[]{Geometrie}


%\KOMAoptions{firstfoot=false}

\begin{document}

\begin{letter}{%
  CapMini GmbH \\
  Egon Walther\\
  Walthershofener Straße 20\\
  88444 Walthershofen\\
} 
  \opening{Salve Egon,}
  \lipsum{1}
  
  \closing{Regards\\[2\baselineskip]}

\end{letter}
\end{document}

In a sense, this file is minimal: fontspec is for lualatex and babel is for lipsum; showframe is just to give a hint, the problem occurs without also.

As you can see in the resulting PDF file, the text does not reach down to the lower boundary of the frame shown by showframe.

The problem disappears if you uncomment \KOMAoptions{firstfoot=false} which is a kind of workaround.

Other variations are instructive also: If you eliminate geometry (which is in application no option), then the text height does not change but the boundary adapts to the lower boundary of the actual text.

Interesting is also what happens if you eliminate the option 10pt or its alternative fontsize=10pt: Then the text goes down until the lower boundary.

Another hint: This problem seems new, e.g. related to recent updates of tools (lualatex and other compilers) or packages/document classes.

Help very much appreciated. I frequently write 1 page letters but now.. difficult.

0

1 Answer 1

2

The first page of scrlttr2 resp. scrletter is somehow special. For example the position of the footer does not only depend on the layout either set using typearea or geometry, but also on the pseudo length firstfootvpos. You can visualize that position using

\LoadLetterOption{visualize}
\showfields{foot}

As already explained in Schweinebacke's answer to: How to avoid empty space at the end of a page when using scrlttr2? the larges text area on the first page can be achieved using option firstfoot=false,enlargefirstpage.

Option firstfoot=false more or less moves the footer below the page.

Option enlargefirstpage even enlarges the text area, below the layout position of the footer (set by geometry in your case). So the bottom margin is reduced to \footskip on the first page.

But IMHO both are not needed and not wanted in your case. firstfoot=false is more or less accidentally a workaround.

The main problem with your code is, that loading geometry changes the layout parameters but does not automatically adjust the depending pseudo lengths. These are already setup by loading the default DIN.lco, where you can find:

    \setplength{firstfootvpos}{1in}%
    \addtoplength{firstfootvpos}{\topmargin}%
    \addtoplength{firstfootvpos}{\headheight}%
    \addtoplength{firstfootvpos}{\headsep}%
    \addtoplength{firstfootvpos}{\textheight}%
    \addtoplength{firstfootvpos}{\footskip}%

So firstfootvpos depends on not only one but several layout lengths, which geometry sets depending on the font size. So it is not unexpected, that changing the font size and loading geometry without re-loading the letter option DIN.lco results in somehow strange settings.

So the first step to get valid result, would be to add

\LoadLetterOption{DIN}% or whatever letter option you are using

after loading geometry:

\documentclass[a4paper,10pt,version=last]{scrlttr2}%,fontsize=10pt

\usepackage{fontspec}% for lualatex 
\usepackage{geometry}
\usepackage[latin]{babel} % for lipsum
\usepackage{lipsum}
\usepackage{showframe}

\setkomavar{subject}[]{\the\dimexpr\useplength{firstfootvpos}\relax}
\LoadLetterOption{DIN}% Load it again after changing the layout by loading geometry
\LoadLetterOption{visualize}
\showfields{foot}

%\KOMAoptions{enlargefirstpage}
%\KOMAoptions{firstfoot=false}

\begin{document}

\begin{letter}{%
  CapMini GmbH \\
  Egon Walther\\
  Walthershofener Straße 20\\
  88444 Walthershofen\\
} 
  \opening{Salve Egon,}
  \lipsum{1}
  
  \closing{Regards}% IMHO \\[2\baselineskip] is nonsense here, so I've removed it

\end{letter}
\end{document}

using 10pt or fontsize=10pt

And now, the result without option 10pt or fontsize=10pt and therefore the default 12pt, is very similar:

not using 10pt but the default 12pt

3
  • Very good solution. Still I have a question: This works only if I have DIN letter format, which is the case if nothing is preloaded as in my case. I found out that some nations in Europe have their own standards... only part seems to be given in the KOMA documentation, table 4.19 (ctan.space-pro.be/tex-archive/macros/latex/contrib/koma-script/…). Commented Apr 24 at 14:55
  • It does also work with other formats. Just load your lco file after geometry and after setting the page layout resp. margins. The KOMA-Script manuals also provide information on how to change the pseudo length. So you can adapt an existing lco or implement a new one. As it seems you are reading the German manual, note, there is also a German KOMA-Script book, which has an additional appendix chapter about lco development. The KOMA-Script wiki (here the German version) also provides examples about this.
    – cabohah
    Commented Apr 25 at 6:27
  • And there are also third-party lco files available, like ctan.org/pkg/koma-script-sfs. AFAIK there are also several DTK articles about lco files. Just have a look into the DANTE DTK archive. But I don't know, if these articles are still valid with newer versions of KOMA-Script. But if there are problems, you can ask a new question. ;-)
    – cabohah
    Commented Apr 25 at 6:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .