Debian Codegraph @

texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.s_main.sty

raw
1 % !TeX root = tcolorbox.tex
2 % include file (style) of tcolorbox.tex (manual of the LaTeX package tcolorbox)
3 \renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.7em}}
4 \renewcommand*\l@subsubsection{\@dottedtocline{3}{4.2em}{3.2em}}
5
6 % prevent hypdoc from loading (sets hyperindex=false)
7 \@namedef{[email protected]}{9999/12/31}
8 \@namedef{[email protected]}{hypdoc}
9
10 \RequirePackage[T1]{fontenc}
11 \RequirePackage[english]{babel}
12 \RequirePackage{lmodern,parskip,array,ifthen,calc}
13 \RequirePackage{amsmath,amssymb}
14 \RequirePackage[svgnames,table]{xcolor}
15
16 \RequirePackage{tikz}
17 \usetikzlibrary{shadings,shadows}
18 \usetikzlibrary{decorations.pathmorphing}
19 \usetikzlibrary{patterns}
20 \usetikzlibrary{spy}
21 \usetikzlibrary{arrows.meta}
22
23 \RequirePackage{bookmark,varwidth,incgraph}
24 \RequirePackage{array,tabularx,tabularray}
25 \RequirePackage{amsmath}
26 \RequirePackage{lipsum}
27 \RequirePackage{empheq}
28 \RequirePackage[extendedchars,encoding,filenameencoding=utf-8]{grffile}
29
30 \providecommand{\tcbpkgprefix}{}
31 \RequirePackage{\tcbpkgprefix tcolorbox}
32
33 \usepackage{minted2}% minted is currently broken
34 \tcbuselibrary{most,documentation}
35
36 \tcbifexternal{}{%
37 \tcbuselibrary{minted}%
38 \tcbset{listing engine=listings,initialize@reset={listing engine=listings}}%
39 }
40
41 \RequirePackage{accsupp}
42 \RequirePackage{hyperref}
43
44 \RequirePackage[a4paper,left=2.5cm,right=2.5cm,top=1.5cm,bottom=1.5cm,
45 marginparsep=3mm,marginparwidth=18mm,
46 headheight=0mm,headsep=0cm,
47 footskip=1.5cm,includeheadfoot%,showframe
48 ]{geometry}
49 \RequirePackage{fancyhdr}
50 \fancyhf{}
51 \fancyfoot[C]{\thepage}%
52 \renewcommand{\headrulewidth}{0pt}
53 \renewcommand{\footrulewidth}{0pt}
54 \pagestyle{fancy}
55 \tolerance=2000%
56 \setlength{\emergencystretch}{20pt}%
57
58 \RequirePackage{zref-clever}
59 \RequirePackage{zref-vario}
60 \RequirePackage{zref-titleref}
61 \zcsetup{cap}
62
63 \tcbset{skin=enhanced,
64 doc head={colback=yellow!10!white,interior style=fill},
65 doc head key={colback=magenta!5!white,interior style=fill},
66 doc head path={colback=blue!50!gray!7!white,interior style=fill},
67 color key=DarkViolet,
68 color value=Teal,
69 color color=Teal,
70 color counter=Orange!85!black,
71 color length=Orange!85!black,
72 index colorize,
73 index annotate,
74 ctan formatter=\texttt,
75 }
76 \urlstyle{sf}
77
78 \tcbmakedocSubKey{docTcbKey}{tcb}
79 \tcbmakedocSubKeys{docTcbKeys}{tcb}
80 \tcbmakedocSubKey{langTcbKey}{tcb/doclang}
81 \tcbmakedocSubKey{newTcbKey}{tcb/new}
82 \tcbmakedocSubKey{boxTcbKey}{tcb/boxtitle}
83 \tcbmakedocSubKey{extTcbKey}{tcb/external}
84 \tcbmakedocSubKey{vigTcbKey}{tcb/vig}
85 \tcbmakedocSubKey{posterTcbKey}{tcb/poster}
86 \tcbmakedocSubKey{posterlocTcbKey}{tcb/posterloc}
87 \tcbmakedocSubKey{postersetTcbKey}{tcb/posterset}
88 \tcbmakedocSubKey{docTikzKey}{tikz}
89
90 \def\tikzname{Ti\emph{k}Z}
91
92
93 \newrobustcmd{\tcbIndexPrintSkinCA}[1]{\tcb@Index@Print@CA{#1}{\kvtcb@col@key}{Skin}}
94 \newrobustcmd{\tcbIndexPrintSkinC}[1]{\tcb@Index@Print@C{#1}{\kvtcb@col@key}}
95 \def\refSkin{\tcb@ref@doc{skin}}
96
97 \newrobustcmd{\tcbIndexPrintFadCA}[1]{\tcb@Index@Print@CA{#1}{\kvtcb@col@value}{fading}}
98 \newrobustcmd{\tcbIndexPrintFadC}[1]{\tcb@Index@Print@C{#1}{\kvtcb@col@value}}
99
100
101 \ExplSyntaxOn
102
103 \NewDocumentEnvironment{docSkin}{ O{} m }
104 {
105 \__tcobox_doc_entry_begin:nnn
106 {
107 doc~keypath=tcb,
108 doc~name={skin},
109 doc~label={skin=#2},
110 doc~parameter={=\docValue*[nophantom]{#2}},
111 doc~description={skin},
112 #1,
113 doc~no~index,
114 doc~head~key =
115 {
116 colback=magenta!5!white,interior~style=fill,
117 phantom=
118 {
119 \protected@edef\@currentlabel{#2}
120 \label{skin:#2}
121 \index{#2\idx@actual\tcbIndexPrintSkinCA{#2}}
122 \index{Skins\idx@level#2\idx@actual\tcbIndexPrintSkinC{#2}}
123 },
124 }
125 }
126 {}{key}
127 }
128 {
129 \__tcobox_doc_entry_end:n { key }
130 }
131
132
133 \NewDocumentCommand \docFading { s +O{} m }
134 {
135 \group_begin:
136 \tcbset{doc~name={#3},#2}
137 \textcolor{\kvtcb@col@value}{\__tcobox_print_docname:}
138 \IfBooleanF{#1}
139 {
140 \kvtcb@index@command{\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintFadCA{\kvtcb@doc@index}}
141 \kvtcb@index@command{Fadings\idx@level\kvtcb@doc@sortindex\idx@actual\tcbIndexPrintFadC{\kvtcb@doc@index}}
142 }
143 \group_end:
144 }
145
146 \ExplSyntaxOff
147
148
149
150 \newtcolorbox{marker}[1][]{enhanced,
151 before skip balanced=2mm,after skip balanced=3mm,
152 boxrule=0.4pt,left=5mm,right=2mm,top=1mm,bottom=1mm,
153 colback=yellow!50,
154 colframe=yellow!20!black,
155 sharp corners,rounded corners=southeast,arc is angular,arc=3mm,
156 underlay={%
157 \path[fill=tcbcolback!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
158 \path[draw=tcbcolframe,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
159 \path[fill=yellow!50!black,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries !} ([xshift=4mm]interior.north west);
160 },
161 drop fuzzy shadow,#1}
162
163
164 \renewcommand*{\tcbdocnew}[1]{\textcolor{green!50!black}{\sffamily\bfseries N} #1}
165 \renewcommand*{\tcbdocupdated}[1]{\textcolor{blue!75!black}{\sffamily\bfseries U} #1}
166
167 \newcounter{texexp}
168 \newcounter{texercise}
169 \newcounter{mytheorem}[section]
170
171 \newcounter{myexample}
172
173 \newcounter{example}
174 \newlength{\examlen}
175 \newsavebox\mysavebox
176
177 \lstdefinestyle{mydocumentation}{style=tcbdocumentation,
178 classoffset=0,
179 texcsstyle=*\color{blue},
180 % LaTeX and other packages
181 moretexcs={arrayrulecolor,draw,includegraphics,ifthenelse,isodd,lipsum,path,pgfkeysalso,
182 zcref,zcpageref,zvref,
183 },
184 classoffset=1,
185 % tcolorbox macros
186 moretexcs={% core
187 endtcolorbox,endtcbverbatimwrite,newtcolorbox,newtcbox,newtcboxfit,tcbusetemp,tcbtitle,tcbtitletext,
188 tcblower,tcbox,tcboxfit,tcbset,tcbuselibrary,tcolorbox,tcbverbatimwrite,tcbsetforeverylayer,tcbsubtitle,
189 tcolorboxenvironment,tcblistof,tcbstartrecording,tcbrecord,tcbstoprecording,tcbinputrecords,
190 tcbpatcharcangular,tcbpatcharcround,tcbifoddpage,thetcolorboxnumber,thetcolorboxpage,
191 tcbheightfromgroup,tcbheightspace,tcbtextwidth,tcbtextheight,
192 % listings
193 endtcblisting,newtcblisting,newtcbinputlisting,
194 tcblisting,tcbinputlisting,tcbuselistingtext,tcbuselistinglisting,tcbusetemplisting,
195 tcbfitdim,tcbfitsteps,
196 % raster
197 thetcbrasternum,tcbitem,
198 % breakable
199 tcbbreak,
200 % theorems
201 tcbmaketheorem,tcboxmath,tcbhighmath,thetcbcounter,newtcbtheorem,
202 NewTcbTheorem,RenewTcbTheorem,ProvideTcbTheorem,DeclareTcbTheorem,
203 % documentation
204 brackets,
205 colDef,colOpt,cs,
206 docAuxCommand,docColor,docAuxEnvironment,docAuxKey,
207 docCounter,docLength,
208 meta,marg,
209 oarg,pbarg,
210 refCom,refEnv,refKey,refPathOperation,refAux,refAuxcs,refPkg,
211 sarg,
212 tcbmakedocSubKey,tcbdocmarginnote,tcbdocnew,tcbdocupdated,
213 docKeyChoices,docKeyChoices*,
214 % skins
215 tcbincludegraphics,tcbincludepdf,pdfpages,imagepage,imagepath,imagename,
216 tcbline,tcboxedtitleheight,tcboxedtitlewidth,
217 tcbsettowidthofnode,tcbsetmacrotowidthofnode,tcbsettoheightofnode,tcbsetmacrotoheightofnode,
218 tcbhypernode,
219 % vignette
220 tcbvignette,
221 % xparse
222 DeclareTColorBox,NewTColorBox,RenewTColorBox,ProvideTColorBox,
223 DeclareTotalTColorBox,NewTotalTColorBox,RenewTotalTColorBox,ProvideTotalTColorBox,
224 DeclareTCBox,NewTCBox,RenewTCBox,ProvideTCBox,
225 DeclareTotalTCBox,NewTotalTCBox,RenewTotalTCBox,ProvideTotalTCBox,
226 DeclareTCBListing,NewTCBListing,RenewTCBListing,ProvideTCBListing,
227 DeclareTCBInputListing,NewTCBInputListing,RenewTCBInputListing,ProvideTCBInputListing,
228 DeclareTCBoxFit,NewTCBoxFit,RenewTCBoxFit,ProvideTCBoxFit,
229 DeclareTotalTCBoxFit,NewTotalTCBoxFit,RenewTotalTCBoxFit,ProvideTotalTCBoxFit,
230 tcbsidebyside,tcboxverb,
231 % externalization
232 tcbEXTERNALIZE,tcbifexternal,newtcbexternalizeenvironment,
233 renewtcbexternalizeenvironment,extcolorbox,extikzpicture,
234 newtcbexternalizetcolorbox,renewtcbexternalizetcolorbox,
235 tcbiffileprocess,
236 % box array
237 newboxarray,boxarraygetsize,boxarrayreset,boxarrayclear,
238 boxarraygetbox,boxarraygetwidth,boxarraygetheight,boxarraygetdepth,
239 boxarraygettotalheight,useboxarray,usetcboxarray,
240 consumeboxarray,consumetcboxarray,ifboxarrayempty,
241 % poster
242 posterbox,tcbposterwidth,tcbposterheight,tcbpostercolspacing,
243 tcbposterrowspacing,tcbpostercolumns,tcbposterrows,tcbpostercolwidth,
244 tcbposterrowheight,tcbposterset,
245 % extras
246 skinExampleSet,
247 },
248 texcsstyle=*\color{Definition}\bfseries,
249 classoffset=0% restore default
250 }
251
252 \definecolor{Green_Dark}{rgb}{0.078431,0.407843,0.176471}
253 \definecolor{Blue_Dark}{rgb}{0.090196,0.211765,0.364706}
254 \definecolor{Blue_Bright}{rgb}{0.858824,0.898039,0.945098}
255
256 \tcbset{
257 documentation listing style=mydocumentation,%
258 sbs/.style={sidebyside,before lower app={\tcbset{sidebyside=false}}},%
259 innerbox/.style={reset,documentation listing style=mydocumentation,
260 doc keypath/.store in=\kvtcb@doc@keypath,
261 docexample/.style={docexample original},%
262 },
263 beforeafter example/.style={
264 before skip balanced=4pt plus 2pt minus 1pt,
265 after skip balanced=5pt plus 2pt minus 1pt
266 },
267 base example/.style={bicolor jigsaw,
268 beforeafter example,arc is angular,fonttitle=\bfseries,
269 fontlower=\footnotesize,
270 colframe=Blue_Dark,
271 colback=Blue_Bright,
272 colbacklower=white,
273 drop fuzzy shadow,
274 },
275 docexample/.style={base example,%
276 every box on layer 2/.style={every box},
277 before upper={\tcbset{innerbox}},before lower={\tcbset{innerbox}}
278 },
279 docexample original/.style={colframe=ExampleFrame,colback=ExampleBack,fontlower=\footnotesize,
280 before skip=\medskipamount,after skip=\medskipamount,frame style={}},
281 }
282
283 \newtcbexternalizetcolorbox{exdispExample}{dispExample}{environment with percent=false,minipage,compiler=lualatex}{beforeafter example}
284
285 \newtcbexternalizetcolorbox{exdispExample*}{dispExample*}{environment with percent=false,minipage,compiler=lualatex}{beforeafter example}
286
287 \newcommand{\inputpreamblelisting}[1]{%
288 \tcbinputlisting{title=Definition in the preamble:,
289 base example,coltitle=black,fonttitle=\itshape,titlerule=0pt,
290 colbacktitle=Navy!15!ExampleBack,
291 top=0mm,
292 before skip balanced=4pt plus 2pt minus 1pt,
293 after skip balanced=5pt plus 2pt minus 1pt,
294 listing style=mydocumentation,
295 listing only,listing file={\jobname_preamble_#1.tex}}%
296 }
297
298 \newtcolorbox{deprecated}{blank,breakable,watermark text=deprecated}
299
300 \newtcbox{\mylib}{enhanced,nobeforeafter,tcbox raise base,boxrule=0.4pt,top=0mm,bottom=0mm,
301 right=0mm,left=4mm,arc=1pt,boxsep=2pt,before upper={\vphantom{dlg}},
302 colframe=green!50!black,coltext=green!25!black,colback=green!10!white,
303 overlay={\begin{tcbclipinterior}\fill[green!75!blue!50!white] (frame.south west)
304 rectangle node[text=white,font=\sffamily\bfseries\tiny,rotate=90] {LIB} ([xshift=4mm]frame.north west);\end{tcbclipinterior}}}
305
306 \robustify{\mylib}
307
308 \pdfstringdefDisableCommands{%
309 \def\mylib#1{`#1'}%
310 }
311
312 \newrobustcmd*{\tcbexclamation}{!}
313
314 \newtcbox{\section@box}{tile,before=\clearpage\noindent,after=,
315 fontupper=\normalfont\Large\bfseries,capture=minipage,colback=blue!80,coltext=white,
316 boxsep=0mm,top=4mm,bottom=4mm,left=\oddsidemargin+1in,right=\oddsidemargin+1in,
317 spread sidewards,fuzzy halo=1mm with blue!50!gray}
318
319 \renewcommand\section{\@startsection{section}{1}{\z@}{\z@}{5mm}{\section@box}}
320
321 \newtcblisting{fulldocumentlisting}[1]{%
322 enhanced jigsaw,lower separated=false,breakable,
323 leftlower=0mm,rightlower=0mm,bottom=0mm,middle=1mm,
324 listing style=mydocumentation,base example,
325 listing and comment,
326 pdf comment,freeze pdf,
327 comment style={raster columns=2,raster equal skip=1mm},
328 compilable listing,
329 run pdflatex,#1
330 }
331
332 \ExplSyntaxOn
333
334 \cs_new:Npn \__tcobox_aux_mkdir:n #1
335 {
336 \file_if_exist:nF { "#1"/dir.marker }
337 {
338 \sys_shell_now:x {mkdir~"#1"}
339 \iow_open:Nn \g_tmpa_iow {"#1"/dir.marker}
340 \iow_close:N \g_tmpa_iow
341 }
342 }
343
344 \NewDocumentCommand{ \tcbAUXmkdir }{ m }
345 {
346 \__tcobox_aux_mkdir:n {#1}
347 }
348
349 \ExplSyntaxOff