texlive[72864] Master/texmf-dist: beamertheme-rainbow (15nov24)
commits+karl at tug.org
commits+karl at tug.org
Fri Nov 15 23:12:09 CET 2024
Revision: 72864
https://tug.org/svn/texlive?view=revision&revision=72864
Author: karl
Date: 2024-11-15 23:12:09 +0100 (Fri, 15 Nov 2024)
Log Message:
-----------
beamertheme-rainbow (15nov24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/README.md
trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/beamertheme-rainbow-doc-settings.sty
trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/beamertheme-rainbow-doc.pdf
trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/beamertheme-rainbow-doc.tex
trunk/Master/texmf-dist/tex/latex/beamertheme-rainbow/beamercolorthemerainbow.sty
Modified: trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/README.md 2024-11-15 22:11:57 UTC (rev 72863)
+++ trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/README.md 2024-11-15 22:12:09 UTC (rev 72864)
@@ -1,12 +1,12 @@
# beamertheme-rainbow
-[](http://www.latex-project.org/lppl.txt)
-[](https://github.com/samcarter/beamertheme-rainbow/releases/latest)
-[](https://ctan.org/pkg/beamertheme-rainbow)
+[](https://www.latex-project.org/lppl.txt)
+[](https://github.com/samcarter/beamertheme-rainbow/releases/latest)
+[](https://ctan.org/pkg/beamertheme-rainbow)
A beamer colour theme which alternates theme colours on every frame.
-This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt .
+This project is licensed under the LaTeX Project Public License v1.3c or later, see https://www.latex-project.org/lppl.txt .
The project repository, including a bug tracker, can be found at https://github.com/samcarter/beamertheme-rainbow/issues .
Modified: trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/beamertheme-rainbow-doc-settings.sty
===================================================================
--- trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/beamertheme-rainbow-doc-settings.sty 2024-11-15 22:11:57 UTC (rev 72863)
+++ trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/beamertheme-rainbow-doc-settings.sty 2024-11-15 22:12:09 UTC (rev 72864)
@@ -21,7 +21,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{xcolor}
\definecolor{samyellow}{RGB}{246,193,65}
-\definecolor{samorange}{RGB}{241,147,45}
+\definecolor{samorange}{RGB}{241,147,45}% pgfplotsthemebeamer
\definecolor{samred}{RGB}{191,26,46}% TikZbricks
\definecolor{sammagenta}{RGB}{170,42,104}% TikZmarmots
\definecolor{samviolet}{RGB}{136,46,114}% TikZlings
@@ -68,7 +68,7 @@
\RequirePackage{inconsolata}% mono font with bold, but italic is missing
% \RequirePackage[scale=0.85]{cascadia-code}
% \AddToHook{cmd/ttfamily/before}{\fontseries{sl}}
-\RequirePackage{iexec}
+\usepackage{synthslant}% to fake slented comments in inconsolata
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -75,60 +75,20 @@
% Listings
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\RequirePackage[
- cachedir=$TMPDIR/minted/
-]{minted}
+\RequirePackage[cachedir=./.minted]{minted}
-% smuggling custom pygmentize style in cache folder
-% (a real pygmentise style would need installtion in some python folder)
-\begin{filecontents*}[noheader]{./sam.pygstyle}
-\makeatletter
-\def\PYG at reset{\let\PYG at it=\relax \let\PYG at bf=\relax%
- \let\PYG at ul=\relax \let\PYG at tc=\relax%
- \let\PYG at bc=\relax \let\PYG at ff=\relax}
-\def\PYG at tok#1{\csname PYG at tok@#1\endcsname}
-\def\PYG at toks#1+{\ifx\relax#1\empty\else%
- \PYG at tok{#1}\expandafter\PYG at toks\fi}
-\def\PYG at do#1{\PYG at bc{\PYG at tc{\PYG at ul{%
- \PYG at it{\PYG at bf{\PYG at ff{#1}}}}}}}
-\def\PYG#1#2{\PYG at reset\PYG at toks#1+\relax+\PYG at do{#2}}
+\AddToHook{env/MintedVerbatim/before}{%
+ % optional arguments
+ \@namedef{PYG at tok@na}{\def\PYG at tc##1{\textcolor{black}{##1}}}%
+ % macros
+ \@namedef{PYG at tok@k}{\def\PYG at tc##1{\textcolor{listingcolor}{\bfseries ##1}}}%
+ % curly brakets
+ \@namedef{PYG at tok@nb}{\def\PYG at tc##1{\textcolor{listingcolor}{\bfseries ##1}}}%
+ % comments (italics won't work with the inconsolata font)
+ \@namedef{PYG at tok@c}{\def\PYG at tc##1{\textcolor{gray}{\textsynthslant{##1}}}}%
+}
-% optional arguments
-\expandafter\def\csname PYG at tok@na\endcsname{\def\PYG at tc##1{\textcolor{black}{##1}}}
-
-% macros
-\expandafter\def\csname PYG at tok@k\endcsname{\def\PYG at tc##1{\textcolor{listingcolor}{\bfseries ##1}}}
-% curly brakets
-\expandafter\def\csname PYG at tok@nb\endcsname{\def\PYG at tc##1{\textcolor{listingcolor}{\bfseries ##1}}}
-
-% comments (italics won't work with the inconsolata font)
-\expandafter\def\csname PYG at tok@c\endcsname{\def\PYG at tc##1{\textcolor{gray}{##1}}}
-
-\def\PYGZbs{\char`\\}
-\def\PYGZus{\char`\_}
-\def\PYGZob{\char`\{}
-\def\PYGZcb{\char`\}}
-\def\PYGZca{\char`\^}
-\def\PYGZam{\char`\&}
-\def\PYGZlt{\char`\<}
-\def\PYGZgt{\char`\>}
-\def\PYGZsh{\char`\#}
-\def\PYGZpc{\char`\%}
-\def\PYGZdl{\char`\$}
-\def\PYGZhy{\char`\-}
-\def\PYGZsq{\char`\'}
-\def\PYGZdq{\char`\"}
-\def\PYGZti{\char`\~}
-% for compatibility with earlier versions
-\def\PYGZat{@}
-\def\PYGZlb{[}
-\def\PYGZrb{]}
-\makeatother
-\end{filecontents*}
-
-\iexec{mkdir -p $TMPDIR/minted && mv sam.pygstyle $TMPDIR/minted/.}
-
-\usemintedstyle{sam}
+\usemintedstyle{default}
\setminted{
breaksymbolleft={},
tabsize=2,
Modified: trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/beamertheme-rainbow-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/beamertheme-rainbow-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/beamertheme-rainbow-doc.tex 2024-11-15 22:11:57 UTC (rev 72863)
+++ trunk/Master/texmf-dist/doc/latex/beamertheme-rainbow/beamertheme-rainbow-doc.tex 2024-11-15 22:12:09 UTC (rev 72864)
@@ -8,7 +8,7 @@
% https://github.com/samcarter/beamertheme-rainbow
%
% Released under the LaTeX Project Public License v1.3c or later
-% See http://www.latex-project.org/lppl.txt
+% See https://www.latex-project.org/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% !TeX program = txs:///arara
@@ -31,14 +31,12 @@
\url{https://github.com/samcarter/beamertheme-rainbow}\\
\url{https://www.ctan.org/pkg/beamertheme-rainbow}
}{samcarter}}
-\date{Version v0.2 \textendash{} 2024/04/28}
+\date{Version v1.0 \textendash{} 2024/11/14}
\usepackage[
themecolor=samlila
]{\jobname-settings}
-\colorlet{orange}{samorange}
-
% rainbow text (based on the gradient-text package) %%%%%%%%%%%%%%%%%
\makeatletter
\ExplSyntaxOn
@@ -94,14 +92,14 @@
\section{Introduction}
\label{intro}
-The rainbow beamer colour theme will bring more colours to your presentation. It works similarly to the structure beamer colour theme, but instead of having just one theme colour throughout the whole presentation, the rainbow beamer colour theme will cycle through a list of colors and change the theme colour on every frame.
+The rainbow beamer colour theme will bring more colours to your presentation. It works similarly to the structure beamer colour theme, but instead of having just one theme colour throughout the whole presentation, the rainbow beamer colour theme will cycle through a list of colours and change the theme colour on every frame or (sub)section.
By default, it will cycle through colours of the rainbow (hence the name), but a custom set of colours is also possible.
-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 \texlive and \miktex and available from \CTAN (\url{https://www.ctan.org/pkg/beamertheme-tcolorbox}).
The development version of this package is located at \url{https://github.com/samcarter/beamertheme-rainbow}. 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}.
+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{https://www.latex-project.org/lppl.txt}.
\section{Usage}
@@ -131,19 +129,22 @@
},
title={Basic example}
}
-\documentclass{beamer}
-
-\usetheme{Berkeley}
-\usecolortheme{rainbow}
-
-\begin{document}
-
-% just for this test example
-\ExplSyntaxOn
-\prg_replicate:nn{6}{\frame{}}
-\ExplSyntaxOff
-
-\end{document}
+ \documentclass{beamer}
+
+ \usetheme{Berkeley}
+ \usecolortheme{rainbow}
+
+ \begin{document}
+
+ % just for this test example
+ \ExplSyntaxOn
+ \prg_replicate:nn{6}{
+ \begin{frame}
+ \end{frame}
+ }
+ \ExplSyntaxOff
+
+ \end{document}
\end{tcblisting}
As pretty as rainbow colours are, there might be some users who would like to choose their own colours. This can be done with the \saminline|colors={...}| option which accepts a comma separated list of colours. The colours can be predefined colours e.g. from the \saminline|xcolor| package, user-defined colours or (for more fun) from the \saminline|xkcdcolors| package.
@@ -163,30 +164,114 @@
},
title={\strut Custom colours}
}
-\documentclass{beamer}
-
-\usetheme{Copenhagen}
-\usepackage{xkcdcolors}
-\definecolor{mycolor}
- {RGB}{101,67,159}
-\usecolortheme[
- colors={
- orange,
- mycolor,
- xkcdMediumBlue
+ \documentclass{beamer}
+
+ \usetheme{Copenhagen}
+ \usepackage{xkcdcolors}
+ \definecolor{mycolor}{RGB}{101,67,159}
+
+ \usecolortheme[
+ colors={
+ orange,
+ mycolor,
+ xkcdMediumBlue
+ }
+ ]{rainbow}
+
+ \begin{document}
+
+ % just for this test example
+ \ExplSyntaxOn
+ \prg_replicate:nn{6}{
+ \begin{frame}
+ \frametitle{Title}
+ \end{frame}
}
-]{rainbow}
+ \ExplSyntaxOff
+
+ \end{document}
+\end{tcblisting}
-\begin{document}
+Changing the colour on every frame might be too frequent. For these use cases, the theme offers the option \saminline|auto=...|, which allows the user to control when automatic colour changes should happen. Possible values are \saminline|frame| (default), \saminline|section| and \saminline|subsection|. All other values will disable automatic colour changes.
-% just for this test example
-\ExplSyntaxOn
-\prg_replicate:nn{6}{
- \frame{\frametitle{title}}
+\begin{tcblisting}{
+ listing and comment,
+ pdf comment,
+ freeze pdf,
+ compilable listing,
+ run pdflatex,
+ comment={
+ \begin{tikzpicture}
+ \foreach \i in {1,...,3}{%
+ \node at (0.35*\i,-0.7*\i) {\includegraphics[page=\i,width=3.7cm]{beamertheme-rainbow-doc-listing-3.pdf}};
+ }
+ \end{tikzpicture}
+ },
+ title={\strut Automatic colour changing}
}
-\ExplSyntaxOff
+ \documentclass{beamer}
+
+ \usetheme{Bergen}
+ \usecolortheme[
+ colors={blue,red},
+ auto=section
+ ]{rainbow}
+
+ \begin{document}
+
+ \begin{frame}
+ \end{frame}
+
+ \section{Section}
+ \begin{frame}
+ \end{frame}
+ \begin{frame}
+ \end{frame}
+
+ \end{document}
+\end{tcblisting}
-\end{document}
+It is also possible to manually change to the next colour using the macro \saminline|\rainbow|:
+
+\begin{tcblisting}{
+ listing and comment,
+ pdf comment,
+ freeze pdf,
+ compilable listing,
+ run pdflatex,
+ comment={
+ \begin{tikzpicture}
+ \foreach \i in {1,...,3}{%
+ \node at (0.35*\i,-0.7*\i) {\includegraphics[page=\i,width=3.7cm]{beamertheme-rainbow-doc-listing-4.pdf}};
+ }
+ \end{tikzpicture}
+ },
+ title={\strut Manual colour changing}
+}
+ \documentclass{beamer}
+
+ \usetheme{Rochester}
+ \usecolortheme[
+ colors={orange,teal},
+ auto=none
+ ]{rainbow}
+
+ \begin{document}
+
+ \begin{frame}
+ \frametitle{Title}
+ \end{frame}
+ \begin{frame}
+ \frametitle{Title}
+ \end{frame}
+
+ \rainbow
+
+ \begin{frame}
+ \frametitle{Title}
+ \end{frame}
+
+ \end{document}
\end{tcblisting}
\end{document}
Modified: trunk/Master/texmf-dist/tex/latex/beamertheme-rainbow/beamercolorthemerainbow.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/beamertheme-rainbow/beamercolorthemerainbow.sty 2024-11-15 22:11:57 UTC (rev 72863)
+++ trunk/Master/texmf-dist/tex/latex/beamertheme-rainbow/beamercolorthemerainbow.sty 2024-11-15 22:12:09 UTC (rev 72864)
@@ -1,4 +1,4 @@
-% !TeX root = test.tex
+% !TeX root = ./testing/test.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% The rainbow colour theme
@@ -9,10 +9,10 @@
% https://github.com/samcarter/beamertheme-rainbow
%
% Released under the LaTeX Project Public License v1.3c or later
-% See http://www.latex-project.org/lppl.txt
+% See https://www.latex-project.org/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\ProvidesPackage{beamercolorthemerainbow}[2024/04/28 version v0.2 Beamer colour theme with alternating theme colours]
+\ProvidesPackage{beamercolorthemerainbow}[2024/11/14 version v1.0 Beamer colour theme with alternating theme colours]
\mode<presentation>
@@ -36,7 +36,8 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareOptionBeamer{colors}{\def\rainbow at colors{#1}}
-\ExecuteOptionsBeamer{colors={rainbow at 0,rainbow at 1,rainbow at 2,rainbow at 3,rainbow at 4,rainbow at 5}}
+\DeclareOptionBeamer{auto}{\def\rainbow at auto{#1}}
+\ExecuteOptionsBeamer{colors={rainbow at 0,rainbow at 1,rainbow at 2,rainbow at 3,rainbow at 4,rainbow at 5},auto=frame}
\ProcessOptionsBeamer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -50,19 +51,55 @@
\clist_new:N \l_rainbow_clist
\clist_set:Nx \l_rainbow_clist \rainbow at colors
-% setting colour based on frame number
-\pretocmd{\beamer@@@frame}{
+\newcounter{rainbow at count}
+
+% macro to switch to next colour
+\newcommand{\rainbow}{
+ \addtocounter{rainbow at count}{1}
\colorlet{beamer at structure@color}{
\clist_item:Nn \l_rainbow_clist {
\int_eval:n {
- \int_mod:nn { \insertframenumber }{
+ \int_mod:nn { \value{rainbow at count} }{
\clist_count:N \l_rainbow_clist
} + 1
}
}
}
-}{}{}
+}
+% switch colour at start of frame
+\str_if_eq:eeT { \rainbow at auto } { frame } {
+ \pretocmd{\beamer@@@frame}{
+ \ifnum\thepage>1
+ \rainbow
+ \fi
+ }{}{}
+}
+
+% switch colour at start of section
+\str_if_eq:eeT { \rainbow at auto } { section } {
+ \AddToHook{cmd/section/before}{%
+ \ifnum\thepage>1
+ \rainbow
+ \fi
+ }
+}
+
+% switch colour at start of subsection
+\str_if_eq:eeT { \rainbow at auto } { subsection } {
+ \AddToHook{cmd/subsection/before}{%
+ \ifnum\thepage>1
+ \rainbow
+ \fi
+ }
+}
+
+% initially use first colour from the list
+\AtBeginDocument{
+ \setcounter{rainbow at count}{-1}
+ \rainbow
+}
+
\ExplSyntaxOff
\mode
More information about the tex-live-commits
mailing list.