-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extra blank page with standalone class #724
Comments
Bisected to fbfabbd I would argue that the problem is in \documentclass{standalone}
\AtBeginDocument{\AtEndDocument{\clearpage}}
\begin{document}
a
\end{document} |
standalone.cls has an option 'tikz':
and this produces no blank page. |
Yes, that produces no blank page, but the page is not cropped to the size of 'a'; it results in A4 paper. This behavior is not expected at all... |
@hmenke I agree with you, thanks. |
I see. To use with dvipdfmx, I added the following line in the definition of \sa@placebox (defined in standalone.cls).
This also produce no blank page, and the page is cropped. |
I'm closing this for now, because the issue seems to be in |
This topic just came up again: https://tex.stackexchange.com/questions/610206/standalone-creates-extra-empty-page-mwe The empty page is triggered by the \clearpage inserted by pgf in pgfutil-latex.def
As far as I can see only the driver files pgfsys-pdftex.def and pgfsys-luatex.def add something to the toks register |
As already noted earlier in this thread, |
I know that the \clearpage has only an ill effect in standalone. I did read the thread. But it is not clear if it is a bug. Creating single pages from content is not an easy task, and it is quite possible that standalone can't avoid the bad side effect from \clearpage in dvi mode without breaking something else. It remains the fact that pgf issues an in dvi mode unneeded \clearpage. And imho it makes more sense here to ask pgf to not add it in the first place or to use another hook than asking standalone to remove it again with |
How is that not a bug? Using
Maybe it is but it's beyond the scope of PGF and therefore not my problem. |
but the \clearpage is not issued by standalone but by PGF.
so if any document for any reason puts any kind of box into |
As I said, not my problem. However, you're welcome to open a PR with a *forward- and backward-compatible solution and I'll merge it. Locking the conversation because that's my final statement. |
This seems to work, at the cost of a new dependency BTW, it seems diff --git a/tex/generic/pgf/utilities/pgfutil-latex.def b/tex/generic/pgf/utilities/pgfutil-latex.def
index 07a7fb1a..7574895a 100644
--- a/tex/generic/pgf/utilities/pgfutil-latex.def
+++ b/tex/generic/pgf/utilities/pgfutil-latex.def
@@ -90,11 +90,17 @@
\def\pgfutil@check@rerun#1#2{\@newl@bel{pgf@lab}{#1}{#2}}
-\AtBeginDocument{\AtEndDocument{\clearpage\the\pgfutil@everybye}}
-
% \@ifl@t@r is defined \@onlypremable so we have to save it here
\let\pgfutil@ifl@t@r=\@ifl@t@r
+% ensure \pgfutil@everybye is used after the \clearpage inside \enddocument
+\pgfutil@ifl@t@r\fmtversion{2020/10/01}{
+ \AtBeginDocument{\AddToHook{enddocument/afterlastpage}{\the\pgfutil@everybye}}
+}{
+ \usepackage{atveryend}
+ \AtBeginDocument{\AfterLastShipout{\the\pgfutil@everybye}}
+}
+
\def\pgfutil@insertatbegincurrentpagefrombox#1{%
\edef\pgf@temp{\the\wd\pgfutil@abb}%
\global\setbox\pgfutil@abb\hbox{% |
Sorry if reported elsewhere.
By running
latex
anddvipdfmx
, the following MWE produces 2 pages in recent versions of pgf (v3.1.2 -- v3.1.4a current). The second page is blank.In TL2018 frozen (v3.1.1), it produced only 1 page.
The text was updated successfully, but these errors were encountered: