[texhax] Specifying baseline-to-baseline skip in TeX

Donald Arseneau asnd at triumf.ca
Mon Oct 12 16:17:37 CEST 2009


Uwe Lück <uwe.lueck at web.de> writes:

> The /designer/ has specified the skip from the last \chapter baseline to the
> next baseline. A simple \vskip(glue) closing the chapter macros [apart from
> \@afterheading] would result in a baseline-to-baseline distance of (glue)+(b)
> where (b) is the \baselineskip associated with either \normalsize or
> \section, I don't know ...

The descenders of large-font chapter and section titles 
screw up surrounding \baselineskips, often causing \lineskip
to be used.  

You can get a specific ad-hoc baseline-skip between paragraphs
using something like:

\newdimen\prevdepthcalc

\def\blskipper#1{\par
\prevdepthcalc=\prevdepth
\advance\prevdepthcalc -#1\relax
\advance\prevdepthcalc\baselineskip
\advance\prevdepthcalc\parskip
\ifdim\prevdepthcalc<-99pt
  \vskip-99pt
  \vskip-\prevdepthcalc
  \prevdepthcalc=-99pt
\fi
\prevdepth=\prevdepthcalc
}

It has to have the \baselineskip for the following 
paragrah already set, but that is not possible in general
(the paragraph could end like {\small\par}). If you
want to delay operation until \everypar, then you 
will have to back out of the paragraph, do \blskipper,
and re-start the paragraph.  That goes roughly like:

\begingroup
  \everypar{}%
  \setbox\@tempboxa\lastbox
  \@@par
  \vskip-\parskip
  \blskipper{xxxxpt}%
  \ifvoid\@tempboxa \noindent \else \indent \fi
\endgroup

But you have to make sure this gets executed *first*, before
whatever other code is executed by \everypar.

If you are worried about the positioning below chapter
heads with [twocolumn] you are out of luck.  See bug
report latex/3126.

-- 
Donald Arseneau                          asnd at triumf.ca


More information about the texhax mailing list