-
Notifications
You must be signed in to change notification settings - Fork 109
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
xetex: wrong position of node current page
#909
Comments
Proposal diff --git a/tex/generic/pgf/systemlayer/pgfsys-xetex.def b/tex/generic/pgf/systemlayer/pgfsys-xetex.def
index e191b9da..9eb1d23d 100644
--- a/tex/generic/pgf/systemlayer/pgfsys-xetex.def
+++ b/tex/generic/pgf/systemlayer/pgfsys-xetex.def
@@ -62,7 +62,7 @@
\pgf@marshal%
}
-\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfqpoint{2\hoffset}{0pt}}
+\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfqpoint{\hoffset}{\voffset}}
\ifx\paperheight\@undefined
\else The last modification to related line is done by cdacb87 in 2013, in order to fix #85. Edit: I'm not familiar with either the system layer of ./pgfsys-common-pdf-via-dvi.def:110: \def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfpointorigin}
./pgfsys-dvips.def:158:\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfpointorigin}
./pgfsys-pdftex.def:266:\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfqpoint{\hoffset}{\voffset}}
./pgfsys-xetex.def:65:\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfqpoint{2\hoffset}{0pt}}
./pgfsys-dvipdfmx.def:250: \def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfpointorigin}
./pgfsys-dvisvgm.def:207:\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfpointorigin}
./pgfsys-luatex.def:269:\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfqpoint{\hoffset}{\voffset}} |
Exact duplicate of #294 |
Not exactly the same. #294 reported a problem reproducible with every engine, while this issue reports a problem specific to xetex, which corresponds to a bug fix [1] of xetex introduced in texlive 2020. The above proposed change for [1] About this bug:
Therefore the whole story is:
A refined proposal would be diff --git a/tex/generic/pgf/systemlayer/pgfsys-xetex.def b/tex/generic/pgf/systemlayer/pgfsys-xetex.def
index e191b9da..4cdaf9ab 100644
--- a/tex/generic/pgf/systemlayer/pgfsys-xetex.def
+++ b/tex/generic/pgf/systemlayer/pgfsys-xetex.def
@@ -62,7 +62,14 @@
\pgf@marshal%
}
-\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfqpoint{2\hoffset}{0pt}}
+% this test fails if xetex releases 1.0 in the future
+\ifnum\expandafter\pgfutil@gobble\XeTeXrevision>999991\relax
+ \def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfqpoint{\hoffset}{\voffset}}
+\else
+ \def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfqpoint{2\hoffset}{0pt}}
+\fi
\ifx\paperheight\@undefined
\else Sorry I was obviously in a hurry yesterday. The #294 you mentioned let me learn more. To be more specific, using the example given in #294 (comment), \documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\advance\hoffset by 4cm
\begin{document}
\tikz[overlay,remember picture]
\draw[green,<->] (current page.south west) -- (current page.north east);%
abc
\end{document} |
Can you make a PR with that patch? |
There was a "\pdfsavepos" bug in XeTeX https://sourceforge.net/p/xetex/bugs/56/ which caused the asymmetric workaround "\pgfqpoint{2\hoffset}{0pt}" in defining node "current page". XeTeX has fixed the bug in 0.999992 hence now pgf can use a normal symmetric "\pgfqpoint{\hoffset}{\voffset}" now.
There was a "\pdfsavepos" bug in XeTeX https://sourceforge.net/p/xetex/bugs/56/ which caused the asymmetric workaround "\pgfqpoint{2\hoffset}{0pt}" in defining node "current page". XeTeX has fixed the bug in 0.999992 hence now pgf can use a normal symmetric "\pgfqpoint{\hoffset}{\voffset}".
Brief outline of the bug
From question https://tex.stackexchange.com/q/559138/79060.
Compiled with xetex, the position of node
current page
is wrongly calculated if\hoffset
and/or\voffset
are/is non-zero.Minimal working example (MWE)
Expected output: with pdftex or luatex
Actual output: with xetex
The text was updated successfully, but these errors were encountered: