Debian Codegraph @

texmf-dist/doc/latex/pgfplotsthemebeamer/pgfplotsthemebeamer-doc-settings.sty

raw
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %
3 % Personal helper theme for package documentations
4 % Copyright samcarter
5 %
6 % This file may be distributed and/or modified
7 % under the LaTeX Project Public License 1.3c or later
8 %
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
11 % Usage:
12 % ln ~/Life/latex/beamertheme-sam/themesam.sty package-doc-settings.sty
13 % \usepackage[
14 % themecolor=samdblue
15 % ]{\jobname-settings}
16
17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18 %
19 % Colours
20 %
21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22 \RequirePackage{xcolor}
23 \definecolor{samyellow}{RGB}{246,193,65}
24 \definecolor{samorange}{RGB}{241,147,45}% pgfplotsthemebeamer
25 \definecolor{samred}{RGB}{191,26,46}% TikZbricks
26 \definecolor{sammagenta}{RGB}{170,42,104}% TikZmarmots
27 \definecolor{samviolet}{RGB}{136,46,114}% TikZlings
28 \definecolor{samlila}{RGB}{101,67,159}% Rainbow beamer theme
29 \definecolor{samdblue}{RGB}{0,51,134}% beamer theme
30 \definecolor{samlblue}{RGB}{22,89,155}% TikZducks
31 \definecolor{samteal}{RGB}{25,143,157}% Tcolorbox beamer theme
32 \definecolor{samlgreen}{RGB}{68,170,153}% Jigsaw
33 \definecolor{samdgreen}{RGB}{78,178,125}
34 \definecolor{samlgray}{RGB}{160,160,185}
35 \definecolor{samdgray}{RGB}{60,60,85}
36
37 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 %
39 % Package options
40 %
41 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42 \RequirePackage{xkeyval}
43 \DeclareOptionX{themecolor}[samdblue]{\colorlet{themecolor}{#1}}
44 \DeclareOptionX{listingcolor}[samlblue]{\colorlet{listingcolor}{#1}}
45 \ExecuteOptionsX{themecolor,listingcolor}
46 \ProcessOptionsX
47
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 %
50 % Packages
51 %
52 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 \@ifclassloaded{beamer}{}{%
54 \RequirePackage[english]{babel}
55 \RequirePackage[paper=a4paper,margin=2.9cm]{geometry}
56 \RequirePackage{scrlayer-scrpage}
57 \let\hrulefillx\hrulefill
58 \RequirePackage[bitstream-charter]{mathdesign}
59 \let\hrulefill\hrulefillx
60 \RequirePackage[hang,flushmargin,bottom]{footmisc}
61 \RequirePackage{footnotehyper}
62 \makesavenoteenv{tcolorbox}
63 \RequirePackage[all]{nowidow}
64 \RequirePackage[colorlinks=true,breaklinks=true,allcolors=themecolor,hyperfootnotes=false]{hyperref}
65 }
66 \RequirePackage[T1]{fontenc}
67 \RequirePackage{xspace}
68 \RequirePackage{inconsolata}% mono font with bold, but italic is missing
69 % \RequirePackage[scale=0.85]{cascadia-code}
70 % \AddToHook{cmd/ttfamily/before}{\fontseries{sl}}
71 \RequirePackage{iexec}
72 \usepackage{synthslant}% to fake slented comments in inconsolata
73
74 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75 %
76 % Listings
77 %
78 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79 \RequirePackage[
80 cachedir=$TMPDIR/minted/
81 ]{minted}
82
83 % smuggling custom pygmentize style in cache folder
84 % (a real pygmentise style would need installtion in some python folder)
85 \begin{filecontents*}[noheader,overwrite]{./sam.pygstyle}
86 \makeatletter
87 \def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax%
88 \let\PYG@ul=\relax \let\PYG@tc=\relax%
89 \let\PYG@bc=\relax \let\PYG@ff=\relax}
90 \def\PYG@tok#1{\csname PYG@tok@#1\endcsname}
91 \def\PYG@toks#1+{\ifx\relax#1\empty\else%
92 \PYG@tok{#1}\expandafter\PYG@toks\fi}
93 \def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{%
94 \PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}}
95 \def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}}
96
97 % optional arguments
98 \expandafter\def\csname PYG@tok@na\endcsname{\def\PYG@tc##1{\textcolor{black}{##1}}}
99
100 % macros
101 \expandafter\def\csname PYG@tok@k\endcsname{\def\PYG@tc##1{\textcolor{listingcolor}{\bfseries ##1}}}
102 % curly brakets
103 \expandafter\def\csname PYG@tok@nb\endcsname{\def\PYG@tc##1{\textcolor{listingcolor}{\bfseries ##1}}}
104
105 % comments (italics won't work with the inconsolata font)
106 \expandafter\def\csname PYG@tok@c\endcsname{\def\PYG@tc##1{\textcolor{gray}{\textsynthslant{##1}}}}
107
108 \def\PYGZbs{\char`\\}
109 \def\PYGZus{\char`\_}
110 \def\PYGZob{\char`\{}
111 \def\PYGZcb{\char`\}}
112 \def\PYGZca{\char`\^}
113 \def\PYGZam{\char`\&}
114 \def\PYGZlt{\char`\<}
115 \def\PYGZgt{\char`\>}
116 \def\PYGZsh{\char`\#}
117 \def\PYGZpc{\char`\%}
118 \def\PYGZdl{\char`\$}
119 \def\PYGZhy{\char`\-}
120 \def\PYGZsq{\char`\'}
121 \def\PYGZdq{\char`\"}
122 \def\PYGZti{\char`\~}
123 % for compatibility with earlier versions
124 \def\PYGZat{@}
125 \def\PYGZlb{[}
126 \def\PYGZrb{]}
127 \makeatother
128 \end{filecontents*}
129
130 \iexec{mkdir -p $TMPDIR/minted && mv sam.pygstyle $TMPDIR/minted/.}
131
132 \usemintedstyle{sam}
133 \setminted{
134 breaksymbolleft={},
135 tabsize=2,
136 breaklines=true,
137 }
138 \newminted[samcode]{latex}{}
139 \newmintinline[saminline]{latex}{}
140
141 % use non-bold and all coloured for inline code in articles
142 \ifdefined\insertaspectratio\else
143 \patchcmd{\minted@inputpyg@inline}{\minted@input}{\color{listingcolor}\renewcommand\textcolor[3][]{##3}\renewcommand\bfseries{}\minted@input}{}{}
144 \fi
145
146 \RequirePackage[most]{tcolorbox}
147 \tcbuselibrary{minted}
148 \tcbset{%
149 colframe=themecolor,
150 fonttitle=\bfseries,
151 sidebyside,
152 center lower,
153 righthand width=5.7cm,
154 bottom=2pt,
155 top=2pt,
156 left=3pt,
157 right=3pt,
158 sidebyside gap=10pt,
159 lower separated=false,
160 listing engine=minted,
161 minted language=latex,
162 colback=themecolor!10,
163 sharp corners,
164 boxrule=0pt,
165 before title={\strut}
166 }
167
168 % avoid page breaks right in front of the tcolorbox
169 \@ifclassloaded{beamer}{}{
170 \tcbuselibrary{hooks}
171 \tcbset{before pre={\nopagebreak[4]}}
172 }
173
174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
175 %
176 % document settings
177 %
178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179 \@ifclassloaded{scrartcl}{%
180 \KOMAoptions{parskip=half}
181 \addtokomafont{sectioning}{\color{themecolor}}
182 \addtokomafont{date}{\normalsize}
183 \addtokomafont{author}{\normalsize}
184 \setlength{\footnotemargin}{0.7em}
185 }{}
186
187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
188 %
189 % Custom macros
190 %
191 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
192 \providecommand*{\CTAN}{\textsc{CTAN}\xspace}
193 \providecommand*{\TikZ}{Ti\emph{k}Z\xspace}
194 \providecommand*{\miktex}{MiK\TeX\xspace}
195 \providecommand*{\texlive}{\TeX{}Live\xspace}
196 \providecommand*{\tikzbrick}{Ti\emph{k}Zbrick\xspace}
197 \providecommand*{\tikzducks}{Ti\emph{k}Zducks\xspace}
198 \providecommand*{\tikzlings}{Ti\emph{k}Zlings\xspace}
199 \providecommand*{\tikzmarmots}{Ti\emph{k}Zmarmots\xspace}
200 \providecommand*{\ConTeXt}{C\kern-.0333emon\-\kern-.0667em\TeX\kern-.0333emt}