[Tex/LaTex] Beamer – handoutWithNotes not working properly

beamernotes

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?

Thanks in advance!

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}

\defbeamertemplate*{footline}{shadow theme}
{%
  \leavevmode%
  \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex,leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle\hfill\insertframenumber\,/\,\inserttotalframenumber
  \end{beamercolorbox}}%
  \vskip0pt%
}

\setbeamertemplate{headline}
{%
  \leavevmode%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex]{section in head/foot}%
    \hbox to .5\paperwidth{\hfil\insertsectionhead\hfil}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex]{subsection in head/foot}%
    \hbox to .5\paperwidth{\hfil\insertsubsectionhead\hfil}
  \end{beamercolorbox}%
  \vspace*{2pt}
}

\setbeamertemplate{navigation symbols}{}

\begin{document}


\begin{frame}[plain,noframenumbering]
    \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.

Best Answer

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}

\begin{frame}[plain,noframenumbering]
    \titlepage
\end{frame}


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

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

\end{document}

enter image description here

Related Question