1

I have noticed some odd extra vertical when placing boxes in a twocolumn layout:

\documentclass[a5paper]{article}

\usepackage{calc}
% issue only happens with adjustbox loaded
\usepackage{adjustbox}

\parindent=0pt
\fboxrule=1pt
\fboxsep=5mm

\begin{document}

\twocolumn

\fbox{\begin{minipage}{\linewidth-2\fboxrule-2\fboxsep}
    \section*{sec1}
    test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
\end{minipage}}

\vfill

\fbox{\begin{minipage}{\linewidth-2\fboxrule-2\fboxsep}
    \section*{sec2}
    test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
\end{minipage}}

\vfill

\fbox{\begin{minipage}{\linewidth-2\fboxrule-2\fboxsep}
    \section*{sec3}
    test test test test test test test test test test test test test test test test test test test test test test
\end{minipage}}

\vfill

\fbox{\begin{minipage}{\linewidth-2\fboxrule-2\fboxsep}
    \section*{sec4}
    test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
\end{minipage}}

\end{document}

Here are the outputs for lualatex

lualatex output

and pdflatex/xelatex

pdflatex output

As you can see, the lualatex version has some extra space at the bottom of the right column (it seems to be around 5pt). As the comment says, this only occurs with the adjustbox package loaded.

Is this a bug (and if so, where) and can I work around it?

Using LuaTeX v1.0.4/TeX Live 2017.

Socob
  • 1,693

1 Answers1

3

It is not luatex specific. You get the same problem with pdflatex if you load pgf. pdf adds \AtBeginDocument{\AtEndDocument{\par\vfil\penalty-10000\relax\the\pgfutil@everybye}} to the document and this inserts the space.

In your example a work around is to add a \newpage before \end{document}. But if pgf puts something in the toks register \pgfutil@everybye this could lead to a second page.

Ulrike Fischer
  • 327,261
  • It may not be luatex-specific in general, but at least for adjustbox, it is. The culprit seems to be the package trimclip loaded by adjustbox, which falls back to pgf if there is no file tc-<driver>.def. This happens for luatex because trimclip only provides tc-{dvips,pdftex,pgf,xetex}.def. – Socob Oct 08 '18 at 21:00
  • 1
    Yes, I know see https://chat.stackexchange.com/transcript/message/47085669#47085669. But any package that loads pgf would have a similar effect. – Ulrike Fischer Oct 08 '18 at 21:06
  • 1
    @Socob Fixed in next PGF release. https://sourceforge.net/u/hmenke/pgf/ci/fbfabbd01cecb4e8b6b1e43d1f3ad685c7e60778/ – Henri Menke Jan 18 '19 at 04:53