summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/beamer-contrib
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-09-15 03:15:34 +0000
committerNorbert Preining <norbert@preining.info>2022-09-15 03:15:34 +0000
commit6d44c638512eb736c41551c5887b4475a14935bf (patch)
tree2f7c144e0e682047bc8ed9a411f4ca762ba1d300 /macros/latex/contrib/beamer-contrib
parent9fb667bb165065e655a81b1eaf7b61f2f03825ec (diff)
CTAN sync 202209150315
Diffstat (limited to 'macros/latex/contrib/beamer-contrib')
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md2
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty171
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdfbin181132 -> 177229 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex48
4 files changed, 127 insertions, 94 deletions
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md
index 17b1e7e79b..f950f9b51b 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/README.md
@@ -2,7 +2,7 @@
A beamer inner theme which reproduces standard beamer blocks using tcolorboxes
-Current version: 2022/09/06 version v0.4
+Current version: 2022/09/14 version v0.5
This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty
index 4b50b04ca1..7878e5620e 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty
@@ -12,40 +12,76 @@
% See http://www.latex-project.org/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ProvidesPackage{beamerinnerthemetcolorbox}[2022/09/06 version v0.4 Beamer blocks with tcolorboxes]
+\ProvidesPackage{beamerinnerthemetcolorbox}[2022/09/14 version v0.5 Beamer blocks with tcolorboxes]
\RequirePackage{tcolorbox}
\tcbuselibrary{skins,hooks}
+\providecommand\@secondofthree[3]{#2}
+
\tcbset{
- beamer@tcb@iftitle/.code n args={1}{
- \ifbeamer@tcb@title
- \pgfkeysalso{#1}
- \fi
+ beamer@tcb@if/.code n args = {3}{%
+ \csname #1\endcsname\expandafter\@secondofthree\fi
+ \@secondoftwo{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}%
}
}
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Theme Options
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif\ifbeamer@tcb@rounded
\newif\ifbeamer@tcb@shadow
\newif\ifbeamer@tcb@shaded
-\newif\ifbeamer@tcb@title
+\newif\ifbeamer@tcb@showtitle
\newif\ifbeamer@tcb@inmargin
+\newif\ifbeamer@tcb@color
+\newif\ifbeamer@tcb@left
+\newif\ifbeamer@tcb@right
+\newif\ifbeamer@tcb@center
+\newif\ifbeamer@tcb@titlepage
+\newif\ifbeamer@tcb@blocks
+\beamer@tcb@colortrue
\def\beamer@tcb@true{true}
+\tikzset{
+ /beamer@tcb/.cd,
+ wd/.store in = \beamer@tcb@wd,
+ wd = \textwidth,
+ dp/.code = \relax,
+ ht/.code = \relax,
+ left/.code = \beamer@tcb@lefttrue,
+ right/.code = \beamet@tcb@righttrue,
+ center/.code = \beamer@tcb@centertrue,
+ leftskip/.store in = \beamer@tcb@leftskip,
+ leftskip = 0.05cm,
+ rightskip/.store in = \beamer@tcb@rightskip,
+ rightskip = 0.05cm,
+ sep/.store in = \beamer@tcb@sep,
+ sep = 1mm,
+ colsep/.code = \relax,
+ colsep*/.code = \relax,
+ shadow/.code = \relax,
+ rounded/.code = \relax,
+ ignorebg/.code = \relax,
+ vmode/.code = \relax,
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Theme Options
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareOptionBeamer{shadow}[true]{\csname beamer@tcb@shadow#1\endcsname}
-\DeclareOptionBeamer{rounded}[true]{\csname beamer@tcb@rounded#1\endcsname\csname beamer@tcb@shaded#1\endcsname}
+\DeclareOptionBeamer{rounded}[true]{\csname beamer@tcb@rounded#1\endcsname\csname beamer@tcb@shaded#1\endcsname\csname beamer@tcb@showtitlefalse\endcsname}
\DeclareOptionBeamer{shaded}[true]{\csname beamer@tcb@shaded#1\endcsname}
\DeclareOptionBeamer{inmargin}[true]{\csname beamer@tcb@inmargin#1\endcsname}
+\DeclareOptionBeamer{showtitle}[true]{\csname beamer@tcb@showtitle#1\endcsname}
+\DeclareOptionBeamer{titlepage}[true]{\csname beamer@tcb@titlepage#1\endcsname}
+\DeclareOptionBeamer{blocks}[true]{\csname beamer@tcb@blocks#1\endcsname}
\ExecuteOptionsBeamer{shadow=false}
\ExecuteOptionsBeamer{rounded=false}
\ExecuteOptionsBeamer{shaded=false}
\ExecuteOptionsBeamer{inmargin=false}
+\ExecuteOptionsBeamer{showtitle=true}
+\ExecuteOptionsBeamer{titlepage=true}
+\ExecuteOptionsBeamer{blocks=true}
% check options from other themes
\ifdefined\beamer@themerounded@shadow
@@ -54,6 +90,7 @@
\ifx\beamer@themerounded@shadow\beamer@tcb@true
\beamer@tcb@shadowtrue
\fi
+ \beamer@tcb@showtitlefalse
\fi
\ifdefined\beamer@putleft
@@ -112,7 +149,6 @@
}
\else
\tcbsetforeverylayer{sharpish corners}
- \beamer@tcb@titletrue
\fi
\ifbeamer@tcb@shaded
@@ -143,58 +179,63 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\mode<presentation>
-% normal block
-\setbeamertemplate{block begin}{%
- \beamer@tcb@colini
- \ifx\insertblocktitle\@empty\else
- \beamer@tcb@titletrue
- \fi
- \begin{tcolorbox}[
- colback=beamer@tcb@bodybg,
- colbacktitle=beamer@tcb@titlebg,
- coltext=beamer@tcb@bodyfg,
- coltitle=beamer@tcb@titlefg,
- before title={\usebeamerfont{block title}},
- before upper={\usebeamercolor{block body}\usebeamerfont{block body}},
- beamer@tcb@iftitle={title={\insertblocktitle}}
- ]
-}
-\setbeamertemplate{block end}{\end{tcolorbox}}
-
-% alert block
-\setbeamertemplate{block alerted begin}{%
- \beamer@tcb@colini[ alerted]
- \ifx\insertblocktitle\@empty\else
- \beamer@tcb@titletrue
- \fi
- \begin{tcolorbox}[
- colback=beamer@tcb@bodybg,
- colbacktitle=beamer@tcb@titlebg,
- coltext=beamer@tcb@bodyfg,
- coltitle=beamer@tcb@titlefg,
- before title={\usebeamerfont{block title alerted}},
- before upper={\usebeamercolor{block body alerted}\usebeamerfont{block body alerted}},
- beamer@tcb@iftitle={title={\insertblocktitle}}
- ]
-}
-\setbeamertemplate{block alerted end}{\end{tcolorbox}}
-
-% example block
-\setbeamertemplate{block example begin}{%
- \beamer@tcb@colini[ example]
- \ifx\insertblocktitle\@empty\else
- \beamer@tcb@titletrue
- \fi
- \begin{tcolorbox}[
+\newtcolorbox{beamer@tcb@block}[1][]{
+ code={
+ \beamer@tcb@colini[#1]
+ \ifx\insertblocktitle\@empty\else
+ \beamer@tcb@showtitletrue
+ \fi
+ },
+ colback=beamer@tcb@bodybg,
+ colbacktitle=beamer@tcb@titlebg,
+ coltext=beamer@tcb@bodyfg,
+ coltitle=beamer@tcb@titlefg,
+ before title={\usebeamerfont{block title}},
+ before upper={\usebeamercolor{block body}\usebeamerfont{block body}},
+ beamer@tcb@if={ifbeamer@tcb@showtitle}{title={\insertblocktitle}}{},
+}
+
+\ifbeamer@tcb@blocks
+ \setbeamertemplate{block begin}{\begin{beamer@tcb@block}}
+ \setbeamertemplate{block end}{\end{beamer@tcb@block}}
+ \setbeamertemplate{block alerted begin}{\begin{beamer@tcb@block}[ alerted]}
+ \setbeamertemplate{block alerted end}{\end{beamer@tcb@block}}
+ \setbeamertemplate{block example begin}{\begin{beamer@tcb@block}[ example]}
+ \setbeamertemplate{block example end}{\end{beamer@tcb@block}}
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% patch title page etc.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\beamer@tcb@patchcolorbox}{%
+ \renewtcolorbox{beamercolorbox}[2][]{%
+ code={%
+ \usebeamercolor{##2}%
+ \colorlet{beamer@tcb@bodybg}{##2.bg}%
+ \colorlet{beamer@tcb@bodyfg}{##2.fg}%
+ \ifbeamercolorempty[bg]{##2}{}{\beamer@tcb@colorfalse}%
+ \tikzset{/beamer@tcb/.cd,##1}%
+ },
colback=beamer@tcb@bodybg,
- colbacktitle=beamer@tcb@titlebg,
coltext=beamer@tcb@bodyfg,
- coltitle=beamer@tcb@titlefg,
- before title={\usebeamerfont{block title example}},
- before upper={\usebeamercolor{block body example}\usebeamerfont{block body example}},
- beamer@tcb@iftitle={title={\insertblocktitle}}
- ]
-}
-\setbeamertemplate{block example end}{\end{tcolorbox}}
+ beamer@tcb@if={ifbeamer@tcb@color}{no shadow}{boxsep=\beamer@tcb@sep},
+ width=\beamer@tcb@wd,
+ beamer@tcb@if={ifbeamer@tcb@center}{halign=center}{},
+ beamer@tcb@if={ifbeamer@tcb@left}{halign=left}{},
+ beamer@tcb@if={ifbeamer@tcb@right}{halign=right}{},
+ left=\beamer@tcb@leftskip,
+ right=\beamer@tcb@rightskip,
+ }%
+}
+
+\ifbeamer@tcb@titlepage
+ \addtobeamertemplate{title page}{\begingroup\beamer@tcb@patchcolorbox}{\endgroup}
+ \addtobeamertemplate{part page}{\begingroup\beamer@tcb@patchcolorbox}{\endgroup}
+ \addtobeamertemplate{section page}{\begingroup\beamer@tcb@patchcolorbox}{\endgroup}
+ \addtobeamertemplate{subsection page}{\begingroup\beamer@tcb@patchcolorbox}{\endgroup}
+\fi
\mode<all>
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf
index 07d7d84c78..6c7f2c6a11 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex
index 234082375d..1adec46b48 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex
@@ -68,6 +68,15 @@
\lstset{style=tcolorboxstyle}
+%\makeatletter
+\newcommand{\prefix}{./build}
+\tcbset{
+ compilable listing/.style={listing file={\prefix/\jobname-listing-\thetcblistingcount.tex}},
+ run pdflatex/.style={run@system@command={cd\space \prefix;\space pdflatex}{\jobname-listing-\thetcblistingcount.tex}},%
+}
+%\makeatother
+
+
% meta %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{The tcolorbox beamer inner theme}
\subtitle{A beamer inner theme to reproduce standard beamer blocks using tcolorboxes}
@@ -77,7 +86,7 @@
\url{https://github.com/samcarter/beamertheme-tcolorbox}\\
\url{https://www.ctan.org/pkg/beamertheme-tcolorbox}
}{samcarter}}
-\date{Version v0.4 \textendash{} 2022/09/06}
+\date{Version v0.5 \textendash{} 2022/09/14}
\begin{document}
\maketitle
@@ -89,9 +98,7 @@ Over the last decade of answering beamer problems and more recently also being o
For all these cases, there is now an alternative to the default beamer blocks: The tcolorbox inner beamer theme will replace the usual beamer mechanism to draw blocks with tcolorboxes. The tcolorboxes will automatically adopt the look and feel (round vs.\ sharp corners and shadows) as well as the colours of the normal beamer blocks.
-The package is included in \TeX{}Live
-%and MiK\TeX\
-and available from \textsc{CTAN} (\url{https://www.ctan.org/pkg/beamertheme-tcolorbox}).
+The package is included in \TeX{}Live and MiK\TeX\ and available from \textsc{CTAN} (\url{https://www.ctan.org/pkg/beamertheme-tcolorbox}).
The development version of this package is located at \url{https://github.com/samcarter/beamertheme-tcolorbox}. If you have any problems, ideas or other feedback, please make constructive use of the issue tracker.
Copyright \raisebox{0.2em}{\tiny\fontfamily{cmr}\selectfont\textcopyright} \texttt{samcarter}. Permission is granted to copy, distribute and\slash or modify this software under the terms of the LaTeX project public licence, version 1.3c or later \url{http://www.latex-project.org/lppl.txt}.
@@ -137,28 +144,19 @@ In this simple configuration, the look and feel of the new blocks will be taken
\section{Options}
-In addition to automatically adopting settings from the other themes, one can also influence the look and feel via these options:
+In addition to automatically adopting settings from other themes, one can also explicitly influence the look and feel via these options:
\begin{description}
-\item[inmargin] controls if the block titles are placed in the left sidebar instead of the top of the block, e.g. for themes like \lstinline|Bergen| (default: \lstinline|false|)
-\item[rounded] controls if corners are rounded or sharp (default: \lstinline|false|)
-\item[shadow] controls if the block has a shadow (default: \lstinline|false|)
-\item[shaded] controls if there is a short colour gradient between the title and the body or if there is a sharp border between the colours (Default: \lstinline|false|; if rounded corners are activated, it is \lstinline|true|)
+\item[blocks] controls if tcolorboxes should be used for beamer blocks (default: \lstinline|true|)
+\item[inmargin] controls if the block titles are placed in the left sidebar instead of the top of the block, e.g. for themes like \lstinline|Bergen| (default: \lstinline|false|, but set to \lstinline|true| if the \lstinline|inmargin| inner theme is detected)
+\item[rounded] controls if corners are rounded or sharp (default: \lstinline|false|, but set to \lstinline|true| if the \lstinline|rounded| inner theme is detected)
+\item[shaded] controls if there is a short colour gradient between the title and the body (default: \lstinline|false|, but set to \lstinline|true| if the block corners are rounded)
+\item[shadow] controls if the block has a shadow (default: \lstinline|false|, but set to \lstinline|true| if the \lstinline|shadow| outer theme is detected)
+\item[showtitle] controls if a small coloured stripe is shown for blocks with empty title (default: \lstinline|true|, but set to \lstinline|false| if the block has rounded corners)
+\item[titlepage] controls if tcolorboxes should be used for the title page, section page etc. (default: \lstinline|true|)
\end{description}
These options can be set to \lstinline|true| or \lstinline|false| (calling either option without explicit \lstinline|true| or \lstinline|false| will set it to \lstinline|true|).
-\begin{tcolorbox}[title={}]
-\begin{lstlisting}
-\useinnertheme[
- rounded,
- shadow=false,
- shaded,
- inmargin=false
-]{tcolorbox}
-\end{lstlisting}
-\end{tcolorbox}
-
-If one for example likes the Antibes theme, but prefers the blocks to have shadows, they can now easily be added:
-
+If one for example likes the Antibes theme, but prefers the blocks to have shadows, they can now easily be added: \nopagebreak
\begin{tcblisting}{
listing and comment,
pdf comment,
@@ -217,10 +215,4 @@ Beyond these two options, the users also has the myriads of options of the tcolo
\end{document}
\end{tcblisting}
-\section{Caveats and known issues}
-
-\begin{itemize}
-\item at the moment, this theme only applies to blocks. Things like the title page, which directly use beamercolorboxes, won't be replaced by tcolorboxes
-\end{itemize}
-
\end{document}