XeTeX obviously handles \pdfsavepos, \pdflastxpos, \pdflastypos differently than pdfTeX.
Markus Kohm has kindly prepared this minimal example
\documentclass{article}
\hoffset=5in
\voffset=5in
\begin{document}
\makeatletter
\noindent\mbox{}\pdfsavepos\protected@write\@auxout{}{%
\@percentchar\space \string\pdflastxpos, \string\pdflastypos:
\noexpand\number\pdflastxpos,
\noexpand\number\pdflastypos^^J%
\@percentchar\space This should be 32480951, 22834503
}
\end{document}
where XeTeX writes different values.
This behaviour breaks e.g. \marginnote in connection with the crop-package:
\documentclass[a6paper]{scrbook}
\usepackage[frame,center,a4]{crop}
\usepackage{marginnote}
\begin{document}
Quisque \marginnote{mnote}facilisis erat a dui.
Suspendisse \marginpar{mpar} sagittis ante a urna.
\end{document}
This compiles correctly with pdfLaTeX, but with wrong positioning with XeLaTeX.
Cf. also:
http://www.komascript.de/node/1486
Anonymous
This bug has been fixed by http://www.tug.org/svn/texlive?view=revision&revision=53855, and will be included in TeX Live 2020.
I can confirm that the example
compiled with
pdflatex
orlualatex
yields an visually pleasant output, whereasxelatex
yields a visually unpleasant output as of TeX Live 2019/Debian on Ubuntu. As for TL2020, I know nothing yet.This plaintex example shows that the
\pdflastypos
is still wrong:Output with
XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022/Debian)
still bad.