COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### pgfpages question (tangentially related to beamer)

• Follow

Hello,

I've configured beamer so that when I invoke it with the "handout"
option it generates output with the slides configured in a 2x2 form
and a border around them.  The code I have in the preamble to do this
is the following:

\mode<handout>{%
\pgfpagesuselayout{4 on 1}[a4paper,landscape,border shrink=5mm]
\pgfpageslogicalpageoptions{1}{border code=\pgfstroke}
\pgfpageslogicalpageoptions{2}{border code=\pgfstroke}
\pgfpageslogicalpageoptions{3}{border code=\pgfstroke}
\pgfpageslogicalpageoptions{4}{border code=\pgfstroke}
}

The problem is that when the presentation contains a number of pages
which is not a multiple of four, this particular setup causes a number
of empty square "pages", with the frame drawn around them, to appear
on the last page of the handout. I tried to fix this by resetting some
of the logical page options I've passed on to beamer as follows:

%
% The following frame is the last frame of the presentation,
% and it is the only frame appearing on the last page
% of the handout. Hence logical pages 2-4 should have
% their border code cleared out so that no frame is drawn.
%
\clearpage
\pgfpageslogicalpageoptions{1}{border code=\pgfstroke}
\pgfpageslogicalpageoptions{2}{}
\pgfpageslogicalpageoptions{3}{}
\pgfpageslogicalpageoptions{4}{}

\begin{frame}[allowframebreaks]
\bibliographystyle{plainnat}
\bibliography{/Volumes/iDisk/Documents/Bibliography.bib}
\end{frame}

That doesn't work, though - I still get three empty logical pages with
a frame drawn around them on the last physical page. Any suggestions
would be greatly appreciated...

Many thanks,

Jason

--
Dr J. McKenzie Alexander
Department of Philosophy, Logic and Scientific Method
London School of Economics and Political Science
Houghton Street, London WC2A 2AE

 0
Reply jmckalex (4) 11/17/2009 11:31:59 AM

Hello,

I figured out an answer to my question and I thought I would post the
solution in case anyone else is interested.

The trick is to define a new counter to keep track of how many times
\pgfstroke has been called to draw the border of a logical page. The
following defines a new macro named \mystroke which expands to
\pgfstroke only for a certain number of logical pages. Obviously the
value of 34 below should be replaced by the actual number of logical
pages in the handout, plus one.

\newcounter{logicalpage}
\setcounter{logicalpage}{0}
\ifnum\value{logicalpage}<34\pgfstroke\fi}
\mode<handout>{%
\pgfpagesuselayout{4 on 1}[a4paper,landscape,border shrink=3D5mm]
\pgfpageslogicalpageoptions{1}{border code=3D\mystroke}
\pgfpageslogicalpageoptions{2}{border code=3D\mystroke}
\pgfpageslogicalpageoptions{3}{border code=3D\mystroke}
\pgfpageslogicalpageoptions{4}{border code=3D\mystroke}
}

Cheers,

Jason

--
Dr J. McKenzie Alexander
Department of Philosophy, Logic and Scientific Method
London School of Economics and Political Science
Houghton Street, London WC2A 2AE

On 17 Nov, 11:31, "J. McKenzie Alexander" <jmcka...@gmail.com> wrote:
> Hello,
>
> I've configuredbeamerso that when I invoke it with the "handout"
> option it generates output with the slides configured in a 2x2 form
> and a border around them. =A0The code I have in the preamble to do this
> is the following:
>
> \mode<handout>{%
> =A0 \pgfpagesuselayout{4 on 1}[a4paper,landscape,border shrink=3D5mm]
> =A0 \pgfpageslogicalpageoptions{1}{border code=3D\pgfstroke}
> =A0 \pgfpageslogicalpageoptions{2}{border code=3D\pgfstroke}
> =A0 \pgfpageslogicalpageoptions{3}{border code=3D\pgfstroke}
> =A0 \pgfpageslogicalpageoptions{4}{border code=3D\pgfstroke}
>
> }
>
> The problem is that when the presentation contains a number of pages
> which is not a multiple of four, this particular setup causes a number
> of empty square "pages", with the frame drawn around them, to appear
> on the last page of the handout. I tried to fix this by resetting some
> of the logical page options I've passed on tobeameras follows:
>
> %
> % The following frame is the last frame of the presentation,
> % and it is the only frame appearing on the last page
> % of the handout. Hence logical pages 2-4 should have
> % their border code cleared out so that no frame is drawn.
> %
> \clearpage
> \pgfpageslogicalpageoptions{1}{border code=3D\pgfstroke}
> \pgfpageslogicalpageoptions{2}{}
> \pgfpageslogicalpageoptions{3}{}
> \pgfpageslogicalpageoptions{4}{}
>
> \begin{frame}[allowframebreaks]
> =A0 \frametitle{References and miscellaneous readings}
> =A0 \bibliographystyle{plainnat}
> =A0 \bibliography{/Volumes/iDisk/Documents/Bibliography.bib}
> \end{frame}
>
> That doesn't work, though - I still get three empty logical pages with
> a frame drawn around them on the last physical page. Any suggestions
> would be greatly appreciated...
>
> Many thanks,
>
> Jason
>
> --
> Dr J. McKenzie Alexander
> Department of Philosophy, Logic and Scientific Method
> London School of Economics and Political Science
> Houghton Street, London WC2A 2AE


 0
Reply jmckalex (4) 11/29/2009 7:02:19 PM

1 Replies
236 Views