2

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:

  1. Compiled with hide notes option
  2. Compiled with show notes option and \nofiles after (1)
  3. Compiled with show notes option, as a single pass without using \nofiles

Minimal example with hide notes Minimal example, second compilation with show notes Very wrong, minimal example one-step compilation with show notes and not using nofiles command

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.

closed as off-topic by user36296, user13907, Andrew, R. Schumacher, Kurt Aug 9 '16 at 0:57

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    One cannot determine the absolute location of anything on the page until the page ships, so each tikzpciture stores its origin location on the aux file. So it cannot position things relative to (current page) until the aux file is read. – John Kormylo Aug 8 '16 at 18:40
  • 1
    i see no problem with \setbeameroption{show notes}. You just have to run it twice (SOP). – John Kormylo Aug 8 '16 at 18:53
  • 1
    I would go with method 4. Compiled with show notes option, as many passes as necessary and without using \nofiles – user36296 Aug 8 '16 at 21:38
  • 1
    @Simon Sure, I get the following output i.stack.imgur.com/0rvvB.png Is this what you expect? I am using TeXLive 2016 with pdflatex (3 times). How are you compiling? – user36296 Aug 8 '16 at 22:52
  • 5
    I'm voting to close this question as off-topic because tikz update solved the problem – user36296 Aug 8 '16 at 23:13