Debian Codegraph @

texmf-dist/doc/latex/overarrows/overarrows-doc.sty

raw
1 %%
2 %% This is file `overarrows-doc.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% overarrows.dtx (with options: `docstyle')
8 %%
9 %% This is a generated file.
10 %%
11 %% Copyright (C) 2023-2025 by Julien LabbĂ© <[email protected]>
12 %%
13 %% This file may be distributed and/or modified under the conditions of the LaTeX
14 %% Project Public License (LPPL), either version 1.3c of this license or (at your
15 %% option) any later version. The latest version of this license is in the file
16 %% https://www.latex-project.org/lppl.txt
17 %%
18 \RequirePackage{xcolor}
19 \PassOptionsToPackage{hyperref}{xcolor}
20 \RequirePackage[many]{tcolorbox}
21 \tcbuselibrary{listings}
22 \tcbuselibrary{documentation}
23 \hypersetup{hidelinks}
24 \definecolor{ovar_lavender}{rgb}{0.92,0.92,1}
25 \definecolor{ovar_darkblue}{rgb}{0.1,0.2,0.5}
26 \definecolor{ovar_darkgreen}{rgb}{0,0.39,0}
27 \definecolor{ovar_beige}{rgb}{.96,.96,.86}
28 \colorlet{ovar_commands}{ovar_darkblue}
29 \colorlet{ovar_keys}{ovar_darkgreen}
30 \colorlet{ovar_lengths}{violet}
31 \colorlet{ovar_options}{Definition} % from tcolorbox documentation
32 \lstdefinestyle{lstovardoc}{%
33 language = [LaTeX]TeX,
34 columns = flexible,
35 keepspaces = true,
36 keywordstyle = {\bfseries\color{ovar_darkblue}},
37 texcsstyle = *{\bfseries\color{ovar_darkblue}},
38 commentstyle = {\color{gray}},
39 identifierstyle = {\color{ovar_darkgreen}},
40 morekeywords = {},% keywordsprefix needs a morekeywords before
41 keywordsprefix = {\\},
42 literate = *{\$}{{\textcolor{red}{\$}}}{1}
43 {\&}{{\textcolor{red}{\&}}}{1}
44 {\}}{{\textcolor{darkgray}{\}}}}{1}
45 {\{}{{\textcolor{darkgray}{\{}}}{1}
46 {\\\\}{{\textcolor{red}{\textbackslash\textbackslash}}}{2}
47 {\%\ \ \ \ }{}0,
48 basicstyle = \ttfamily\footnotesize,
49 frame = none,
50 framesep = 0pt,
51 aboveskip = 0pt,
52 belowskip = 0pt,
53 }
54 \lstdefinestyle{lstovarcode}{%
55 style = lstovardoc,
56 backgroundcolor = \color{ovar_beige},
57 breakindent = 1cm,
58 numbers = left,
59 numberstyle = \scriptsize\ttfamily\color{gray},
60 aboveskip = \smallskipamount,
61 belowskip = \smallskipamount,
62 }
63 \tcbset{% copied and adapted from tcolorbox.doc.s_main.sty
64 documentation listing style=lstovardoc,%
65 doc keypath=overarrows,
66 size=small,%
67 % verbatim ignore percent,
68 %% styles
69 docexample/.style={%
70 bicolor jigsaw,
71 before skip balanced=\medskipamount,
72 after skip balanced=\medskipamount,
73 fonttitle=\bfseries,
74 fontlower=\normalfont,
75 halign lower=center,
76 colframe=ovar_darkblue,
77 colback=ovar_lavender,
78 colbacklower=white,
79 drop fuzzy shadow,
80 },
81 color key=ovar_keys,
82 color command=ovar_commands,
83 color length=ovar_lengths,
84 doc head key={fontlower=\footnotesize, collower=darkgray},
85 before doc body={\parskip=\smallskipamount},
86 }
87 \begin{filecontents*}{\jobname.mst}
88 actual '='
89 \end{filecontents*}
90 \tcbset{%
91 index actual={=},
92 index colorize=true,
93 index gather all,
94 index format=pgfsection,
95 }
96 \def\tcb@doc@index@pgfsection{%
97 \def\index@prologue{%
98 \section*{\kvtcb@text@index}\addcontentsline{toc}{section}{\kvtcb@text@index}
99 {\small%
100 Entries listed in the categories ``commands", ``lengths", and
101 ``internal macros" also include references to package implementation. }
102 \bigskip\par\noindent%
103 }%
104 \tcb@doc@index@pgf@%
105 }
106 \newcommand{\indexmacro}[1]{%
107 \begingroup
108 \let\lst@UM\@empty%
109 \index{{Commands!#1=\tcbIndexPrintComC {#1}}}%
110 \endgroup
111 }
112 \newcommand{\indexmacrointernal}[1]{%
113 \begingroup
114 \let\lst@UM\@empty%
115 \index{{Internal macros!#1=\tcbIndexPrintComC {#1}}}%
116 \endgroup
117 }
118 \newcommand{\indexlength}[1]{%
119 \begingroup
120 \let\lst@UM\@empty%
121 \index{{Lengths!#1=\tcbIndexPrintLenC {#1}}}%
122 \endgroup
123 }
124 \let\macrocode\relax
125 \lstnewenvironment{macrocode}{%
126 \lstset{%
127 name=macrocode,
128 firstnumber=auto,
129 style = lstovarcode,
130 showlines = false,
131 texcs = [2]{% commands
132 DeclareOverArrowCommand, ProvideOverArrowCommand,%
133 NewOverArrowCommand, RenewOverArrowCommand,%
134 TestOverArrow, xjoinrel, smallermathstyle, arrowmathstyle, baselinebar,%
135 esvectvv, vv,%
136 overrightarrow, overleftarrow, overleftrightarrow, overrightharpoonup,%
137 overrightharpoondown, overleftharpoonup, overleftharpoondown, overbar,%
138 underrightarrow, underleftarrow, underleftrightarrow, underrightharpoonup,%
139 underrightharpoondown, underleftharpoonup, underleftharpoondown, underbar,%
140 SetOverArrowsMethod, SetOverArrowsSubscriptCommand,%
141 },
142 index = [2][texcs2],%
143 indexstyle = [2]\indexmacro,%
144 texcs = [3]{% lengths
145 overarrowlength, overarrowthickness, overarrowsmallerthickness,%
146 },
147 index = [3][texcs3],%
148 indexstyle = [3]\indexlength,%
149 texcs = [4]{% internal macros
150 ovar@rightarrow, ovar@leftarrow, ifovar@option@oldarrows@,
151 ovar@option@esvect, ifovar@option@tikz@, ifovar@option@pstricks@,
152 ifovar@option@pstarrows@, ifovar@detectsubscripts@,
153 ifovar@option@subother@, ifovar@option@subactive@, ifovar@option@debug@,
154 ifovar@option@overrightarrow@, ifovar@option@underrightarrow@,
155 ifovar@option@overleftarrow@, ifovar@option@underleftarrow@,
156 ifovar@option@overleftrightarrow@, ifovar@option@underleftrightarrow@,
157 ifovar@option@overrightharpoonup@, ifovar@option@underrightharpoonup@,
158 ifovar@option@overrightharpoondown@, ifovar@option@underrightharpoondown@,
159 ifovar@option@overleftharpoonup@, ifovar@option@underleftharpoonup@,
160 ifovar@option@overleftharpoondown@, ifovar@option@underleftharpoondown@,
161 ifovar@option@overbar@, ifovar@option@underbar@, ovar@auto@middle,
162 ovar@auto@trim@middle, ovar@subcmd, ovar@set, ovar@length@min,
163 ovar@before@arrow, ovar@after@arrow, ovar@macro@stack, ovar@macro@arrow,
164 ovar@shift@left, ovar@shift@right, ovar@stack@fill, ovar@stackunder@fill,
165 ovar@stack@lens, ovar@stackunder@lens, ovar@macro@arrowfill,
166 ovar@arrow@fill, ovar@arrow@start, ovar@trim@start, ovar@trim@middle,
167 ovar@arrow@middle, ovar@trim@end, ovar@arrow@end, ovar@tikz@command,
168 ovar@tikz@pathoptions, ovar@tikz@path, ovar@tikz@options,
169 ovar@pstricks@geometry, ovar@pstricks@linethickness, ovar@pstricks@psset,
170 ovar@pstricks@command, ovar@picture@geometry, ovar@picture@linethickness,
171 ovar@picture@command, ovar@tempdim, ovar@set@arrowlength,
172 ovar@set@arrowthickness, ovar@set@arrowthickness@UM@lua,
173 ovar@rulethickness@fontdimen, ovar@rulethickness@family, ovar@stackover@@,
174 ovar@stackunder@@, ovar@stackover@, ovar@stackunder@, ovar@stackover@fill,
175 ovar@stackover@lens, ovar@cmdname@processor, ovar@set@common,
176 ovar@starversion, ovar@tempbox, ovar@testmathstyles, ovar@row@teststyle,
177 ovar@testkerning,%
178 ovar@save@mathstyle, ovar@bar,%
179 },
180 index = [4][texcs4],%
181 indexstyle = [4]\indexmacrointernal,%
182 moretexcs = [5]{% other macros
183 relbar, Relbar, relbareda, relbaredd, harrowextender, rightarrow,
184 Rightarrow, varleftarrow, varrightarrow, twoheadrightarrow,%
185 },
186 }
187 \csname\@lst @SetFirstNumber\endcsname
188 }{%
189 \csname \@lst @SaveFirstNumber\endcsname
190 }
191 \DeclareDocumentEnvironment{macro}{m}{%
192 \count@\escapechar \escapechar=-1
193 \edef\macroname{\string#1}
194 \escapechar\count@
195 \marginpar{%
196 \parbox{0.88\linewidth}{%
197 \scriptsize\flushright\ifcsdef{r@com:\macroname}{\refCom*{\macroname}}{\cs{\macroname}}%
198 }%
199 }
200 }{% end of macro environment
201 }
202 \def\refDoc#1{\tcb@ref@doc{#1}}
203 \newcommand{\pkg}[1]{\textsf{#1}}
204 \newrobustcmd{\tcbIndexPrintOptionCA}[1]{% adapted from \tcbIndexPrintKeyCA
205 \tcb@Index@Print@CA{#1}{ovar_options}{package option}%
206 }
207 \newrobustcmd{\tcbIndexPrintOptionC}[1]{% adapted from \tcbIndexPrintKeyCA
208 \tcb@Index@Print@C{#1}{ovar_options}%
209 }
210 \DeclareDocumentEnvironment{docOption}{ O{} m }{%
211 \begin{docKey*}[]
212 [doc name={#2}, doc label={opt:#2}, color key=ovar_options, #1]
213 {#2}{}{}%
214 \kvtcb@index@command{%
215 \kvtcb@doc@sortindex\idx@actual\tcbIndexPrintOptionCA{#2}%
216 }%
217 \kvtcb@index@command{%
218 {Package options}\idx@level\kvtcb@doc@sortindex\idx@actual%
219 \tcbIndexPrintOptionC{#2}%
220 }%
221 }{%
222 \end{docKey*}%
223 }
224 \def\refOpt{\refDoc{key:opt}}
225 \let\tcbdocLength\docLength% save original definition
226 \DeclareDocumentEnvironment{docLength}{ O{} m }{%
227 \begin{docCommand*}[doc name=#2, color command=ovar_lengths,#1]{#2}{}
228 \protected@edef\@currentlabel{\cs{#2}}%
229 \label{len:#2}%
230 %% add length index entry (from \docLength original definition)
231 \kvtcb@index@command{%
232 \kvtcb@doc@sortindex\idx@actual\tcbIndexPrintLenCA{\kvtcb@doc@index}%
233 }%
234 \kvtcb@index@command{%
235 \kvtcb@text@lengths\idx@level\kvtcb@doc@sortindex\idx@actual%
236 \tcbIndexPrintLenC{\kvtcb@doc@index}%
237 }%
238 }{%
239 \end{docCommand*}%
240 }
241 \def\refLen{\refDoc{len}}
242 \endinput
243 %%
244 %% End of file `overarrows-doc.sty'.