5

Is there a way to shift the baseline of dome text to the page bottom, i.e. with ignoring descenders? Actually I thought this is the case with \vfill but it isn't …

enter image description here

\documentclass{scrartcl}

\usepackage{showframe}

\begin{document}
   Test
   \vfill
   Test g
\end{document}

If I omit the g the text is a little lower than with descenders. Is there another way than to manually add \enlargethispage or using \smash?

Update: There seems to be some differences in the different versions (see comments) and I’m going to fit my problem with an upgrade (from TL 16 to 17). But I’m still interested in the backgrounds, why this happens.

Update 2 / Solution: The described behaviour is considered a but, which is fixed in the 2017 version. However if you want an old document to produce the same output as always, you can add \RequirePackage[2017-01-01]{latexrelease} before \documentclass. You can read about it in the LaTeX News (Issue 22, January 2015).

9
  • Using your example, I get i.stack.imgur.com/h4JDZ.png Jun 13 '17 at 16:00
  • I can reproduce the issue with TL 2015 and TL 2016, but not with TL 2017 or MiKTeX.
    – esdd
    Jun 13 '17 at 16:05
  • @samcarter: Good to know. I had the feeling that this isn’t (or at least wasn’t) the default behaviour … Which version do you use?
    – Tobi
    Jun 13 '17 at 16:12
  • @esdd. Thanks for testing! At the moment I’m in the middle of some projects and planned to make the upgrade after finishing them, but maybe its time for an upgrade know. Can someone test the behaviour in TeX Live 2017, please?
    – Tobi
    Jun 13 '17 at 16:13
  • @Tobi I used pdflatex from TL2017 Jun 13 '17 at 16:14
7

As noted in the comments, this is a change that was introduced in TeX Live 2017. (In fact it was introduced on 2017-04-11, according to the change log.)

Investigation

This isn't really important, but if you're curious as to how I found this, these were my steps.

If you compile the MWE with the addition of the line \showoutput using TL 2017 and TL 2016, then TeX will print out what the page looks like. By diffing the two, we can see that near the bottom of the page an extra glue appears.

 ....\penalty 10000
 ....\glue(\parfillskip) 0.0 plus 1.0fil
 ....\glue(\rightskip) 0.0
+...\glue -2.12917
 ...\glue 0.0 plus 1.0fil
 ...\glue 0.0
 ...\glue 0.0 plus 0.0001fil

This suggested that there was something about LaTeX's output routine. I'm not super familiar with how the kernel is structured, but a quick glance at texdoc source2e shows that the output routine is defined in ltoutput.dtx. Diffing that file in the two versions reveals

% \changes{v2.4a}{2017/04/11}{account for the depth of the last row of the page}

The \newpage macro was modified. It now includes

%    The |\vfil| at the end of the macro before the break penalty will
%    normally result in the page being run short,  even with |\flushbottom|
%    in effect (in contrast to the behavior
%    of |\pagebreak|). However, if there
%    is some explicit stretch on the page, say, a |\vfill|, it has the undesired
%    side-effect, that the last line will not align at its baseline if it
%    contains characters going below the baseline, as the value of |\prevdepth|
%    is no longer taken into account by \TeX{}. So we back up by that amount
%    (or by |\maxdepth| if it is really huge), to mimic the normal behavior
%    without the |\newpage|.
%    \begin{macrocode}
  \ifdim\prevdepth>\z@
     \vskip -%
       \ifdim\prevdepth>\maxdepth
         \maxdepth
       \else
         \prevdepth
       \fi
  \fi

So it looks like a long-standing bug was fixed recently.

Edit: The reason that \newpage is important here despite not appearing anywhere in the input is \end{document} expands to (among other things) \enddocument whose expansion includes \clearpage and that expands to something containing \newpage.

Edit 2: Thinking about this a bit more, this seems especially bad with two columns.

\documentclass[twocolumn]{article}
\usepackage[margin=3.5in]{geometry}
\usepackage{showframe}
\begin{document}
Top\par\vfill Bottom\newpage
Top\par\vfill Bottomy
\end{document}

With TL 2016, you get this.

enter image description here

6
  • Thanks for your detailed investigation! I really appreciate this. However this is a change that might changes the output of older documents an thus “breaks” them … I thought this is something which the team wants to prevent …
    – Tobi
    Jun 13 '17 at 21:24
  • @Tobi, I wondered about that too. On the one hand, you don't want to break old documents; on the other hand, you don't want documents that look like the one I added in edit 2.
    – TH.
    Jun 13 '17 at 22:22
  • 1
    Yes, thats the dilemma. But I thought that in such cases the general decision is to not change existing documents but add an option or package (like fixlte or something like that) to activated the new behaviour.
    – Tobi
    Jun 13 '17 at 22:26
  • 1
    @Tobi: Indeed, for more than 15 years I’ve been keeping, alongside the standard LaTeX format, a personal format called mylatex.fmt (and then emylatex.fmt when I enabled e-TeX extensions) which incorporated this fix, as well as another similar one concerning \addpenalty and already included in release 2015/01/01 of LaTeX, precisely because my personal format could yield different results than the standard one. So, it looks like that, after 15+ years, I can eventually get rid of it!
    – GuM
    Jun 14 '17 at 0:30
  • @Tobi The fact that this might alter documents is mentioned in the latest LaTeX News: you can reverse it using the latexrelease package. Over the past 2-3 years the team have taken a slightly different approach on bugs to that which was the case before: we can't say 'we won't fix stuff' as people just patch round it anyway. So instead we are fixing but with a clear way to 'back up' to a known state.
    – Joseph Wright
    Jun 14 '17 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.