# Beamer - handoutWithNotes not working properly

I'm using the handoutWithNotes package but I have the problem that whenever the number of slides is not a multiple of the number of slides per page, too many notes pages are printed.

As an example, suppose I have 3 slides and I'm using

\pgfpagesuselayout{4 on 1 with notes}[a4paper,border shrink=5mm]


then 3 slides will be printed on the left and 4 notes on the right.

Now I'd like the notes section to not be printed when there is no corresponding slide. Can anybody give me a hint on how to do that?

P.S. A temporary fix is commenting out the copy from=8 part from the definition of page 8 of that layout, but I'd like something more flexible, which would work for any number of slides when using this layout.

-- Edit --

Here's the simplified version of my own presentation.

\documentclass[12 pt,handout]{beamer}
\usetheme[titleline=true,% Show a line below the frame title.
alternativetitlepage=true,% Use the fancy title page.
]{Torino}
\graphicspath{{images/}}    % Put all images in this directory. Avoids clutter.

\usepackage{handoutWithNotes}
\pgfpagesuselayout{4 on 1 with notes}[a4paper,border shrink=5mm]

\title{Test title}
\author [X.Y.] {X Y}
\date [November 2013] {November 9, 2013}

{%
\leavevmode%
\end{beamercolorbox}}%
\vskip0pt%
}

{%
\leavevmode%
\end{beamercolorbox}%
\end{beamercolorbox}%
\vspace*{2pt}
}

\begin{document}

\titlepage
\end{frame}

\begin{frame}{Overview}
\tableofcontents
\end{frame}

\section{Section 1}
\begin{frame}[t]{Frame 1}
\end{frame}

\end{document}


And the output is like this: http://i.stack.imgur.com/lc3Iw.png. What I want to avoid is the last Notes section, since there is no corresponding slide.

• Welcome to TeX.SX! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – egreg Nov 9 '13 at 16:39
• Thanks for the welcome :) I edited the original question. I hope there's enough information now. The theme can be found here, but the result is the same with Berlin theme for example. – Ana Nov 9 '13 at 17:38

As a workaround you could simply use beamers own note pages to place the lines.

\documentclass[12 pt,handout]{beamer}
\usetheme{Berlin}

\mode<handout>{
\usepackage{pgfpages}
\pgfpagesuselayout{8 on 1}[a4paper,border shrink=5mm]
\setbeamertemplate{note page}{%
\fontsize{12pt}{32pt}\selectfont
Notes

\rule{\textwidth}{1pt} \rule{\textwidth}{1pt} \rule{\textwidth}{1pt} \rule{\textwidth}{1pt} \rule{\textwidth}{1pt} \rule{\textwidth}{1pt} \rule{\textwidth}{1pt} \rule{\textwidth}{1pt}\par
}

\setbeameroption{show notes}
}
\makeatletter
\def\beamer@framenotesbegin{%   at beginning of slide
\gdef\beamer@noteitems{}%
\gdef\beamer@notes{{}}% used to be totally  empty.
}
\makeatother

\title{Test title}
\author [X.Y.] {X Y}
\date [November 2013] {November 9, 2013}

\begin{document}

\titlepage
\end{frame}

\begin{frame}{Overview}
\tableofcontents
\end{frame}

\section{Section 1}
\begin{frame}[t]{Frame 1}
\end{frame}

\end{document}