From b825fc441eefcdb4398fc48fe2d0534d192e649e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 26 Aug 2022 19:57:46 +0000 Subject: beamertheme-tcolorbox (26aug22) git-svn-id: svn://tug.org/texlive/trunk@64201 c570f23f-e606-0410-a88d-b1316a301751 --- .../doc/latex/beamertheme-tcolorbox/README.md | 9 + .../beamertheme-tcolorbox-doc.pdf | Bin 0 -> 184434 bytes .../beamertheme-tcolorbox-doc.tex | 244 +++++++++++++++++++++ .../beamerinnerthemetcolorbox.sty | 173 +++++++++++++++ Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/tlpsrc/beamertheme-tcolorbox.tlpsrc | 0 Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 + 7 files changed, 428 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/latex/beamertheme-tcolorbox/README.md create mode 100644 Master/texmf-dist/doc/latex/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf create mode 100644 Master/texmf-dist/doc/latex/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex create mode 100644 Master/texmf-dist/tex/latex/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty create mode 100644 Master/tlpkg/tlpsrc/beamertheme-tcolorbox.tlpsrc diff --git a/Master/texmf-dist/doc/latex/beamertheme-tcolorbox/README.md b/Master/texmf-dist/doc/latex/beamertheme-tcolorbox/README.md new file mode 100644 index 00000000000..b4d801af92c --- /dev/null +++ b/Master/texmf-dist/doc/latex/beamertheme-tcolorbox/README.md @@ -0,0 +1,9 @@ +# TikZbricks + +A beamer inner theme which reproduces standard beamer blocks using tcolorboxes + +Current version: 2022/08/26 version v0.1 + +This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt + +The project repository, including a bug tracker, can be found at https://github.com/samcarter/beamertheme-tcolorbox/issues diff --git a/Master/texmf-dist/doc/latex/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf b/Master/texmf-dist/doc/latex/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf new file mode 100644 index 00000000000..a7f1c3da6cf Binary files /dev/null and b/Master/texmf-dist/doc/latex/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.pdf differ diff --git a/Master/texmf-dist/doc/latex/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex b/Master/texmf-dist/doc/latex/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex new file mode 100644 index 00000000000..1178483de9e --- /dev/null +++ b/Master/texmf-dist/doc/latex/beamertheme-tcolorbox/beamertheme-tcolorbox-doc.tex @@ -0,0 +1,244 @@ +% !TeX document-id = {ba2bf522-7c7a-4e0b-b68d-dc54a96e4f4a} +% !TeX TS-program = latexmk -time -pdf -pdflatex="pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %%O %%S" % | txs:///view-log | txs:///view-pdf + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Documentation for the tcolorbox inner theme +% A beamer inner theme which reproduces standard beamer blocks using tcolorboxes +% Maintained by samcarter +% +% Project repository and bug tracker: +% https://github.com/samcarter/beamertheme-tcolorbox +% +% Released under the LaTeX Project Public License v1.3c or later +% See http://www.latex-project.org/lppl.txt +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\documentclass[parskip=half]{scrartcl} + +% packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage[T1]{fontenc} +\usepackage[utf8]{inputenc} +\usepackage[english]{babel} +\usepackage[bitstream-charter]{mathdesign} +%\usepackage{duckuments} +\usepackage{tikz} +\usetikzlibrary{matrix} +\usepackage[most]{tcolorbox} +\usepackage[paper=a4paper,margin=2.9cm]{geometry} +\usepackage{url} +\usepackage{xspace} +\usepackage{scrlayer-scrpage} +\usepackage[hang,flushmargin,bottom]{footmisc} +\usepackage[colorlinks=true,breaklinks=true,urlcolor=blendedblue,linkcolor=blendedblue,citecolor=blendedblue,filecolor=blendedblue]{hyperref} + +% macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newcommand{\CTAN}{\textsc{CTAN}\xspace} +\newcommand{\TikZ}{Ti\emph{k}Z\xspace} +\newcommand{\miktex}{MiK\TeX\xspace} +\newcommand{\texlive}{\TeX{}Live\xspace} + +% customisation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\definecolor{blendedblue}{rgb}{0.2,0.2,0.7} +\definecolor{marmotred}{RGB}{140,20,40} +\addtokomafont{sectioning}{\color{blendedblue}} +\addtokomafont{date}{\normalsize} +\addtokomafont{author}{\normalsize} +\setlength{\footnotemargin}{0.7em} + +% from https://tex.stackexchange.com/a/147848 +\def\beginlstdelim#1#2#3% +{% + \def\endlstdelim{#2\egroup}% + \ttfamily#1\bgroup\color{#3}\aftergroup\endlstdelim% +} + +\lstdefinestyle{beamertheme-tcolorboxstyle}{% + language={[latex]TeX}, + tabsize=2, + breaklines, + basicstyle=\footnotesize\ttfamily, + commentstyle={\color{teal}\slshape}, + columns=fullflexible, + texcsstyle=*\color{blendedblue}\bfseries, + keywordstyle=\color{red!60!black}\bfseries, + morekeywords={tikzpicture,scope}, + moretexcs={path,node,draw,clip,pic,includegraphics,color,piece,tile,beamertheme-tcolorbox}, + delim ={[s][\ttfamily\color{green!50!black}]{$}{$}}, + moredelim=[is][\footnotesize\ttfamily\color{orange!70!black}]{|}{|}, + moredelim={[s][\color{gray}]{<}{>}}, +% moredelim = **[is][\beginlstdelim{\{}{\}}{orange!70!black}]{\{}{\}}, +% moredelim = **[is][\beginlstdelim{[}{]}{orange!70!black}]{[}{]}, +} + +\tcbset{% + colframe=blendedblue, + arc=2mm, + fonttitle=\bfseries, + sidebyside, + listing options={style=beamertheme-tcolorboxstyle}, +% center lower, +% righthand width=6cm, + bottom=0pt, + top=0pt, +% sidebyside gap=10pt, + lower separated=false, +} + +\lstset{style=beamertheme-tcolorboxstyle} + +% meta %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\title{The tcolorbox beamer inner theme} +\subtitle{A beamer inner theme to reproduce standard beamer blocks using tcolorboxes} +\author{% + \texorpdfstring{ + \texttt{samcarter}\\ + \url{https://github.com/samcarter/beamertheme-tcolorbox}\\ +% \url{https://www.ctan.org/pkg/beamertheme-tcolorbox} + }{samcarter}} +\date{Version v0.1 \textendash{} 2022/08/26} + +\begin{document} +\maketitle + +\section{Introduction} +\label{intro} + +Over the last decade of answering beamer problems and more recently also being one of the maintainers of the beamer class, I saw countless of requests about beamer blocks. There were users who were looking for sometimes smaller, sometimes larger tweaks to the blocks in their document, for example "How to use the rectangular blocks with sharp corners, but with the shadows from the rounded beamer blocks". Other users encountered various tiny or something bigger problems with the default beamer blocks, like issues with some pdf viewers in which the seams of the underlying colorboxes would become visible. + +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 both \texlive and \miktex and available from \CTAN (\url{https://ctan.org/pkg/beamertheme-tcolorbox}). +The development version of this package is located at \url{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}. + +\section{Usage} + +The basic usage is fairly simple. One just needs to load the theme via +\begin{tcolorbox} +\begin{lstlisting} +\useinnertheme{tcolorbox} +\end{lstlisting} +\end{tcolorbox} +and after that, one can use the normal beamer \lstinline|block| environment as usual. + +Behind the scenes, this will replace the default mechanism of puzzling together the block from two separate \lstinline|beamercolorboxes|, with one tcolorbox. + +In this simple configuration, the look and feel of the new blocks will be taken from other themes loaded in the presentation. For example if the Madrid theme is loaded, the resulting tcolorbox will have the usual colours, rounded corners and a shadow: + +\begin{tcblisting}{ + listing and comment, + pdf comment, + freeze pdf, + compilable listing, + run pdflatex, +% righthand width=8cm +} +\documentclass{beamer} +\usetheme{Madrid} +\useinnertheme{tcolorbox} +\begin{document} +\begin{frame} +\begin{block}{Title} + Body +\end{block} +\begin{alertblock}{Title} + Body +\end{alertblock} +\begin{exampleblock}{Title} + Body +\end{exampleblock} +\end{frame} +\end{document} +\end{tcblisting} + +\section{Options} + +In addition to automatically adopting settings from the other themes, one can also influence the look and feel via the two options \lstinline|rounded| and \lstinline|shadow|, which 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} +\begin{lstlisting} +\useinnertheme[ + rounded + shadow=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: + +\begin{tcblisting}{ + listing and comment, + pdf comment, + freeze pdf, + compilable listing, + run pdflatex, +% righthand width=8cm +} +\documentclass{beamer} +\usetheme{Antibes} +\useinnertheme[ + shadow +]{tcolorbox} +\begin{document} +\begin{frame} +\begin{block}{Title} + Body +\end{block} +\begin{alertblock}{Title} + Body +\end{alertblock} +\begin{exampleblock}{Title} + Body +\end{exampleblock} +\end{frame} +\end{document} +\end{tcblisting} + +Beyond these two options, the users also has the myriads of options of the tcolobox package to their disposal, e.g.\ via \lstinline|\tcbset{...}|: + +\begin{tcblisting}{ + listing and comment, + pdf comment, + freeze pdf, + compilable listing, + run pdflatex, +% righthand width=8cm +} +\documentclass{beamer} +\usetheme{Ilmenau} +\useinnertheme{tcolorbox} + +\tcbset{ + boxrule=3pt, + borderline={1pt}{0pt}{pink,dashed}, +} + +\begin{document} +\begin{frame} +\begin{block}{Title} + Body +\end{block} +\begin{alertblock}{Title} + Body +\end{alertblock} +\begin{exampleblock}{Title} + Body +\end{exampleblock} +\end{frame} +\end{document} +\end{tcblisting} + +\section{Caveats and known issues} + +\begin{itemize} +\item the tcolorbox inner theme is not yet optimised for the \lstinline|inmargin| inner theme, which is e.g.\ used by the Bergen theme +\item for themes which don't set the \lstinline|block body| colour, e.g.\ the default theme, the block body will be shown in the same colour as the title and instead of the normal text colour. +\end{itemize} + + + + + +\end{document} \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty b/Master/texmf-dist/tex/latex/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty new file mode 100644 index 00000000000..32393e5965e --- /dev/null +++ b/Master/texmf-dist/tex/latex/beamertheme-tcolorbox/beamerinnerthemetcolorbox.sty @@ -0,0 +1,173 @@ +% !TeX root = test.tex +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% The tcolorbox inner theme +% A beamer inner theme which reproduces standard beamer blocks using tcolorboxes +% Maintained by samcarter +% +% Project repository and bug tracker: +% https://github.com/samcarter/beamertheme-tcolorbox +% +% Released under the LaTeX Project Public License v1.3c or later +% See http://www.latex-project.org/lppl.txt +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\ProvidesPackage{beamerinnerthemetcolorbox}[2022/08/26 version v0.1 Beamer blocks with tcolorboxes] + +\RequirePackage[skins]{tcolorbox} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Theme Options +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newif\ifbeamer@tcb@rounded +\newif\ifbeamer@tcb@shadow +\def\beamer@tcb@true{true} + +\DeclareOptionBeamer{shadow}[true]{\csname beamer@tcb@shadow#1\endcsname} +\DeclareOptionBeamer{rounded}[true]{\csname beamer@tcb@rounded#1\endcsname} + +\ExecuteOptionsBeamer{shadow=false} +\ExecuteOptionsBeamer{rounded=false} + +% check options from other themes +\ifdefined\beamer@themerounded@shadow + \beamer@tcb@roundedtrue + \ifx\beamer@themerounded@shadow\beamer@tcb@true + \beamer@tcb@shadowtrue + \fi +\fi + +\ProcessOptionsBeamer + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% General Settings +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\tcbset{ + oversize=0mm, + left=0.05cm, + right=0.05cm, + enhanced, + boxrule=0cm, + frame hidden, + top=1.5mm, + bottom=0.5mm +} + +% optional settings +\ifbeamer@tcb@rounded + \tcbset{ + arc=1.3mm, + top=0.8mm, + toptitle=0.2mm, + bottom=0mm, + } +\else + \tcbset{sharpish corners} +\fi + +\ifbeamer@tcb@shadow + \tcbset{drop fuzzy shadow=black!90} +\fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Defining blocks +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\mode + +% normal block +\setbeamertemplate{block begin}{% + \usebeamercolor[bg]{block body} + \usebeamercolor[bg]{block title} + \colorlet{beamer@tcb@topshade}{block title.bg} + \colorlet{beamer@tcb@bottomshade}{block body.bg} + \ifbeamer@tcb@rounded\else + \tcbset{title={\insertblocktitle}} + \fi + \ifx\insertblocktitle\@empty\else + \tcbset{title={\insertblocktitle}} + \ifbeamer@tcb@rounded + \tcbset{ + overlay={ + \begin{scope} + \shade[top color=beamer@tcb@topshade,bottom color=beamer@tcb@bottomshade] (title.south west) rectangle ([yshift=-0.5mm]title.south east); + \end{scope} + } + } + \fi + \fi + \begin{tcolorbox}[ + colbacktitle=block title.bg, + colback=block body.bg, + before title={\usebeamercolor[fg]{block title}\usebeamerfont{block title}}, + before upper={\usebeamercolor[fg]{block body}\usebeamerfont{block body}}, + ] +} +\setbeamertemplate{block end}{\end{tcolorbox}} + +% alert block +\setbeamertemplate{block alerted begin}{% + \usebeamercolor[bg]{block body alerted} + \usebeamercolor[bg]{block title alerted} + \colorlet{beamer@tcb@topshade}{block title alerted.bg} + \colorlet{beamer@tcb@bottomshade}{block body alerted.bg} + \ifbeamer@tcb@rounded\else + \tcbset{title={\insertblocktitle}} + \fi + \ifx\insertblocktitle\@empty\else + \tcbset{title={\insertblocktitle}} + \ifbeamer@tcb@rounded + \tcbset{ + overlay={ + \begin{scope} + \shade[top color=beamer@tcb@topshade,bottom color=beamer@tcb@bottomshade] (title.south west) rectangle ([yshift=-0.5mm]title.south east); + \end{scope} + } + } + \fi + \fi + \begin{tcolorbox}[ + colbacktitle=block title alerted.bg, + colback=block body alerted.bg, + before title={\usebeamercolor[fg]{block title alerted}\usebeamerfont{block title alerted}}, + before upper={\usebeamercolor[fg]{block body alerted}\usebeamerfont{block body alerted}}, + ] +} +\setbeamertemplate{block alerted end}{\end{tcolorbox}} + +% example block +\setbeamertemplate{block example begin}{% + \usebeamercolor[bg]{block body example} + \usebeamercolor[bg]{block title example} + \colorlet{beamer@tcb@topshade}{block title example.bg} + \colorlet{beamer@tcb@bottomshade}{block body example.bg} + \ifbeamer@tcb@rounded\else + \tcbset{title={\insertblocktitle}} + \fi + \ifx\insertblocktitle\@empty\else + \tcbset{title={\insertblocktitle}} + \ifbeamer@tcb@rounded + \tcbset{ + overlay={ + \begin{scope} + \shade[top color=beamer@tcb@topshade,bottom color=beamer@tcb@bottomshade] (title.south west) rectangle ([yshift=-0.5mm]title.south east); + \end{scope} + } + } + \fi + \fi + \begin{tcolorbox}[ + colbacktitle=block title example.bg, + colback=block body example.bg, + before title={\usebeamercolor[fg]{block title example}\usebeamerfont{block title example}}, + before upper={\usebeamercolor[fg]{block body example}\usebeamerfont{block body example}}, + ] +} +\setbeamertemplate{block example end}{\end{tcolorbox}} + +\mode diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index a5c797511f1..c28855a7db5 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -97,7 +97,7 @@ my @TLP_working = qw( beamertheme-light beamertheme-metropolis beamertheme-npbt beamertheme-phnompenh beamertheme-pure-minimalistic beamertheme-saintpetersburg beamertheme-simpledarkblue - beamertheme-trigon beamertheme-upenn-bc + beamertheme-tcolorbox beamertheme-trigon beamertheme-upenn-bc beamerthemeamurmaple beamerthemejltree beamerthemelalic beamerthemenirma beamerthemenord bearwear beaulivre diff --git a/Master/tlpkg/tlpsrc/beamertheme-tcolorbox.tlpsrc b/Master/tlpkg/tlpsrc/beamertheme-tcolorbox.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index e8f9f6e29e9..9591688897a 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -91,6 +91,7 @@ depend beamertheme-phnompenh depend beamertheme-pure-minimalistic depend beamertheme-saintpetersburg depend beamertheme-simpledarkblue +depend beamertheme-tcolorbox depend beamertheme-trigon depend beamertheme-upenn-bc depend beamerthemeamurmaple -- cgit v1.2.3