TiKz allows you to position tikzpictures anywhere on the page using the pre-defined current page co-ordinate.
However, when you also use Beamer's show notes option, which uses pgfpages, this destroys the absolute co-ordinate system.
I thought I had found a solution (see Title picture misplaced in Beamer when using 'show notes on second screen' and absolute 'pgf' positioning). This uses the \nofiles command so that on a second LaTeX run, we retain the original AUX file (and the stored position of the tikzpicture using the remember picture option).
However, this only seems to work for the first occurrence of a slide with tikzpictures. All subsequent slides still have the absolute positioning messed up.
Without the \nofiles command the tikzpicture size and position are wrong. Using the two-step compilation (hide notes followed by show notes with \nofiles command) the sizes are right, the position of the pictures on the first slide are right, all other positions are wrong.
I feel so close to understanding what is wrong/needs changing/how to fix this.
Minimal working example:
\documentclass[11pt]{beamer}
%%%%% pick one of the following three lines:
%\setbeameroption{show only notes}
%\setbeameroption{show notes}\nofiles
\setbeameroption{hide notes}
%% For the notes slides to work, we need to compile with 'hide notes' first,
%% this gets the position of all the tikz environments right. Then,
%% and only then, compile with the 'show notes' line, including the
%% \nofiles option. That will get the notes slides done properly.
%% [https://tex.stackexchange.com/questions/86378/title-picture-misplaced-in-beamer-when-using-show-notes-on-second-screen-and-a]
%%
\usetheme{Frankfurt} %% header, filled blocks, toc(line)
\usepackage{tikz}
\usetikzlibrary{calc}
%% the following puts a \notes{} command on every slide
\makeatletter
\def\beamer@framenotesbegin{% at beginning of slide
\gdef\beamer@noteitems{}%
\gdef\beamer@notes{{}}% used to be totally empty.
}
\makeatother
\title{TEST}
\author{Someone}
\begin{document}
\section{SECTION}
\subsection{CONTENT}
\begin{frame}[fragile,label=pic1]{Title}{subtitle}
\begin{tikzpicture}[remember picture,overlay]
\node (PIC1a) at ($(current page.south west)+(5mm,5mm)$) [anchor=south west,draw=red] {PIC1a};
\end{tikzpicture}
\begin{tikzpicture}[remember picture,overlay]
\node (PIC1b) at ($(current page.south east)+(-5mm,5mm)$) [anchor=south east,draw=red] {PIC1b};
\end{tikzpicture}
\note{Simple note\\\alert{First slide}}
\end{frame}
\begin{frame}[fragile,label=pic2]{Title}{subtitle}
\begin{tikzpicture}[remember picture,overlay]
\node (PIC2a) at ($(current page.south west)+(5mm,5mm)$) [anchor=south west,draw=red] {PIC2a};
\end{tikzpicture}
\begin{tikzpicture}[remember picture,overlay]
\node (PIC2b) at ($(current page.south east)+(-5mm,5mm)$) [anchor=south east,draw=red] {PIC2b};
\end{tikzpicture}
%% NO EXPLICIT \note
\end{frame}
\begin{frame}[fragile,label=pic3]{Title}{subtitle}
\begin{tikzpicture}[remember picture,overlay]
\node (PIC3a) at ($(current page.south west)+(5mm,5mm)$) [anchor=south west,draw=red] {PIC3a};
\end{tikzpicture}
\begin{tikzpicture}[remember picture,overlay]
\node (PIC3b) at ($(current page.south east)+(-5mm,5mm)$) [anchor=south east,draw=red] {PIC3b};
\end{tikzpicture}
\note{Simple note\\\alert{Third slide}}
\end{frame}
\end{document}
Below are the resulting PDFs (stacked with pdfnup and converted to PNGs for uploading) under:
- Compiled with
hide notesoption - Compiled with
show notesoption and\nofilesafter (1) - Compiled with
show notesoption, as a single pass without using\nofiles
In the AUX file I see lines including \pgfsyspdfmark, which on reading 114.15 Position Tracking Commands from the pgfmanual (v3.0.1a), appear to be the lines of interest.
I just don't understand why the first slide is fine, with the \nofiles fix, but the subsequent slides are wrong. Am I missing something?
Solution
Make sure you have up to date packages. After doing an upgrade:
- beamer 2015/01/05 3.36
- pgfcore 2010/04/11 v3.0.1 (rcs-revision 1.7)
- compiling with TeX Live 2013/Debian (on Ubuntu)
Using method (4), show notes option without any need for \nofiles works fine.
I have no idea what was changed in the upgrade... the above question came from using pgf v2.10.



4. Compiled with show notes option, as many passes as necessary and without using \nofiles– samcarter_is_at_topanswers.xyz Aug 08 '16 at 21:38hide notesoption followed by compile withshow notesoption and\nofilescommand) do the TiKz nodes all appear in the right place?As shown in my second attached image, when I do this the second and third slides have the wrong position (but the correct size). I did perform multiple compilation passes in both steps - it seemed to make no difference.
– Simon Aug 08 '16 at 21:44I just noticed I was using TiKz 2.10... just done an update and tried method (4). Everything seems fine.
Well that's embarrassing.
– Simon Aug 08 '16 at 23:01