Menu

#56 \pdfsavepos, etc ... incompatible with pdfTeX

open
other bugs (11)
5
2023-03-15
2011-07-21
Florian
No

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

Discussion

  • Anonymous

    Anonymous - 2020-02-23

    This bug has been fixed by http://www.tug.org/svn/texlive?view=revision&revision=53855, and will be included in TeX Live 2020.

     
  • Just A. Man

    Just A. Man - 2020-07-13

    I can confirm that the example

    \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}
    

    compiled with pdflatex or lualatex yields an visually pleasant output, whereas xelatex yields a visually unpleasant output as of TeX Live 2019/Debian on Ubuntu. As for TL2020, I know nothing yet.

     
  • Anonymous

    Anonymous - 2020-09-26

    This plaintex example shows that the \pdflastypos is still wrong:

    \ifdefined\directlua
      \let\pdfsavepos  \savepos
      \let\pdflastxpos \lastxpos
      \let\pdflastypos \lastypos
    \fi
    
    \pdfsavepos
    \write-1{saved pos: \the\pdflastxpos, \the\pdflastypos}
    % both pdftex and luatex give 50644704 for \pdflastypos,
    % but xetex gives 48462072, which is 2182632 (about 33.3pt) smaller
    content
    \bye
    
     
  • Just A. Man

    Just A. Man - 2023-03-15

    Output with XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022/Debian) still bad.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.