[Tex/LaTex] Beamer handouts with only / onslide and notes

beamerhandoutheader-footer

Question

I want to give a handout for my course (made in beamer). I use Xelatex, but I don't think this is relevant here.

The layout should be a portrait A4 with the slide at the top and a zone with notes at the bottom and page numbering (cf image 1).

Img 1:

What I want

Here is what I tried

Tries

Try 1 : beamer handout class

I tried something like this (minimal example)

The images can be anything (convert -size 1500x1000 xc:grey a.png should do the trick to create some quickly).

\documentclass[handout]{beamer}
\usepackage{handoutWithNotes}  % from https://github.com/gdiepen/latexbeamer-handoutWithNotes
\pgfpagesuselayout{1 on 1 with notes}[a4paper,border shrink=5mm]

\usetheme[hideothersubsections]{Goettingen}
\usecolortheme{default}

\begin{document}

\begin{frame}
    \only<1>{\centering \includegraphics[width=10cm]{a.png}}
    \only<2>{\centering \includegraphics[width=10cm]{b.png}}
\end{frame}

\end{document}

Which works nearly fine (cf image 1) where there is no \only or \onslide or \pause. But when the slide takes more than one page it doesn't display nicely (cf image 2)…

what I get with the handout mode

What I would like with this solution

Getting 2 different pages (ie putting in two frames instead of using \onslide), with page numbering would be OK.

Changing onslide<1> with \onslide<1-| handout:1> (for each frame) seems to do the trick, but I don't get the page numbers and I have to change all the onslide elements… (image 3)

enter image description here

Try 2 : includepdf and custom style

I also tried to use includepdf (all.pdf is for instance the pdf created without the [handout] mode on the previous code)

\documentclass[a4paper]{article}
\usepackage{pdfpages}

\begin{document}
\includepdf[pagecommand={\thispagestyle{blank}},pages=-,landscape=false,frame=true, offset=0 198]{all.pdf}
\end{document}

What I would like

But I don't know how to add the note section (I think by hacking a style and a footer).

Best Answer

To create separate pages for each overlay, just remove the handout beamer option

\documentclass[]{beamer}
\usepackage{handoutWithNotes}  % from https://github.com/gdiepen/latexbeamer-handoutWithNotes
\pgfpagesuselayout{1 on 1 with notes}[a4paper,border shrink=5mm]

\usetheme[hideothersubsections]{Goettingen}
\usecolortheme{default}

\begin{document}

\begin{frame}
    \only<1>{\centering \includegraphics[width=10cm]{example-image-a}}%
    \only<2>{\centering \includegraphics[width=10cm]{example-image-b}}%
\end{frame}

\end{document}

enter image description here