2

I'm following up this question The provided answer doesn't work with me, Here is a MWE:

\documentclass[dvipdfmx]{beamer}

\def\pgfsysdriver{pgfsys-dvipdfmx.def} 
\usepackage{tikz}
\begin{document}

\begin{frame}
\begin{tikzpicture}[overlay,remember picture,every node/.style={draw,minimum size=2.5cm,circle}]
\node [anchor=east] at (current page.east){};
\node [anchor=west] at (current page.west){};
\node [anchor=north] at (current page.north){};
\node [anchor=south] at (current page.south){};
\end{tikzpicture}
\end{frame}

\end{document}

The circle are not well positioned, and even seems to shift at each latex pass due to "remember picture"...

1 Answer 1

2

The positioning feature of pdfTeX needs to know the paper height and uses \pdfpageheight for this purpose. The \pdfpagewidth and \pdfpageheight are usually not set if pdfTeX is used in PDF mode. The DVI format has no concept of a paper/page/media size. The driver pgfsys-xetex.def contains a workaround:

\ifx\paperheight\@undefined
\else
  \pdfpagewidth\paperwidth
  \pdfpageheight\paperheight % this is to work around a positioning problem in xetex.
\fi

Setting this in the example of the question fixes the issue:

\documentclass[dvipdfmx]{beamer}

\def\pgfsysdriver{pgfsys-dvipdfmx.def}
\pdfpagewidth=\paperwidth
\pdfpageheight=\paperheight

\usepackage{tikz}
\begin{document}

\begin{frame}
\begin{tikzpicture}[
  overlay,
  remember picture,
  every node/.style={draw, minimum size=2.5cm, circle}]
\node [anchor=east] at (current page.east){};
\node [anchor=west] at (current page.west){};
\node [anchor=north] at (current page.north){};
\node [anchor=south] at (current page.south){};
\end{tikzpicture}
\end{frame}

\end{document}

The .aux file contains the stable position:

\pgfsyspdfmark {pgfid1}{1864679}{10310646}

After two latex runs followed by dvipdfmx, the result is:

Result

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .