Debian Codegraph @

texmf-dist/doc/latex/tasks/tasks-manual.cls

raw
1 % --------------------------------------------------------------------------
2 % the TASKS package
3 %
4 % lists with columns filled horizontally
5 %
6 % --------------------------------------------------------------------------
7 % Clemens Niederberger
8 % Web: https://github.com/cgnieder/tasks/
9 % E-Mail: [email protected]
10 % --------------------------------------------------------------------------
11 % Copyright 2013--2021 Clemens Niederberger
12 %
13 % This work may be distributed and/or modified under the
14 % conditions of the LaTeX Project Public License, either version 1.3
15 % of this license or (at your option) any later version.
16 % The latest version of this license is in
17 % http://www.latex-project.org/lppl.txt
18 % and version 1.3 or later is part of all distributions of LaTeX
19 % version 2005/12/01 or later.
20 %
21 % This work has the LPPL maintenance status `maintained'.
22 %
23 % The Current Maintainer of this work is Clemens Niederberger.
24 % --------------------------------------------------------------------------
25 % If you have any ideas, questions, suggestions or bugs to report, please
26 % feel free to contact me.
27 % --------------------------------------------------------------------------
28 \ProvidesClass{tasks-manual}[2022/01/08]
29
30 \LoadClass[load-preamble,add-index]{cnltx-doc}
31 \RequirePackage{imakeidx}
32
33 \RequirePackage{tasks}
34
35 \setcnltx{
36 package = {tasks} ,
37 authors = Clemens Niederberger ,
38 email = {[email protected]} ,
39 url = {https://github.com/cgnieder/tasks/} ,
40 info = {lists with columns filled horizontally} ,
41 add-cmds = {
42 NewTasksEnvironment,
43 RenewTasksEnvironment,
44 settasks,
45 startnewitemline ,
46 task
47 } ,
48 add-silent-cmds = {
49 DeclareInstance, DeclareTemplateInterface,
50 faThumbsOUp,
51 sample, Sample , theexercise
52 } ,
53 index-setup = { othercode=\footnotesize, level=\section , noclearpage } ,
54 makeindex-setup = { columns=3, columnsep=1em }
55 }
56
57 \def\libertine@figurestyle{LF}
58 \RequirePackage{amsmath}
59 \undef\lvert \undef\lVert
60 \undef\rvert \undef\rVert
61 \RequirePackage[libertine]{newtxmath}
62 \def\libertine@figurestyle{OsF}
63
64 \newpackagename\ExSheets{ExSheets}
65 \newpackagename\Tasks{tasks}
66
67 % ----------------------------------------------------------------------------
68 % other packages, bibliography, index
69 \RequirePackage{xcoffins,tikz,wasysym,enumitem,booktabs,siunitx,accsupp}
70 \RequirePackage{acro}
71 \DeclareAcronym{id}{
72 short = id ,
73 long = Identifier ,
74 format = \scshape ,
75 pdfstring = ID ,
76 short-acc = ID
77 }
78
79 \RequirePackage{csquotes}
80
81 % ----------------------------------------------------------------------------
82 % example definitions that have to be done in the preamble:
83 \RequirePackage{xsim}
84
85 \newcommand*\sample{This is some sample text we will use to create a somewhat
86 longer text spanning a few lines.}
87 \newcommand*\Sample{\sample\ \sample\par\sample}
88
89 \RequirePackage{fontawesome}
90 \RequirePackage{datetime2}
91 \DTMsetup{useregional=numeric,datesep=/}
92 \newrobustcmd*\tasks@add@version[2]{%
93 \csdef{tasks@ver@#2}{%
94 \DTMdate{#1}%
95 \csgdef{tasks@ver@#2used}{}%
96 \csdef{tasks@ver@#2}{\DTMdate{#1}}%
97 }%
98 }
99
100 \newrobustcmd*\tasks@date[1]{%
101 \ifcsdef{tasks@ver@#1used}{}{ (\csuse{tasks@ver@#1})}}
102 \newrobustcmd*\tasks@ifnew[1]{\ifcsstring{c_tasks_version_tl}{#1}}
103 \newrobustcmd*\tasks@NEW{\textcolor{red}{\faStarO\ New}}
104
105 \renewrobustcmd*\sinceversion[1]{%
106 \tasks@ifnew{#1}%
107 {\cnltx@version@note{\tasks@NEW}}%
108 {\cnltx@version@note{introduced in v#1\tasks@date{#1}}}%
109 }
110 \renewrobustcmd*\changedversion[1]{%
111 \cnltx@version@note{updated in v#1\tasks@date{#1}}%
112 }
113
114 \newnote*\sincechanged[2]{%
115 introduced in v#1 and updated in v#2\tasks@date{#2}%
116 }
117
118 \RenewDocumentEnvironment{commands}{}
119 {%
120 \cnltx@set@catcode_{12}%
121 \let\command\cnltx@command
122 \cnltxlist
123 }
124 {\endcnltxlist}
125
126 \RequirePackage{tcolorbox}
127 \tcbuselibrary{skins,breakable}
128 \tcbset{enhanced,enhanced jigsaw}
129
130 \newtcolorbox{bewareofthedog}{
131 colback = red!2!white!98 ,
132 colframe = red ,
133 underlay={%
134 \path[draw=none]
135 (interior.south west)
136 rectangle node[red]{\Huge\bfseries !}
137 ([xshift=-4mm]interior.north west);
138 }%
139 }
140
141 \newtcolorbox{cnltxcode}[1][]{
142 boxrule = 1pt ,
143 colback = cnltxbg ,
144 colframe = cnltx ,
145 arc = 5pt ,
146 beforeafter skip = .5\baselineskip ,%
147 #1%
148 }
149
150 \newcommand*\tasks@readoptions[1]{%
151 \catcode`\^^M=13
152 \tasks@read@options{#1}%
153 }
154
155 \begingroup
156 \catcode`\^^M=13
157 \gdef\tasks@read@options#1#2^^M{%
158 \ifblank{#2}{}{\tasks@read@options@#2}%
159 #1%
160 \XSIMfilewritestart*{\jobname.tmp}%
161 }%
162 \endgroup
163
164 \def\tasks@read@options@[#1]{\pgfqkeys{/cnltx}{#1}}
165
166 \RenewDocumentEnvironment{sourcecode}{}
167 {%
168 \tasks@readoptions{%
169 \setlength\cnltx@sidebysidewidth
170 {\dimexpr .45\columnwidth -\lst@xleftmargin -\lst@xrightmargin\relax}%
171 \expanded{%
172 \noexpand\lstset{
173 style=cnltx,
174 \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
175 {linewidth=\cnltx@sidebysidewidth,}{}%
176 \expandonce\cnltx@local@listings@options
177 }%
178 }%
179 \XSIMgobblechars{2}%
180 }%
181 }
182 {%
183 \XSIMfilewritestop
184 \cnltxcode[breakable]%
185 \lstinputlisting[style=cnltx]{\jobname.tmp}%
186 \endcnltxcode
187 }
188
189 \RenewDocumentEnvironment{example}{}
190 {%
191 \tasks@readoptions{%
192 \setlength\cnltx@sidebysidewidth
193 {\dimexpr .45\columnwidth -\lst@xleftmargin -\lst@xrightmargin\relax}%
194 \expanded{%
195 \noexpand\lstset{
196 style=cnltx,
197 \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
198 {linewidth=\cnltx@sidebysidewidth,}{}%
199 \expandonce\cnltx@local@listings@options
200 }%
201 }%
202 \XSIMgobblechars{2}%
203 }%
204 }
205 {%
206 \XSIMfilewritestop
207 \catcode`\^^M=5
208 \ifbool{cnltx@sidebyside}
209 {%
210 \cnltxcode
211 \noindent
212 \minipage[c]{\cnltx@sidebysidewidth}%
213 \cnltx@pre@source@hook
214 \lstinputlisting[style=cnltx] {\jobname.tmp}%
215 \cnltx@after@source@hook
216 \endminipage\hfill
217 \minipage[c]{\cnltx@sidebysidewidth}%
218 \cnltx@pre@example@hook
219 \input {\jobname.tmp}%
220 \cnltx@after@example@hook
221 \endminipage
222 }
223 {%
224 \cnltxcode[breakable]%
225 \cnltx@pre@source@hook
226 \lstinputlisting{\jobname.tmp}%
227 \cnltx@after@source@hook
228 \tcblower
229 \cnltx@pre@example@hook
230 \input {\jobname.tmp}%
231 \cnltx@after@example@hook
232 }%
233 \endcnltxcode
234 }
235
236 \RequirePackage[
237 backend=biber,
238 style=cnltx,
239 sortlocale=en_US,
240 indexing=cite]{biblatex}
241 \RequirePackage{csquotes,varioref}
242 \defbibheading{bibliography}{\section{References}}
243 \addbibresource{cnltx.bib}
244
245 \RequirePackage[biblatex]{embrac}
246 \ChangeEmph{[}[,.02em]{]}[.055em,-.08em]
247 \ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em]
248
249 \tasks@add@version{2013-01-19}{0.7}
250 \tasks@add@version{2013-04-04}{0.8a}
251 \tasks@add@version{2013-04-07}{0.9}
252 \tasks@add@version{2013-04-22}{0.9a}
253 \tasks@add@version{2013-12-03}{0.9b}
254 \tasks@add@version{2014-05-11}{0.9c}
255 \tasks@add@version{2014-07-20}{0.10}
256 \tasks@add@version{2014-07-29}{0.10a}
257 \tasks@add@version{2016-05-03}{0.11}
258 \tasks@add@version{2016-05-04}{0.11a}
259 \tasks@add@version{2016-08-13}{0.12}
260 \tasks@add@version{2016-08-16}{0.13}
261 \tasks@add@version{2019-10-04}{1.0}
262 \tasks@add@version{2019-10-05}{1.0a}
263 \tasks@add@version{2019-10-06}{1.0b}
264 \tasks@add@version{2019-10-07}{1.0c}
265 \tasks@add@version{2019-10-08}{1.0d}
266 \tasks@add@version{2019-11-03}{1.1}
267 \tasks@add@version{2020-01-11}{1.1a}
268 \tasks@add@version{2020-03-21}{1.2}
269 \tasks@add@version{2020-04-19}{1.2a}
270 \tasks@add@version{2020-08-19}{1.3}
271 \tasks@add@version{2021-02-20}{1.3a}
272 \tasks@add@version{2022-01-08}{1.4}
273 \tasks@add@version{2022-01-08}{1.4a}
274
275 \endinput