我用來pgfpages
製作 4up 講義。講義很長(整個學期),我想在新課程開始時開始新的一頁。我正在尋找的是像書中的程式碼一樣工作的程式碼,當新的章節開始時插入一個空頁面,並且新的章節將在錯誤的頁面上開始。
在 MWE 中,第 2 張之後的三張投影片應為空頁,第 2 部分應從新頁面的左上角開始。
編輯:
像這樣的事情\cleardoublepage
應該可以解決問題。但必須查看頁面計數器並檢查必須插入多少空白頁,直到下一頁可被四整除。我不知道如何在 LaTeX 中進行數學計算。任何幫助,將不勝感激。
\def\cleardoublepage{%
\clearpage%
\if@twoside%
\ifodd\c@page%
% do nothing
\else%
\emptypage@emptypage%
\fi%
\fi%
}%
氣象局:
\documentclass{beamer}
\author{Stefan Müller}
\title{The great test}
\usepackage{pgfpages}
\pgfpagesuselayout{4 on 1}[a4paper, border shrink=5mm, landscape]
\pgfpageslogicalpageoptions{1}{border code=\pgfusepath{stroke},
% resized height=.65\pgfphysicalheight,
% resized width=.65\pgfphysicalwidth,
center = \pgfpoint{.275\pgfphysicalwidth}{.74\pgfphysicalheight}
}
\pgfpageslogicalpageoptions{2}{border code=\pgfusepath{stroke},
% resized height=.65\pgfphysicalheight,
% resized width=.65\pgfphysicalwidth,
center = \pgfpoint{.725\pgfphysicalwidth}{.74\pgfphysicalheight}
}
\pgfpageslogicalpageoptions{3}{border code=\pgfusepath{stroke},
% resized height=.65\pgfphysicalheight,
% resized width=.65\pgfphysicalwidth,
center = \pgfpoint{.275\pgfphysicalwidth}{.26\pgfphysicalheight}
}
\pgfpageslogicalpageoptions{4}{border code=\pgfusepath{stroke},
% resized height=.65\pgfphysicalheight,
% resized width=.65\pgfphysicalwidth,
center = \pgfpoint{.725\pgfphysicalwidth}{.26\pgfphysicalheight}
}
\begin{document}
\frame{
\maketitle
}
\frame{
0
}
\section{1}
\subtitle{Session 1}
\frame{
\maketitle
}
\frame{1}
\section{2}
\frame{2}
\subtitle{Session 2}
\frame{
\maketitle
}
\section{3}
\frame{3}
\section{4}
\frame{4}
\section{5}
\frame{5}
\end{document}
答案1
您可以在字幕開頭檢查目前頁碼,然後根據需要插入空白頁:
\documentclass{beamer}
\author{Stefan Müller}
\title{The great test}
\usepackage{pgfpages}
\pgfpagesuselayout{4 on 1}[a4paper, border shrink=5mm, landscape]
\pgfpageslogicalpageoptions{1}{border code=\pgfusepath{stroke},
% resized height=.65\pgfphysicalheight,
% resized width=.65\pgfphysicalwidth,
center = \pgfpoint{.275\pgfphysicalwidth}{.74\pgfphysicalheight}
}
\pgfpageslogicalpageoptions{2}{border code=\pgfusepath{stroke},
% resized height=.65\pgfphysicalheight,
% resized width=.65\pgfphysicalwidth,
center = \pgfpoint{.725\pgfphysicalwidth}{.74\pgfphysicalheight}
}
\pgfpageslogicalpageoptions{3}{border code=\pgfusepath{stroke},
% resized height=.65\pgfphysicalheight,
% resized width=.65\pgfphysicalwidth,
center = \pgfpoint{.275\pgfphysicalwidth}{.26\pgfphysicalheight}
}
\pgfpageslogicalpageoptions{4}{border code=\pgfusepath{stroke},
% resized height=.65\pgfphysicalheight,
% resized width=.65\pgfphysicalwidth,
center = \pgfpoint{.725\pgfphysicalwidth}{.26\pgfphysicalheight}
}
\usepackage{pgffor}
\pretocmd{\subtitle}{
{
\setbeamertemplate{navigation symbols}{}
\pgfmathparse{int(mod(\thepage,4))}
\let\foo\pgfmathresult
\ifnum\foo=0
\begin{frame}[plain,noframenumbering]
\end{frame}
\fi
\ifnum\foo=2
\begin{frame}[plain,noframenumbering]
\end{frame}
\begin{frame}[plain,noframenumbering]
\end{frame}
\begin{frame}[plain,noframenumbering]
\end{frame}
\fi
\ifnum\foo=3
\begin{frame}[plain,noframenumbering]
\end{frame}
\begin{frame}[plain,noframenumbering]
\end{frame}
\fi
}
}{}{}
\makeatletter
\apptocmd{\beamer@subtitle}{\frame{\maketitle}}{}{}
\makeatother
\begin{document}
\frame{
\maketitle
}
\frame{
0
\pause
abc
}
\section{1}
\subtitle{Session 1}
\frame{1}
\section{2}
\frame{2}
\subtitle{Session 2}
\section{3}
\frame{3}
\section{4}
\frame{4}
\section{5}
\frame{5}
\end{document}