| 1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 |
% |
| 3 |
% Documentation for the pgfplotsthemebeamer package |
| 4 |
% Using colours from the current beamer theme in pgfplots |
| 5 |
% Maintained by samcarter |
| 6 |
% |
| 7 |
% Project repository and bug tracker: |
| 8 |
% https://github.com/samcarter/pgfplotstheme-beamer |
| 9 |
% |
| 10 |
% Released under the LaTeX Project Public License v1.3c or later |
| 11 |
% See http://www.latex-project.org/lppl.txt |
| 12 |
% |
| 13 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 14 |
% !TeX program = txs:///arara |
| 15 |
% arara: latexmk: { |
| 16 |
% arara: --> engine: pdflatex, |
| 17 |
% arara: --> options: [ |
| 18 |
% arara: --> '-shell-escape', |
| 19 |
% arara: --> '-synctex=1', |
| 20 |
% arara: --> '-interaction=nonstopmode', |
| 21 |
% arara: --> ] |
| 22 |
% arara: --> } |
| 23 |
\documentclass{scrartcl} |
| 24 |
|
| 25 |
% meta %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 26 |
\title{The pgfplotsthemebeamer package} |
| 27 |
\subtitle{Using colours from the current beamer theme in pgfplots} |
| 28 |
\author{% |
| 29 |
\texorpdfstring{ |
| 30 |
\texttt{samcarter}\\ |
| 31 |
\url{https://github.com/samcarter/pgfplotsthemebeamer}\\ |
| 32 |
\url{https://ctan.org/pkg/pgfplotsthemebeamer} |
| 33 |
}{samcarter}} |
| 34 |
\date{Version v0.2 \textendash{} 2024/08/02} |
| 35 |
|
| 36 |
\usepackage[ |
| 37 |
themecolor=samorange |
| 38 |
]{\jobname-settings} |
| 39 |
|
| 40 |
% customisation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 41 |
\newcommand{\prefix}{./include} |
| 42 |
\tcbset{ |
| 43 |
compilable listing/.style={listing file={\prefix/\jobname-listing-\thetcblistingcount.tex}}, |
| 44 |
run pdflatex/.style={run@system@command={cd\space \prefix;\space pdflatex}{\jobname-listing-\thetcblistingcount.tex}},% |
| 45 |
} |
| 46 |
|
| 47 |
\begin{document} |
| 48 |
\maketitle |
| 49 |
|
| 50 |
\section{Introduction} |
| 51 |
\label{intro} |
| 52 |
|
| 53 |
Beamer themes often use carefully composed colour schemes. The \saminline|pgfplotsthemebeamer| package allows to reuse these colours in diagrams created with \saminline|pfgplots|. This ensures a consistent colour scheme throughout the presentation and avoids unsightly colour clashes. |
| 54 |
|
| 55 |
The package is included in \TeX{}Live |
| 56 |
%and MiK\TeX\ |
| 57 |
and available from \textsc{CTAN} (\url{https://www.ctan.org/pkg/pgfplotsthemebeamer}). |
| 58 |
The development version of this package is located at \url{https://github.com/samcarter/pgfplotsthemebeamer}. If you have any problems, ideas or other feedback, please make constructive use of the issue tracker. |
| 59 |
|
| 60 |
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}. |
| 61 |
|
| 62 |
\section{Usage} |
| 63 |
|
| 64 |
The basic usage is fairly simple. After loading the \saminline|pgfplotsthemebeamer| package, plots can use the \saminline|beamercolor| option to use the colours from the current beamer theme in the diagram: |
| 65 |
\begin{tcolorbox}[title={Usage}] |
| 66 |
\begin{samcode} |
| 67 |
\usepackage{pgfplotsthemebeamer} |
| 68 |
|
| 69 |
\begin{axis}[ |
| 70 |
beamercolors |
| 71 |
] |
| 72 |
... |
| 73 |
\end{axis} |
| 74 |
\end{samcode} |
| 75 |
\end{tcolorbox} |
| 76 |
The graphs will be coloured in the beamer colours \saminline|structure|, \saminline|alerted text| and \saminline|example text|. In most beamer themes, these three colours form an easily distinguishable set of colours. |
| 77 |
|
| 78 |
Users who would like to use the \saminline|beamercolors| scheme for all \saminline|pgfplots| diagrams in the presentation, can load the package with the \saminline|all| option, which will make this colour scheme the default. |
| 79 |
\begin{tcolorbox}[title={Usage}] |
| 80 |
\begin{samcode} |
| 81 |
\usepackage[all]{pgfplotsthemebeamer} |
| 82 |
\end{samcode} |
| 83 |
\end{tcolorbox} |
| 84 |
|
| 85 |
\section{Full example} |
| 86 |
\begin{tcblisting}{ |
| 87 |
listing only, |
| 88 |
freeze pdf, |
| 89 |
compilable listing, |
| 90 |
run pdflatex, |
| 91 |
title={Basic example}, |
| 92 |
righthand width=0pt |
| 93 |
} |
| 94 |
\documentclass{beamer} |
| 95 |
|
| 96 |
\usetheme{moloch}% just as an example for a colour theme |
| 97 |
\usepackage{pgfplotsthemebeamer} |
| 98 |
|
| 99 |
\begin{document} |
| 100 |
|
| 101 |
\begin{frame}[plain] |
| 102 |
\centering |
| 103 |
\begin{tikzpicture} |
| 104 |
\begin{axis}[ |
| 105 |
beamercolors |
| 106 |
] |
| 107 |
\addplot {x}; \addplot {x-1}; \addplot {x-2}; \addplot {x-3}; \addplot {x-4}; \addplot {x-5}; \addplot {x-6}; \addplot {x-7}; \addplot {x-8}; |
| 108 |
\end{axis} |
| 109 |
\end{tikzpicture} |
| 110 |
\end{frame} |
| 111 |
|
| 112 |
\end{document} |
| 113 |
\end{tcblisting} |
| 114 |
\vfill |
| 115 |
\centering |
| 116 |
\setlength{\fboxsep}{0pt}% |
| 117 |
\fbox{\includegraphics[width=.75\textwidth]{pgfplotsthemebeamer-doc-listing-1.pdf}}% |
| 118 |
|
| 119 |
\end{document} |