Beamer 讲义中的页码

Beamer 讲义中的页码

我正在用 Beamer 制作一些讲义,但我无法在文档中获得页码。我在每页上打印 4 个框架,我确实获得了框架编号,但我还需要页码。似乎我无法直接在生成的 PDF 中添加这些内容,至少不能用我的 Adob​​e Acrobat Reader DC 来添加,因此似乎必须在将文档转换为 PDF 之前完成此操作。这是我在序言中放入的内容的示例。

\documentclass[handout]{beamer}
\usepackage{pgfpages}
\pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm, landscape]
\setbeamertemplate{headline}{\scriptsize{\vspace*{0.3cm}\hspace*{0.3cm}

\insertframenumber}}
    \expandafter\def\expandafter\insertshorttitle\expandafter{%
      \insertshorttitle\hfill%
      \insertframenumber\,/\,\inserttotalframenumber}

\usefonttheme[onlymath]{serif}

\usetheme{Szeged}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage{tipa}
    \usepackage{eurosym}
\usepackage{wasysym}
\usepackage{colortbl}
\usepackage{wrapfig}
\usepackage{graphics}
\usepackage{linguex}
\usepackage{cgloss4e}
\usepackage{csquotes}
\usepackage{xspace}
\usepackage{color}
\usepackage{xyling}
\usepackage{setspace}
\usepackage{amsfonts}
\usepackage{phonetic}
\usepackage{multicol}
\usepackage{booktabs}

\usepackage[backend=biber, style=authoryear-comp]{biblatex}
\addbibresource{ref.bib}

% \strikeout{text}: prints a struck-out version of #1
\newlength{\howlong}
\newcommand{\strikeout}[1]{
 \settowidth{\howlong}{#1}%
 #1\unitlength0.5ex%
 \begin{picture}(0,0)
 \put(0,1){\line(-1,0){\howlong\divide\unitlength}}
 \end{picture}%
}

\setbeamertemplate{headline}{%
\leavevmode%
  \hbox{%
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{palette quaternary}%
    \insertsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll}
    \end{beamercolorbox}%
  }
}

\setbeamertemplate{footline}
{%
    \begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
    \end{beamercolorbox}
    \begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
        leftskip=.3cm,rightskip=.3cm plus1fil]{author in head/foot}%
        \leavevmode{\usebeamerfont{author in head/foot}\insertshortauthor}%
        \hfill%
        \leavevmode{\usebeamerfont{title in head/foot}\insertshorttitle}%
        \hfill%
        {\usebeamerfont{institute in head/foot}\usebeamercolor[fg]{institute in head/foot}\insertshortinstitute}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
    \end{beamercolorbox}
}

\setbeamercovered{transparent=30}
\beamertemplateballitem


\title{XXX}
\subtitle{YYY}
\author{ME}
\institute{Mordor}
\date{\today}

\newcommand{\textunderscript}[1]{$_{\text{#1}}$}

\begin{document}

\frame {
\frametitle{Flaflafla}

xxxxxxxx}

\end{document}

答案1

下面将在底部添加页码

\documentclass[handout]{beamer}
\usepackage{pgfpages}
\pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm, landscape]
\setbeamertemplate{headline}{\scriptsize{\vspace*{0.3cm}\hspace*{0.3cm}\insertframenumber}}
\expandafter\def\expandafter\insertshorttitle\expandafter{%
  \insertshorttitle\hfill%
  \insertframenumber\,/\,\inserttotalframenumber}

\makeatletter
\def\pgfsys@endpicture{%
    \makebox[\pgfphysicalwidth]{\the\numexpr\value{page}/4\relax}%
}
\makeatother


\begin{document}
\frame{}
\end{document}

在此处输入图片描述


编辑:

与问题中的 MWE

\documentclass[handout]{beamer}
\usepackage{pgfpages}
\pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm, landscape]
\setbeamertemplate{headline}{\scriptsize{\vspace*{0.3cm}\hspace*{0.3cm}

\insertframenumber}}
    \expandafter\def\expandafter\insertshorttitle\expandafter{%
      \insertshorttitle\hfill%
      \insertframenumber\,/\,\inserttotalframenumber}

\usefonttheme[onlymath]{serif}

\usetheme{Szeged}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage{tipa}
    \usepackage{eurosym}
\usepackage{wasysym}
\usepackage{colortbl}
\usepackage{wrapfig}
\usepackage{graphics}
\usepackage{linguex}
\usepackage{cgloss4e}
\usepackage{csquotes}
\usepackage{xspace}
\usepackage{color}
\usepackage{xyling}
\usepackage{setspace}
\usepackage{amsfonts}
\usepackage{phonetic}
\usepackage{multicol}
\usepackage{booktabs}

\usepackage[backend=biber, style=authoryear-comp]{biblatex}
\addbibresource{ref.bib}

% \strikeout{text}: prints a struck-out version of #1
\newlength{\howlong}
\newcommand{\strikeout}[1]{
 \settowidth{\howlong}{#1}%
 #1\unitlength0.5ex%
 \begin{picture}(0,0)
 \put(0,1){\line(-1,0){\howlong\divide\unitlength}}
 \end{picture}%
}

\setbeamertemplate{headline}{%
\leavevmode%
  \hbox{%
    \begin{beamercolorbox}[wd=\paperwidth,ht=2.5ex,dp=1.125ex]{palette quaternary}%
    \insertsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll}
    \end{beamercolorbox}%
  }
}

\setbeamertemplate{footline}
{%
    \begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
    \end{beamercolorbox}
    \begin{beamercolorbox}[ht=2.5ex,dp=1.125ex,%
        leftskip=.3cm,rightskip=.3cm plus1fil]{author in head/foot}%
        \leavevmode{\usebeamerfont{author in head/foot}\insertshortauthor}%
        \hfill%
        \leavevmode{\usebeamerfont{title in head/foot}\insertshorttitle}%
        \hfill%
        {\usebeamerfont{institute in head/foot}\usebeamercolor[fg]{institute in head/foot}\insertshortinstitute}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
    \end{beamercolorbox}
}

\setbeamercovered{transparent=30}
\beamertemplateballitem


\makeatletter
\def\pgfsys@endpicture{%
    \makebox[\pgfphysicalwidth]{\the\numexpr\value{page}/4\relax}%
}
\makeatother

\title{XXX}
\subtitle{YYY}
\author{ME}
\institute{Mordor}
\date{\today}

\newcommand{\textunderscript}[1]{$_{\text{#1}}$}

\begin{document}

\frame {
\frametitle{Flaflafla}

xxxxxxxx}

\end{document}

在此处输入图片描述

答案2

另一种方法pgfpagespdfpages。在本例中,您创建 beamer 演示文稿,然后将其作为外部文件包含在文档中,handout如下所示:

\documentclass[a4paper, landscape]{article}
\usepackage[vmargin={2cm,1.5cm}]{geometry}
\usepackage{pdfpages}

\begin{document}
\includepdf[pages=1-8,nup=2x2,frame, scale=.9, delta= 10 10, pagecommand={}]{Numeracio}
\end{document}

在此处输入图片描述

相关内容