Debian Codegraph @

texmf-dist/doc/latex/cistercian/cistercian-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}
25 \definecolor{samred}{RGB}{191,26,46}
26 \definecolor{sammagenta}{RGB}{170,42,104}
27 \definecolor{samviolet}{RGB}{136,46,114}
28 \definecolor{samlila}{RGB}{101,67,159}
29 \definecolor{samdblue}{RGB}{38,38,139}
30 \definecolor{samlblue}{RGB}{22,89,155}
31 \definecolor{samteal}{RGB}{25,143,157}
32 \definecolor{samlgreen}{RGB}{68,170,153}
33 \definecolor{samdgreen}{RGB}{78,178,125}
34 \definecolor{samlgray}{RGB}{160,160,185}
35 \definecolor{samdgray}{RGB}{60,60,85}
36
37 \newcommand{\samcolours}{
38 \foreach \sam@col/\sam@pkg in {
39 samyellow/???,
40 samorange/Pgfplots,
41 samred/TikZbricks,
42 sammagenta/TikZmarmots,
43 samviolet/TikZlings,
44 samlila/Rainbow,
45 samdblue/Spectrum,
46 samlblue/TikZducks,
47 samteal/Tcolorbox,
48 samlgreen/Jigsaw,
49 samdgreen/???,
50 samlgray/Cistercian,
51 samdgray/Panda%
52 }{
53 \begingroup
54 \color{\sam@col}%
55 \makebox[0cm][l]{\rule[-0.9cm]{2.5cm}{2cm}}%
56 \endgroup
57 \parbox[c][2cm]{2.5cm}{\bfseries\color{white}\centering \sam@col\\\sam@pkg}%
58 }
59 }
60
61 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 %
63 % Package options
64 %
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66 \RequirePackage{xkeyval}
67 \DeclareOptionX{themecolor}[samdblue]{\colorlet{themecolor}{#1}}
68 \DeclareOptionX{listingcolor}[samlblue]{\colorlet{listingcolor}{#1}}
69 \ExecuteOptionsX{themecolor,listingcolor}
70 \ProcessOptionsX
71
72 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
73 %
74 % Packages
75 %
76 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 \@ifclassloaded{scrartcl}{%
78 \RequirePackage[english]{babel}
79 \RequirePackage[paper=a4paper,margin=2.9cm]{geometry}
80 \RequirePackage{scrlayer-scrpage}
81 \let\hrulefillx\hrulefill
82 \RequirePackage[bitstream-charter]{mathdesign}
83 \let\hrulefill\hrulefillx
84 \RequirePackage[hang,flushmargin,bottom]{footmisc}
85 \RequirePackage{footnotehyper}
86 \makesavenoteenv{tcolorbox}
87 \RequirePackage[all]{nowidow}
88 \RequirePackage[hyphens]{url}
89 \RequirePackage[colorlinks=true,breaklinks=true,allcolors=themecolor,hyperfootnotes=false]{hyperref}
90 }{}
91 \RequirePackage[T1]{fontenc}
92 \RequirePackage{xspace}
93 \RequirePackage{inconsolata}% mono font with bold, but italic is missing
94 \@ifclassloaded{scrartcl}{%
95 \RequirePackage[scale=0.85]{cascadia-code}
96 % \AddToHook{cmd/ttfamily/before}{\fontseries{sl}}
97 }{}
98 \RequirePackage{synthslant}% to fake slanted comments in inconsolata
99 \RequirePackage{metalogox}% should be loaded after the fonts
100 \@ifclassloaded{scrartcl}{}{%
101 \RequirePackage{lmodern}
102 \renewcommand{\ttdefault}{lmtt}
103 \graphicspath{{./include}}
104 }
105
106 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
107 %
108 % Listings
109 %
110 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
111 \RequirePackage[cachedir=./.minted]{minted}
112
113 \AddToHook{env/MintedVerbatim/before}{%
114 % optional arguments
115 \@namedef{PYG@tok@na}{\def\PYG@tc##1{\textcolor{black}{##1}}}%
116 % macros
117 \@namedef{PYG@tok@k}{\def\PYG@tc##1{\textcolor{listingcolor}{\bfseries ##1}}}%
118 % curly brackets
119 \@namedef{PYG@tok@nb}{\def\PYG@tc##1{\textcolor{listingcolor}{\bfseries ##1}}}%
120 % comments (italics won't work with the inconsolata font)
121 \@namedef{PYG@tok@c}{\def\PYG@tc##1{\textcolor{gray}{\textsynthslant{##1}}}}%
122 }
123
124 \usemintedstyle{default}
125 \setminted{
126 breaksymbolleft={},
127 tabsize=2,
128 breaklines=true,
129 }
130 \newminted[samcode]{latex}{}
131 \newmintinline[saminline]{latex}{}
132
133 % use non-bold and all coloured for inline code in articles
134 \@ifclassloaded{scrartcl}{%
135 \patchcmd{\minted@inputpyg@inline}{\minted@input}{\color{listingcolor}\renewcommand\textcolor[3][]{##3}\renewcommand\bfseries{}\minted@input}{}{}
136 }{}
137
138 \RequirePackage[most]{tcolorbox}
139 \tcbuselibrary{minted}
140 \newcommand{\prefix}{./include}
141 \tcbset{%
142 colframe=themecolor,
143 fonttitle=\bfseries,
144 sidebyside,
145 center lower,
146 righthand width=5.7cm,
147 bottom=2pt,
148 top=2pt,
149 left=3pt,
150 right=3pt,
151 sidebyside gap=10pt,
152 lower separated=false,
153 listing engine=minted,
154 minted language=latex,
155 colback=themecolor!10,
156 sharp corners,
157 boxrule=0pt,
158 before title={\strut},
159 compilable listing/.style={listing file={\prefix/\jobname-listing-\thetcblistingcount.tex}},
160 compilable listing sam/.style={
161 listing and comment,
162 pdf comment,
163 freeze pdf,
164 compilable listing,
165 run latexmk={-g- -pdf -cd -pdflatex=pdflatex-dev},
166 comment style={raster columns=1},
167 },
168 }
169
170 % avoid page breaks right in front of the tcolorbox
171 \@ifclassloaded{beamer}{}{
172 \tcbuselibrary{hooks}
173 \tcbset{before pre={\nopagebreak[4]}}
174 }
175
176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
177 %
178 % document settings
179 %
180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
181 \@ifclassloaded{scrartcl}{%
182 \KOMAoptions{parskip=half-}
183 \addtokomafont{sectioning}{\color{themecolor}}
184 \addtokomafont{date}{\normalsize}
185 \addtokomafont{author}{\normalsize}
186 \setlength{\footnotemargin}{0.7em}
187 }{}
188
189 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
190 %
191 % Custom macros
192 %
193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
194 \providecommand*{\CTAN}{\textsc{CTAN}\xspace}
195 \providecommand*{\TikZ}{Ti\emph{k}Z\xspace}
196 \providecommand*{\miktex}{MiK\TeX\xspace}
197 \providecommand*{\texlive}{\TeX{}Live\xspace}
198 \providecommand*{\tikzbrick}{Ti\emph{k}Zbrick\xspace}
199 \providecommand*{\tikzducks}{Ti\emph{k}Zducks\xspace}
200 \providecommand*{\tikzlings}{Ti\emph{k}Zlings\xspace}
201 \providecommand*{\tikzmarmots}{Ti\emph{k}Zmarmots\xspace}
202 \providecommand*{\ConTeXt}{C\kern-.0333emon\-\kern-.0667em\TeX\kern-.0333emt}
203
204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
205 %
206 % Doc blurb
207 %
208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
209 \newcommand{\packagename}[1]{\def\@packagename{#1}}
210
211 \NewDocumentCommand\blurb{s}{%
212 This package is work in progress, therefore I would be happy to hear your feedback and ideas how to improve the package. The development version of the source code can be found at \url{https://github.com/samcarter/\@packagename}, including an issue tracker.
213 \IfBooleanF#1{%
214 A more stable version of the package can be found on \CTAN (\url{https://ctan.org/pkg/\@packagename}) and is included in both \texlive and \miktex as \texttt{\@packagename}.
215 }%
216 If you seek any other assistance (not bug reports/feature requests), I suggest asking at \url{https://topanswers.xyz/tex}.
217
218 Copyright {\footnotesize\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}.
219 }