如何取得單獨的 A4 pdf 中的 Beamer 簡報的目錄?

如何取得單獨的 A4 pdf 中的 Beamer 簡報的目錄?

我正在為一場講座做一個長投影機演示。

我想為整個簡報建立一個目錄,列出各個部分、章節以及每個框架的標題,以 A4 格式的單獨 pdf 檔案形式。

在這個單獨的 pdf 中添加所有帶有註釋的幻燈片的列印件也很有用,相當於每頁大約 3 張幻燈片。

您知道如何執行此操作嗎?

PS 我使用「Sapienza 簡報」作為主題(https://www.overleaf.com/latex/templates/sapienza-presentation/yyksmrskffhk

編輯: 下面的程式碼可以作為測試。章節環境聲明和主題模板所使用的所有圖像可以在背面模板連結上找到。作為輸出,我期望一個類似以下內容的目錄:

Sapienza Beamer 示範主題

  • 第一節
    • A章
      • 幻燈片 1
      • 投影片 2
      • 幻燈片 3
    • B章
      • 幻燈片 4
      • 投影片 5
  • 第二節
    • C章
      • 幻燈片 6
      • 幻燈片 7

然後列印所有投影片並附上相應的註釋。

\documentclass{beamer}
\usepackage{amsfonts,amsmath,oldgerm}
\usetheme{sintef}

\newcommand{\testcolor}[1]{\colorbox{#1}{\textcolor{#1}{test}}~\texttt{#1}}

\usefonttheme[onlymath]{serif}

\titlebackground*{assets/background}

\newcommand{\hrefcol}[2]{\textcolor{cyan}{\href{#1}{#2}}}

\title{Sapienza Beamer Presentation Theme}
\subtitle{Using \LaTeX\ to prepare slides}
\course{Master's Degree in Computer Science}
\author{\href{mailto:[email protected]}{Andrea Gasparini}}
\IDnumber{1234567}
\date{Academic Year 2021/2022}

\setbeameroption{show notes on second screen}
\setbeamertemplate{note page}[default] % See Beamer User Guide pag.197

\begin{document}
\maketitle

\section{First Section}
    \begin{chapter}[assets/background_negative]{}{Chapter A}
    \end{chapter}
        \begin{frame}{Slide 1}
            \note[item]{Note to Slide 1}
        \end{frame}
        \begin{frame}{Slide 2}
            \note[item]{Note to Slide 2}
        \end{frame}
        \begin{frame}{Slide 3}  
            \note[item]{Note to Slide 3}
        \end{frame}

    \begin{chapter}[assets/background_negative]{}{Chapter B}
    \end{chapter}
        \begin{frame}{Slide 4}
        \end{frame}
        \begin{frame}{Slide 5}  
        \end{frame}

\section{Second Section}
    \begin{chapter}[assets/background_negative]{}{Chapter C}
    \end{chapter}
        \begin{frame}{Slide 6}   
        \end{frame}
        \begin{frame}{Slide 7}
        \end{frame}
\end{document}

答案1

將框架標題新增至目錄

這已經解決了https://tex.stackexchange.com/a/17233/36296

您可能只想進行一些調整以隱藏Chapter A主題生成的框架。這裡有一些骯髒的黑客:

\documentclass{beamer}
\usepackage{amsfonts,amsmath,oldgerm}
\usetheme{sintef}

\setbeameroption{show notes on second screen}

\newcommand{\testcolor}[1]{\colorbox{#1}{\textcolor{#1}{test}}~\texttt{#1}}

\usefonttheme[onlymath]{serif}

\titlebackground*{assets/background}

\newcommand{\hrefcol}[2]{\textcolor{cyan}{\href{#1}{#2}}}

\title{Sapienza Beamer Presentation Theme}
\subtitle{Using \LaTeX\ to prepare slides}
\course{Master's Degree in Computer Science}
\author{\href{mailto:[email protected]}{Andrea Gasparini}}
\IDnumber{1234567}
\date{Academic Year 2021/2022}

\usepackage{bookmark}
\usepackage{etoolbox}

\newtoggle{hidetitles}
\togglefalse{hidetitles}

\makeatletter
% save the current definition of \beamer@@frametitle
\let\nobookmarkbeamer@@frametitle\beamer@@frametitle
% then patch it to do the bookmarks and/or TOC entries
\apptocmd{\beamer@@frametitle}{%
  % keep this to add the frame title to the TOC at the "subsection level"
  \iftoggle{hidetitles}{}{
  \addtocontents{toc}{\protect\beamer@subsectionintoc{\the\c@section}{0}{~~~~#1}{\the\c@page}{\the\c@part}%
        {\the\beamer@tocsectionnumber}}%
  }
  % keep this line to add a bookmark that shows up in the PDF TOC at the subsection level
  \bookmark[page=\the\c@page,level=3]{#1}%
  }%
  {\message{** patching of \string\beamer@@frametitle succeeded **}}%
  {\errmessage{** patching of \string\beamer@@frametitle failed **}}%

\pretocmd{\beamer@checknoslide}{%
  % ensure the bookmark is not created if the slide is filtered out
  \let\beamer@@frametitle\nobookmarkbeamer@@frametitle
  }%
  {\message{** patching of \string\beamer@checknoslide succeeded **}}%
  {\errmessage{** patching of \string\beamer@checknoslide failed **}}%


\renewenvironment{chapter}[3][]{% Args: image (optional), color, frame title
  \begingroup
  \addtocontents{toc}{\protect\beamer@subsectionintoc{\the\c@section}{0}{#3}{\the\c@page}{\the\c@part}%
          {\the\beamer@tocsectionnumber}}%
  \themecolor{main}
  \setbeamertemplate{footline}{}
  \ifstrempty{#2}{
    \setbeamercolor{frametitle}{fg=white}
    \setbeamercolor{normal text}{fg=white,bg=maincolor}
  }{
    \setbeamercolor{frametitle}{fg=white}
    \setbeamercolor{normal text}{fg=white,bg=#2}
  }
  \ifstrempty{#1}{}{\setbeamertemplate{background}{\TikzSplitSlide{#1}}}
  \setbeamertemplate{frametitle}{%
    \vspace*{8ex}
    \begin{beamercolorbox}[wd=0.45\textwidth]{frametitle}
      \usebeamerfont{frametitle}\insertframetitle\\
      \usebeamerfont{framesubtitle}\insertframesubtitle
    \end{beamercolorbox}
  }
  \toggletrue{hidetitles}
  \begin{frame}{#3}
  \hspace*{0.05\textwidth}%
  \minipage{0.35\textwidth}%
  \usebeamercolor[fg]{normal text}%
}{%
  \endminipage
  \end{frame}
  \endgroup
}

% Define sectioning and table of contents
\AtBeginSection[]
{
    \begingroup
    \toggletrue{hidetitles}
    \themecolor{main}
    \begin{frame}{Table of Contents}
        \tableofcontents[currentsection]
    \end{frame}
    \endgroup
}

\makeatother


\begin{document}
\maketitle

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

\section{First Section}
    \begin{chapter}[assets/background_negative]{}{Chapter A}
    \end{chapter}
        \begin{frame}{Slide 1}
        \end{frame}
        \begin{frame}{Slide 2} 
        \end{frame}
        \begin{frame}{Slide 3}  
        \end{frame}

    \begin{chapter}[assets/background_negative]{}{Chapter B}
    \end{chapter}
        \begin{frame}{Slide 4}
        \end{frame}
        \begin{frame}{Slide 5}  
        \end{frame}

\section{Second Section}
    \begin{chapter}[assets/background_negative]{}{Chapter C}
    \end{chapter}
        \begin{frame}{Slide 6}   
        \end{frame}
        \begin{frame}{Slide 7}
        \end{frame}
\end{document}

產生帶有文檔和幻燈片概述的 A4 文檔

使用新的 .tex 文檔,並將下面的程式碼替換document為簡報的名稱以及14您擁有的幻燈片數量。

\documentclass[t]{beamer}

\geometry{a4paper}

\usepackage{pgffor}
\usepackage{pdfpages}

\makeatletter
\newcommand{\mytoc}{%
  \def\beamer@toc@cs{show}%
  \def\beamer@toc@os{show}%
  \def\beamer@toc@css{show}%
  \def\beamer@toc@oss{show}%
  \def\beamer@toc@ooss{show}%
  \def\beamer@toc@csss{show}%
  \def\beamer@toc@osss{show}%
  \def\beamer@toc@oosss{show}%
  \def\beamer@toc@ooosss{show}%
  \beamer@showpartnumber=\c@part%
  \beamer@pausesectionsfalse%
  \beamer@pausesubsectionsfalse%
  \def\beamer@tocsections{<*>}%
  \setkeys{beamertoc}{firstsection=1}%
  {\makeatletter%
    \pause[0]%
    \@input{document.toc}%
    }%
  \vfill
}
\makeatother

\begin{document}

\begin{frame}
\mytoc
\end{frame}

\includepdf[page=1-,nup=1x3]{document}

\end{document}

在此輸入影像描述 在此輸入影像描述

相關內容