simplified theorem code

This commit is contained in:
Jan Benda 2021-03-06 11:42:52 +01:00
parent 4d110dcc0c
commit 9ffbb28a3e

View File

@ -380,32 +380,32 @@
%%%%% block environments: %%%%% block environments:
\newcommand{\block@lines@begin}[3]{% \newcommand{\block@lines@begin}[4]{%
\par\vskip\medskipamount% \par\vskip\medskipamount%
\usebeamerfont{block title#1}% \usebeamerfont{#1 title#2}%
\setbox0=\hbox{\insertblocktitle\unskip}% does not work for theorem?! \setbox0=\hbox{\insertblocktitle\unskip}%
\ifdim\wd0=0pt\else% \ifdim\wd0=0pt\else%
\beamer@horizontal@line@top{block line#1 top}{#2} \beamer@horizontal@line@top{#1 line#2 top}{#3}
\begin{beamercolorbox}[wd=\linewidth,ht=2.4ex,dp=0.9ex,leftskip=2mm,rightskip=2mm]{block title#1} \begin{beamercolorbox}[wd=\linewidth,ht=2.4ex,dp=0.9ex,leftskip=2mm,rightskip=2mm]{#1 title#2}
\strut\insertblocktitle \strut\insertblocktitle
\end{beamercolorbox} \end{beamercolorbox}
\fi \fi
\nointerlineskip \nointerlineskip
\beamer@horizontal@line@top{block line#1 middle}{#3} \beamer@horizontal@line@top{#1 line#2 middle}{#4}
\usebeamerfont{block body#1}% \usebeamerfont{#1 body#2}%
\begin{beamercolorbox}[wd=\linewidth,colsep=2mm]{block body#1} \begin{beamercolorbox}[wd=\linewidth,colsep=2mm]{#1 body#2}
} }
\newcommand{\block@lines@end}[2]{% \newcommand{\block@lines@end}[3]{%
\vspace{-0.4ex}% \vspace{-0.4ex}%
\end{beamercolorbox}% \end{beamercolorbox}%
\beamer@horizontal@line@bottom{block line#1 bottom}{#2} \beamer@horizontal@line@bottom{#1 line#2 bottom}{#3}
} }
%%%%% block environment: %%%%% block environment:
\defbeamertemplate{block begin}{lines}[2]{\block@lines@begin{}{#1}{#2}} \defbeamertemplate{block begin}{lines}[2]{\block@lines@begin{block}{}{#1}{#2}}
\defbeamertemplate{block end}{lines}[1]{\block@lines@end{}{#1}} \defbeamertemplate{block end}{lines}[1]{\block@lines@end{block}{}{#1}}
\setbeamertemplate{block begin}[lines]{0.5pt}{0.5pt} \setbeamertemplate{block begin}[lines]{0.5pt}{0.5pt}
\setbeamertemplate{block end}[lines]{0.5pt} \setbeamertemplate{block end}[lines]{0.5pt}
@ -413,8 +413,8 @@
%%%%% block alerted environment: %%%%% block alerted environment:
\defbeamertemplate{block alerted begin}{lines}[2]{\block@lines@begin{ alerted}{#1}{#2}} \defbeamertemplate{block alerted begin}{lines}[2]{\block@lines@begin{block}{ alerted}{#1}{#2}}
\defbeamertemplate{block alerted end}{lines}[1]{\block@lines@end{ alerted}{#1}} \defbeamertemplate{block alerted end}{lines}[1]{\block@lines@end{block}{ alerted}{#1}}
\setbeamertemplate{block alerted begin}[lines]{0.5pt}{0.5pt} \setbeamertemplate{block alerted begin}[lines]{0.5pt}{0.5pt}
\setbeamertemplate{block alerted end}[lines]{0.5pt} \setbeamertemplate{block alerted end}[lines]{0.5pt}
@ -422,8 +422,8 @@
%%%%% block example environment: %%%%% block example environment:
\defbeamertemplate{block example begin}{lines}[2]{\block@lines@begin{ example}{#1}{#2}} \defbeamertemplate{block example begin}{lines}[2]{\block@lines@begin{block}{ example}{#1}{#2}}
\defbeamertemplate{block example end}{lines}[1]{\block@lines@end{ example}{#1}} \defbeamertemplate{block example end}{lines}[1]{\block@lines@end{block}{ example}{#1}}
\setbeamertemplate{block example begin}[lines]{0.5pt}{0.5pt} \setbeamertemplate{block example begin}[lines]{0.5pt}{0.5pt}
\setbeamertemplate{block example end}[lines]{0.5pt} \setbeamertemplate{block example end}[lines]{0.5pt}
@ -431,25 +431,6 @@
%%%%% theorem environments (theorem, corollary, fact, lemma, definition, example): %%%%% theorem environments (theorem, corollary, fact, lemma, definition, example):
\newcommand{\theorem@lines@begin}[3]{%
\par\vskip\medskipamount%
\usebeamerfont{#1 title}%
\beamer@horizontal@line@top{#1 line top}{#2}
\begin{beamercolorbox}[wd=\linewidth,ht=2.4ex,dp=0.9ex,leftskip=2mm,rightskip=2mm]{#1 title}
\strut \insertblocktitle
\end{beamercolorbox}
\nointerlineskip
\beamer@horizontal@line@top{#1 line middle}{#3}
\usebeamerfont{#1 body}%
\begin{beamercolorbox}[wd=\linewidth,colsep=2mm]{#1 body}
}
\newcommand{\theorem@lines@end}[2]{%
\vspace{-0.4ex}%
\end{beamercolorbox}%
\beamer@horizontal@line@bottom{#1 line bottom}{#2}
}
\newenvironment<>{theoremblock}[1]{% \newenvironment<>{theoremblock}[1]{%
\begin{actionenv}#2% \begin{actionenv}#2%
\def\insertblocktitle{#1}% \def\insertblocktitle{#1}%
@ -462,8 +443,8 @@
\renewcommand{\inserttheoremblockenv}{theoremblock} \renewcommand{\inserttheoremblockenv}{theoremblock}
\renewcommand{\inserttheoremheadfont}{} \renewcommand{\inserttheoremheadfont}{}
\defbeamertemplate{block theorem begin}{lines}[2]{\theorem@lines@begin{theorem}{#1}{#2}} \defbeamertemplate{block theorem begin}{lines}[2]{\block@lines@begin{theorem}{}{#1}{#2}}
\defbeamertemplate{block theorem end}{lines}[1]{\theorem@lines@end{theorem}{#1}} \defbeamertemplate{block theorem end}{lines}[1]{\block@lines@end{theorem}{}{#1}}
\setbeamertemplate{block theorem begin}[lines]{0.5pt}{0.5pt} \setbeamertemplate{block theorem begin}[lines]{0.5pt}{0.5pt}
\setbeamertemplate{block theorem end}[lines]{0.5pt} \setbeamertemplate{block theorem end}[lines]{0.5pt}