[texhax] Stretchable \baselineskip, per-page?

Heiko Oberdiek heiko.oberdiek at googlemail.com
Fri Oct 8 00:23:13 CEST 2010


On Thu, Oct 07, 2010 at 11:17:27PM +0200, Aleksandar Zec wrote:

> Hi Uwe and Heiko,
> 
> Thank you very much, both methods work! These are exactly what I was
> looking for. First, please find my test file. Two questions about
> these methods are below.
> 
> --------- p.tex ----------
> \documentclass[a4paper]{article}
> \usepackage[english]{babel}
> \usepackage{blindtext}
> \begin{document}
> \flushbottom
> \blindtext\footnote{\blindtext}\par
> \blindtext\par
> \blindtext\par
> \blindtext\par
> A\footnote{\blindtext}
>   line\footnote{\blindtext}
>   with\footnote{\blindtext}
>   many\footnote{\blindtext}
>   footnotes\footnote{\blindtext}.\par
> \blindtext\par
> \blindtext\par
> \blindtext\par
> \blindtext\par
> \blindtext\par
> \blindtext\par
> \blindtext\par
> \blindtext\par
> A\footnote{\blindtext}
>   line\footnote{\blindtext}
>   with\footnote{\blindtext}
>   many\footnote{\blindtext}
>   footnotes\footnote{\blindtext}.\par
> \blindtext\par
> \blindtext\par
> \blindtext\par
> \blindtext
> \end{document}
> -------------------------
> 
> I used larger numbers for this test, i.e. {14.5pt \@plus 10pt} and
> \@plus 4\@tempskipa.
> 
> Pages 1 and 3 are typical examples where I need vertical stretching.
> 
> 1. In Heiko's method, all lines are proportionally stretched,

See the code:

  % \advance\@tempskipa by 0pt\@plus 1pt\relax
  \advance\@tempskipa by 0pt\@plus .2\@tempskipa\relax   

The first line uses the non-proportional, the second
line the proportinal method. Set the percent char in the
line with the method you don't want to use.

> including footnotes; is there a way to restrict this behaviour on
> \normal- or any other size?

  % \@tempskipa contains the original baseskip
  \ifdim\@tempskipa>10pt
    \advance\@tempskipa by 0pt\@plus .2\@tempskipa\relax
  \fi

> 2. For both methods: is there a way to change plus and minus factor on
> a specific page *only* (not between paragraphs)?

Not in general, because the page break is done by the
output routine that is called asynchronous. At paragraph building time
the baselineskip is evaluated, but it is not known on which page
each line will end up.

But you can surround your page with \newpage and use a differnt
baselineskip setting inbetween.

Yours sincerely
  Heiko Oberdiek


More information about the texhax mailing list