-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpgfplotsthemebeamer-doc.tex
115 lines (98 loc) · 3.56 KB
/
pgfplotsthemebeamer-doc.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Documentation for the pgfplotsthemebeamer package
% Using colours from the current beamer theme in pgfplots
% Maintained by samcarter
%
% Project repository and bug tracker:
% https://github.com/samcarter/pgfplotstheme-beamer
%
% Released under the LaTeX Project Public License v1.3c or later
% See https://www.latex-project.org/lppl.txt
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% !TeX program = txs:///arara
% arara: latexmk: {
% arara: --> engine: pdflatex,
% arara: --> options: [
% arara: --> '-shell-escape',
% arara: --> '-synctex=1',
% arara: --> '-interaction=nonstopmode',
% arara: --> ]
% arara: --> }
\documentclass{scrartcl}
\usepackage[
themecolor=samorange
]{\jobname-settings}
% meta %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title{The pgfplotsthemebeamer package}
\subtitle{Using colours from the current beamer theme in pgfplots}
\author{%
\texorpdfstring{
\texttt{samcarter}\\
\url{https://github.com/samcarter/pgfplotsthemebeamer}\\
\url{https://ctan.org/pkg/pgfplotsthemebeamer}
}{samcarter}}
\date{Version v0.2 \textendash{} 2024/08/02}
\packagename{pgfplotsthemebeamer}
% customisation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\prefix}{./include}
\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}},%
}
\begin{document}
\maketitle
\section{Introduction}
\label{intro}
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.
\blurb
\section{Usage}
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:
\begin{tcolorbox}[title={Usage}]
\begin{samcode}
\usepackage{pgfplotsthemebeamer}
\begin{axis}[
beamercolors
]
...
\end{axis}
\end{samcode}
\end{tcolorbox}
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.
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.
\begin{tcolorbox}[title={Usage}]
\begin{samcode}
\usepackage[all]{pgfplotsthemebeamer}
\end{samcode}
\end{tcolorbox}
\section{Full example}
\begin{tcblisting}{
listing only,
freeze pdf,
compilable listing,
run pdflatex,
title={Basic example},
righthand width=0pt
}
\documentclass{beamer}
\usetheme{moloch}% just as an example for a colour theme
\usepackage{pgfplotsthemebeamer}
\begin{document}
\begin{frame}[plain]
\centering
\begin{tikzpicture}
\begin{axis}[
beamercolors
]
\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};
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}
\end{tcblisting}
\vfill
\centering
\setlength{\fboxsep}{0pt}%
\fbox{\includegraphics[width=.75\textwidth]{pgfplotsthemebeamer-doc-listing-1.pdf}}%
\end{document}