Beamer 讲义:4 对 1,位置已调整,但页码不正确

Beamer 讲义:4 对 1,位置已调整,但页码不正确

我需要制作 Beamer 讲义(4 对 1 或 8 对 1)。下面是我的 MWE。我认为通常的 4 对 1 幻灯片之间的空间太大,幻灯片太靠近页边距(打印讲义有时会切掉部分幻灯片)。所以我在 MWE 中包含了很多从本网站其他问题中提取的代码。页码不正确。我第一次排版时是正确的,但当我添加更多幻灯片时,事情就变得混乱了。我该如何修复页码?

\documentclass[12pt, handout]{beamer}

\usepackage{etex}
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\usepackage{graphics}
\usepackage{color}
\usepackage{framed}
\usepackage{amsthm, array}
\usepackage{yhmath}
\usepackage{cancel}
\usepackage{shadethm}
\usepackage{booktabs}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{calc,through,arrows,shadows,backgrounds,mindmap,calendar}
\RequirePackage{latexsym, verbatim, xspace, setspace}
\RequirePackage{tikz, pgflibraryplotmarks}

%%%%%%%%%%%%%%%%%%%%
% PRESENTATIONS
%
%
% Background color
%\setbeamercolor{normal text}{bg=red!20!yellow!25!}
%
%
% END OF PRESENTATION COMMANDS
%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%
%% HANDOUTS
%
%
\usepackage{pgffor}

\makeatletter
\def\strokeifnotempty{%
\expandafter\ifvoid\csname pgfpages@box@\the\pgf@cpn\endcsname
\let\@next=\relax
\else
\let\@next=\pgfstroke
\fi
\@next%
}
\makeatother

\mode<handout>
{
  \usepackage{pgf}
  \usepackage{pgfpages}

% 4 pages per sheet of paper
\pgfpagesdeclarelayout{4 on 1 new}%[letterpaper, border shrink=12mm, landscape]
{
  \edef\pgfpageoptionheight{\the\paperheight} 
  \edef\pgfpageoptionwidth{\the\paperwidth}
  \edef\pgfpageoptionborder{0pt}
}
{
\pgfpagesphysicalpageoptions{
logical pages=4, 
physical height=\pgfpageoptionheight, 
physical width=\pgfpageoptionwidth}
\pgfpageslogicalpageoptions{1}{border code=\pgfsetlinewidth{1.1pt}
\strokeifnotempty, 
border shrink=\pgfpageoptionborder, 
resized width=.5\pgfphysicalwidth, 
resized height=.5\pgfphysicalheight, 
center = \pgfpoint{.25\pgfphysicalwidth + 10mm}{.75\pgfphysicalheight - 10mm}
}
\pgfpageslogicalpageoptions{2}{border code=\pgfsetlinewidth{1.1pt}\strokeifnotempty, 
border shrink=\pgfpageoptionborder, 
resized width=.5\pgfphysicalwidth, 
resized height=.5\pgfphysicalheight, 
center = \pgfpoint{.75\pgfphysicalwidth - 10mm}{.75\pgfphysicalheight - 10mm}
}
\pgfpageslogicalpageoptions{3}{border code=\pgfsetlinewidth{1.1pt}\strokeifnotempty, 
border shrink=\pgfpageoptionborder, 
resized width=.5\pgfphysicalwidth, 
resized height=.5\pgfphysicalheight, 
center = \pgfpoint{.25\pgfphysicalwidth + 10mm}{.25\pgfphysicalheight + 10mm}
}
\pgfpageslogicalpageoptions{4}{border code=\pgfsetlinewidth{1.1pt}\strokeifnotempty, 
border shrink=\pgfpageoptionborder, 
resized width=.5\pgfphysicalwidth, 
resized height=.5\pgfphysicalheight, 
center = \pgfpoint{.75\pgfphysicalwidth - 10mm}{.25\pgfphysicalheight + 10mm}
}
}

\IfFileExists{\jobname.aux}{\pgfpagesuselayout{4 on 1 new}[letterpaper, 
border shrink=12mm, landscape] \nofiles}{}
}

% Make a border around frames
\setbeamertemplate{background canvas}{ \tikz \draw[semithick] 
    (current page.north west) 
    rectangle 
    (current page.south east); }

%Page numbering for handouts
\defbeamertemplate{footline}{centered page number}
{%
    \hspace*{\fill}%
    \usebeamercolor[fg]{page number in head/foot}%
    \usebeamerfont{page number in head/foot}%
    {\color{black} \scriptsize \insertpagenumber \,/\,\inserttotalframenumber}%
    \hspace*{\fill}\vskip2pt%
}
\setbeamertemplate{footline}[centered page number]
%
%
% END OF HANDOUT COMMANDS
%%%%%%%%%%%%%%%%%%%%%%%

\frenchspacing

\title{Title}
\subtitle{Subtitle}
\author{Author}
\date{Date}

\begin{document}
%%%%%%%%%%%%%%%%%%%%
% Title Page
\begin{frame}[t]
\titlepage
\end{frame}
%%%%%%%%%%%%%%%%%%%%
\begin{frame}
%
Here's a slide.
\end{frame}
%%%%%%%%%%%%%%%%%%%%
\begin{frame}
%
Here's a slide.
\end{frame}
%%%%%%%%%%%%%%%%%%%%
\end{document}

在此处输入图片描述

相关内容