我正在使用 Beamer 打印讲义。在讲义中,我需要一张幻灯片来展示一个定理和它旁边的一个图。讲义中的所有定理都使用包进行着色阴影定理。
但这个包似乎不能很好地与 minipage 配合使用。我试图放弃使用这个包,而是使用框架包,但阴影框中文本前后的间距与使用 shadetheorem 包的不匹配。
如何将阴影定理放入小页面中?我宁愿坚持使用 shadetheorem 包,因为我有许多其他定义和定理依赖于这个包。
\documentclass[12pt,handout,mathserif]{beamer}
% PACKAGES
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\usepackage{etex}% Gives more storage so that TeX will run properly
\usepackage{graphics}
\usepackage{color}
\usepackage{framed}
\usepackage{amsthm, array}
\usepackage{ragged2e}% justification of text
\usepackage{shadethm}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{calc, through, arrows, shadows, backgrounds, mindmap, patterns, plotmarks}
\RequirePackage{latexsym, verbatim, xspace, setspace}
\pgfplotsset{compat=1.10}
%%%%%%%%%%%%%%%%%%%%
%% 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}
{
\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{1pt}\strokeifnotempty,
border shrink=\pgfpageoptionborder,
resized width=.70\pgfphysicalwidth,
resized height=.52\pgfphysicalheight,
center = \pgfpoint{.25\pgfphysicalwidth + 9mm}{.75\pgfphysicalheight - 9mm}
}
\pgfpageslogicalpageoptions{2}{
border code=\pgfsetlinewidth{1pt}\strokeifnotempty,
border shrink=\pgfpageoptionborder,
resized width=.70\pgfphysicalwidth,
resized height=.52\pgfphysicalheight,
center = \pgfpoint{.75\pgfphysicalwidth - 9mm}{.75\pgfphysicalheight - 9mm}
}
\pgfpageslogicalpageoptions{3}{
border code=\pgfsetlinewidth{1pt}\strokeifnotempty,
border shrink=\pgfpageoptionborder,
resized width=.70\pgfphysicalwidth,
resized height=.52\pgfphysicalheight,
center = \pgfpoint{.25\pgfphysicalwidth + 9mm}{.25\pgfphysicalheight + 9mm}
}
\pgfpageslogicalpageoptions{4}{
border code=\pgfsetlinewidth{1pt}\strokeifnotempty,
border shrink=\pgfpageoptionborder,
resized width=.70\pgfphysicalwidth,
resized height=.52\pgfphysicalheight,
center = \pgfpoint{.75\pgfphysicalwidth - 9mm}{.25\pgfphysicalheight + 9mm}
}
}
\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); }
%
%
%Centered 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 }
\hspace*{\fill}\vskip2pt%
}
\setbeamertemplate{footline}[centered page number]
%
%
% END OF HANDOUT COMMANDS
%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%
\frenchspacing
\newshadetheorem{proposition}{Proposition}
\newshadetheorem{THM}{Theorem.}
\newshadetheorem{THM_mini}{Theorem in Minipage.}
\title[Title]{\bfseries Title}
\author[Author]{\large \bfseries Author}
\date[Date]{\large \bfseries Date}
\institute[University of X]
\begin{document}
%%%%%%%%%%%%%%%%%%%%
% Title Page
\begin{frame}[t]
\titlepage
\end{frame}
%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{THM}
Here is a theorem. Here is an equation:
\[
E = m c^2.
\]
Here is a theorem.
\end{THM}
\end{frame}
%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{columns}[onlytextwidth]
\begin{column}[c]{0.50\textwidth}
\begin{minipage}[c]{1.0\textwidth - 1ex}
\begin{THM_mini}
Here is a theorem. Here is an equation:
\[
E = m c^2.
\]
Here is a theorem.
\end{THM_mini}
\end{minipage}
\end{column}
\hfill%\vrule{}\hfill%
\begin{column}[c]{0.50\textwidth}
\centering
\begin{minipage}[c]{1.0\textwidth - 1ex}
%\vspace{-4.75ex}
\noindent \makebox[\textwidth][c]{
\hspace{4ex}
\begin{tikzpicture}[>=latex', scale=0.9, every node/.style={scale=0.95}]
% x-axis
\draw[semithick,->] (-0.5, 0) -- (3.5, 0)
node[below] {$x\vphantom{b}$};
% y-axis
\draw[semithick, ->] (0, -0.5) -- (0, 3.5)
node[left] {$y$};
\end{tikzpicture}
}
\vfill
\end{minipage}%
\end{column}
\end{columns}
\end{frame}
%%%%%%%%%%%%%%%%%%%%
\end{document}
答案1
你不需要列环境。只需将两个小页面并排放置在阴影定理环境内即可。
\begin{frame}
\begin{THM_mini}
\begin{minipage}[c]{0.58\textwidth}
Here is a theorem. Here is an equation:
\[
E = m c^2.
\]
Here is a theorem.
\end{minipage}
\begin{minipage}[c]{0.4\textwidth}
\begin{tikzpicture}[>=latex', scale=0.9, every node/.style={scale=0.95}]
% x-axis
\draw[semithick,->] (-0.5, 0) -- (3.5, 0)
node[below] {$x\vphantom{b}$};
% y-axis
\draw[semithick, ->] (0, -0.5) -- (0, 3.5)
node[left] {$y$};
\end{tikzpicture}
\end{minipage}%
\end{THM_mini}
\end{frame}
编辑:
由于我最初误解了 OP,所以这是他想要的实际答案:要获得具有一半文本宽度的阴影定理环境,\shadedtextwidth
必须在定义新的定理环境之前手动设置长度。
\setlength{\shadedtextwidth}{0.5\textwidth}
\newshadetheorem{THM_mini}{Theorem in Minipage.}
在这种情况下,小页面是没有必要的。
\begin{frame}
\begin{columns}[onlytextwidth]
\begin{column}[c]{0.50\textwidth}
\begin{THM_mini}
Here is a theorem. Here is an equation:
\[
E = m c^2.
\]
Here is a theorem.
\end{THM_mini}
\end{column}
\begin{column}[c]{0.50\textwidth}
\centering
\begin{tikzpicture}[>=latex', scale=0.9, every node/.style={scale=0.95}]
% x-axis
\draw[semithick,->] (-0.5, 0) -- (3.5, 0)
node[below] {$x\vphantom{b}$};
% y-axis
\draw[semithick, ->] (0, -0.5) -- (0, 3.5)
node[left] {$y$};
\end{tikzpicture}
\end{column}
\end{columns}
\end{frame}
编辑2:
再想想。第一个解决方案改变了所有阴影定理的宽度。这可能不是你想要的。也许一个简单的
\let\shadedtextwidth\textwidth
对您来说是一个更好的解决方案。这样,阴影定理的宽度始终是文本宽度。