| 1 |
% \iffalse meta-comment |
| 2 |
% !TEX program = pdfLaTeX |
| 3 |
%<*internal> |
| 4 |
\iffalse |
| 5 |
%</internal> |
| 6 |
%<*readme> |
| 7 |
----------------------------------------------------------------- |
| 8 |
##### ccool --- (Custom) COntext Oriented LaTeX |
| 9 |
- Source repository: https://github.com/rogard/ccool |
| 10 |
- Released under the LaTeX Project Public License v1.3c or later |
| 11 |
- See http://www.latex-project.org/lppl.txt |
| 12 |
----------------------------------------------------------------- |
| 13 |
%</readme> |
| 14 |
%<*internal> |
| 15 |
\fi |
| 16 |
\def\nameofplainTeX{plain} |
| 17 |
\ifx\fmtname\nameofplainTeX\else |
| 18 |
\expandafter\begingroup |
| 19 |
\fi |
| 20 |
%</internal> |
| 21 |
%<*install> |
| 22 |
\input l3docstrip.tex |
| 23 |
\keepsilent |
| 24 |
\askforoverwritefalse |
| 25 |
\preamble |
| 26 |
----------------------------------------------------------------------------- |
| 27 |
ccool --- (Custom) COntext Oriented LaTeX |
| 28 |
Released under the LaTeX Project Public License v1.3c or later |
| 29 |
See http://www.latex-project.org/lppl.txt |
| 30 |
---------------------------------------------------------------------------- |
| 31 |
|
| 32 |
\endpreamble |
| 33 |
\postamble |
| 34 |
|
| 35 |
Copyright (C) 2020-2021 by Erwann Rogard |
| 36 |
|
| 37 |
This work may be distributed and/or modified under the |
| 38 |
conditions of the LaTeX Project Public License (LPPL), either |
| 39 |
version 1.3c of this license or (at your option) any later |
| 40 |
version. The latest version of this license is in the file: |
| 41 |
|
| 42 |
http://www.latex-project.org/lppl.txt |
| 43 |
|
| 44 |
This work is "maintained" (as per LPPL maintenance status) by |
| 45 |
Erwann Rogard. |
| 46 |
|
| 47 |
This work consists of the file ccool.dtx and the derived files: |
| 48 |
ccool.sty, and ccool.pdf. |
| 49 |
|
| 50 |
\endpostamble |
| 51 |
\generate{ |
| 52 |
\file{\jobname.sty}{\from{\jobname.dtx}{package}} |
| 53 |
} |
| 54 |
%</install> |
| 55 |
%<install> \endbatchfile |
| 56 |
%<*internal> |
| 57 |
\generate{ |
| 58 |
\file{\jobname.ins}{\from{\jobname.dtx}{install}} |
| 59 |
} |
| 60 |
\nopreamble\nopostamble |
| 61 |
\generate{ |
| 62 |
\file{README.md}{\from{\jobname.dtx}{readme}} |
| 63 |
} |
| 64 |
\ifx\fmtname\nameofplainTeX |
| 65 |
\expandafter\endbatchfile |
| 66 |
\else |
| 67 |
\expandafter\endgroup |
| 68 |
\fi |
| 69 |
%</internal> |
| 70 |
%<package> \NeedsTeXFormat{LaTeX2e}[2021-06-01] |
| 71 |
%<package> \RequirePackage{expl3, xparse, l3keys2e}[2021-06-01] |
| 72 |
%<package> \RequirePackage{lambdax}[2021-06-01] |
| 73 |
%<package> \ProvidesExplPackage |
| 74 |
%<package> {ccool} % Package name |
| 75 |
%<package> {2021-09-20} % Release date |
| 76 |
%<package> {3.2} % Release version |
| 77 |
%<package> {ccool --- (Custom) COntext Oriented LaTeX } % Description |
| 78 |
%<*driver> |
| 79 |
\documentclass[show-notes]{l3doc} |
| 80 |
\EnableCrossrefs |
| 81 |
\CodelineIndex |
| 82 |
\RecordChanges |
| 83 |
%^^A\documentclass[full, show-notes]{l3doc} |
| 84 |
%^^A \listfiles |
| 85 |
\usepackage{amsmath, bookmark, enumitem, mathtools, microtype, tcolorbox, xparse} |
| 86 |
\usepackage[french, german, english]{babel} |
| 87 |
\usepackage[T1]{fontenc} |
| 88 |
\usepackage[bibencoding=auto, backend=biber, sorting=ynt]{biblatex} |
| 89 |
\begin{filecontents*}{\jobname.bib} |
| 90 |
@phdthesis{oh-2005, |
| 91 |
author = {Olympia Hadjiliadis}, |
| 92 |
title = {Change--point detection of two--sided alternatives in the Brownian motion model and its connection to the gambler's ruin problem with relative wealth perception}, |
| 93 |
year = {2005}, |
| 94 |
school = {Columbia University} |
| 95 |
} |
| 96 |
@misc{a-547018, |
| 97 |
author = {@{}Javier Bezos}, |
| 98 |
title = {When loading babel with spanish, spurious document command parser}, |
| 99 |
note = {\url{https://tex.stackexchange.com/a/547018/112708}}, |
| 100 |
year = {2020}} |
| 101 |
@misc{a-536597, |
| 102 |
author = {@{}frougon}, |
| 103 |
title = {``Journaling calls to a function \textdel{taking inline code as argument}''}, |
| 104 |
year = {2020}, |
| 105 |
note = {\url{https://tex.stackexchange.com/a/536620}}} |
| 106 |
@manual{interface3, |
| 107 |
title = {The \LaTeX3 interfaces}, |
| 108 |
author = {The \LaTeX3 Project Team}, |
| 109 |
year = {2019}, |
| 110 |
note = {\url{https://ctan.math.washington.edu/tex-archive/macros/latex/contrib/l3kernel/expl3.pdf}}, |
| 111 |
annote = {} } |
| 112 |
@manual{xparse, |
| 113 |
title = {The \pkg{xparse} package}, |
| 114 |
author = {The \LaTeX3 Project Team}, |
| 115 |
year = {2019}, |
| 116 |
note = {\url{https://ctan.math.illinois.edu/macros/latex/contrib/l3packages/xparse.pdf}}, |
| 117 |
annote = {} } |
| 118 |
@manual{2005-cool, |
| 119 |
title = {The \pkg{cool} package}, |
| 120 |
author = {Nick Setzer}, |
| 121 |
year = {2005}, |
| 122 |
note = {\url{https://www.ctan.org/pkg/cool}}, |
| 123 |
annote = {} } |
| 124 |
@manual{l3build, |
| 125 |
title = {The \pkg{l3build} package}, |
| 126 |
author = {The \LaTeX3 Project Team}, |
| 127 |
year = {2019}, |
| 128 |
note = {\url{https://ctan.math.washington.edu/tex-archive/macros/latex/contrib/l3build/l3build.pdf}}, |
| 129 |
annote = {} } |
| 130 |
@manual{tcolorbox, |
| 131 |
title = {The \pkg{tcolorbox} package}, |
| 132 |
author = {Sturm, Thomas F.}, |
| 133 |
year = {2019}, |
| 134 |
note = {\url{http://www.texdoc.net/texmf-dist/doc/latex/tcolorbox/tcolorbox.pdf}}, |
| 135 |
annote = {} } |
| 136 |
@misc{p158966, |
| 137 |
title = {\cs{Ccool}, extension à \LaTeX~à vocation mathématique}, |
| 138 |
note = {\url{http://forum.mathematex.net/latex-f6/ccool-extension-latex-a-vocation-mathematique-t17314.html}}, |
| 139 |
year = {2020}} |
| 140 |
\end{filecontents*} |
| 141 |
\addbibresource{\jobname.bib} |
| 142 |
\ExplSyntaxOn |
| 143 |
%^^A *** Sectioning |
| 144 |
\tl_gset:Nn \partname {Part}%^^A allows to test w/o babel |
| 145 |
\makeatletter |
| 146 |
\newcommand*{\docsetnameref} |
| 147 |
{\def\@currentlabelname}%https://tex.stackexchange.com/questions/537751 |
| 148 |
\makeatother |
| 149 |
\newcounter{cscounter} |
| 150 |
\ProvideDocumentCommand |
| 151 |
\DocPhantomSection{sO{subsection}D<>{}mo} |
| 152 |
{\leavevmode |
| 153 |
\refstepcounter{cscounter} |
| 154 |
\IfBooleanF{#1}{\addcontentsline{toc}{#2}{#4}} |
| 155 |
\IfValueT{#5} |
| 156 |
{\docsetnameref{#3#4}\label{#5}}} |
| 157 |
% ^^A *** Msg |
| 158 |
\msg_new:nnn{__ccool_doc}{unknown}{~#1:#2~unknown} |
| 159 |
% ^^A *** Expressions |
| 160 |
\ProvideDocumentCommand{\pkgpattpair}{mm}{\texttt{>\{#1\}\{#2\}}} |
| 161 |
\ProvideDocumentCommand{\pkgrule}{}{\texttt{$\rightarrow$}} |
| 162 |
% ^^A *** L3 package |
| 163 |
\ProvideDocumentCommand{\docplaceh}{mO{1}}{\texttt{\prg_replicate:nn{#2}{\#}#1}} |
| 164 |
% ^^A *** Lists |
| 165 |
\newlist{arab-inl}{enumerate*}{1} |
| 166 |
\setlist[arab-inl]{label=\arabic*)} |
| 167 |
\newlist{colon-inl}{itemize*}{1} |
| 168 |
\setlist[colon-inl] |
| 169 |
{ %^^Abefore=\noindent, |
| 170 |
label={}, |
| 171 |
itemjoin={{; }}, |
| 172 |
after={{.}}} |
| 173 |
\newlist{descr}{description}{1} |
| 174 |
\setlist[descr]{nosep, align=right, itemindent=0pt, font=\sffamily\tiny} |
| 175 |
% ^^A Sort---> |
| 176 |
\providecommand\docarg[1]{\texttt{#1}} % fun[param] (macro) vs fun[arg] (eval) |
| 177 |
\providecommand\docargnoval{\c_novalue_tl} |
| 178 |
\providecommand\docassign[2]{#1~$\leftarrow$~#2} |
| 179 |
\providecommand\docccept[1]{\textit{#1}} |
| 180 |
\providecommand\doccceptargspec{arg~spec} |
| 181 |
\providecommand\doccceptbool{boolean} |
| 182 |
\providecommand\doccceptclist{clist} |
| 183 |
\providecommand\doccceptcode{code} |
| 184 |
\providecommand\doccceptcsname{cs name} |
| 185 |
\providecommand\doccceptcsorcode{cs~or~code} |
| 186 |
\providecommand\doccceptcs{cs} |
| 187 |
\providecommand\doccceptempty{empty} |
| 188 |
\providecommand\doccceptgopt{global~option} |
| 189 |
\providecommand\doccceptgroup{local~group} |
| 190 |
\providecommand\doccceptint{integer} |
| 191 |
\providecommand\doccceptitems{items} |
| 192 |
\providecommand\doccceptkey{key} |
| 193 |
\providecommand\doccceptkvl{keyval~list} |
| 194 |
\providecommand\doccceptopt{option} |
| 195 |
\providecommand\doccceptpath{path} |
| 196 |
\providecommand\doccceptplaceh{placeholder} |
| 197 |
\providecommand\doccceptpre{preamble} |
| 198 |
\providecommand\doccceptprop{prop} |
| 199 |
\providecommand\doccceptsep{separators} |
| 200 |
\providecommand\doccceptseq{seq} |
| 201 |
\providecommand\docccepttlvar{tl~var} |
| 202 |
\providecommand\docccepttl{token~list} |
| 203 |
\providecommand\docccepttok{token} |
| 204 |
\providecommand\doccceptval{val} |
| 205 |
\providecommand\docconv[1]{convention~\autoref{conv:#1}} |
| 206 |
\providecommand\docdefaultfor{default~for~} |
| 207 |
\providecommand\docenvdoc{\env{document}} |
| 208 |
\providecommand\docparm[1]{\texttt{\char`\{}#1\texttt{\char`\}}} |
| 209 |
\providecommand\docexpand[2]{#1~$\rightarrow$~#2} |
| 210 |
\providecommand\docfillblank{\begin{minipage}[t]{\linewidth}\end{minipage}} |
| 211 |
\providecommand\docissuedont{Don't: } |
| 212 |
\providecommand\docissuedo{Do: } |
| 213 |
\providecommand\docissuesymp{Symptom: } |
| 214 |
\providecommand\doclist[1]{Listing~\ref{listing:#1}} |
| 215 |
\providecommand\docmetakeyorkeyval[1][i]{\meta{key_{#1}}|\meta{key_{#1}}=\meta{val_{#1}}} |
| 216 |
\providecommand\docnb{\noindent\textbf{NB}:~} |
| 217 |
\providecommand\docpard[1]{\texttt{\textless}#1\texttt{\textgreater}} |
| 218 |
\providecommand\docpare[2]{\texttt{#1}\docparm{#2}} |
| 219 |
\providecommand\docparo[1]{\texttt{[}#1\texttt{]}} |
| 220 |
\providecommand\docpipe{\textbar} |
| 221 |
\providecommand\docreflist[1]{Listing~\ref{listing:#1}} |
| 222 |
\providecommand\docsee{See:~} |
| 223 |
\providecommand\docstep[1]{step~\ref{step:#1}} |
| 224 |
\providecommand\doctip{\noindent\textbf{Tip}:~} |
| 225 |
\providecommand\docvers[2]{v#1.#2} |
| 226 |
\providecommand\docwarn{\noindent\textbf{Warning}:~} |
| 227 |
\providecommand\docxparsed[1][~argument]{`d'-type~#1} |
| 228 |
\providecommand\docxparsee[1][~argument]{`e'-type~#1} |
| 229 |
\providecommand\docxparsem[1][~argument]{`m'-type~#1} |
| 230 |
\providecommand\docxparseo[1][~argument]{`o'-type~#1} |
| 231 |
\providecommand\pkgkey{key$_{i}$} |
| 232 |
\providecommand\pkgobj[1]{object identified by #1} |
| 233 |
\providecommand\pkgoptan{\docarg{And}} |
| 234 |
\providecommand\pkgoptex{\docarg{Expans}} |
| 235 |
\providecommand\pkgoptfi{\docarg{File}} |
| 236 |
\providecommand\pkgoptin{\docarg{Inner}} |
| 237 |
%^^A\providecommand\pkgoptions{kvl0} |
| 238 |
\providecommand\pkgoptions{\doccceptkvl$_0$} |
| 239 |
\providecommand\pkgoptou{\docarg{Outer}} |
| 240 |
\providecommand\pkgoptpad{\docarg{Default}}%default |
| 241 |
\providecommand\pkgoptpa{\docarg{Param}} |
| 242 |
\providecommand\pkgoptse{\docarg{Separ}} |
| 243 |
\providecommand\pkgoptwr{\docarg{Write}} |
| 244 |
\providecommand\pkgparap{\texttt{+}}%append |
| 245 |
\providecommand\pkgparex{\texttt{*}}%expand |
| 246 |
\providecommand\pkgparhe{tl$_{1}$}%head |
| 247 |
\providecommand\pkgparin{code$_{1}$}%inner |
| 248 |
\providecommand\pkgparkvl{\doccceptkvl$_1$} |
| 249 |
\providecommand\pkgparkvlnxt{\doccceptkvl$_2$} |
| 250 |
\providecommand\pkgparou{code$_{2}$}%outer |
| 251 |
\providecommand\pkgparpa{tl$_{2}$}%param |
| 252 |
\providecommand\pkgparsiii{tl$_{5}$} |
| 253 |
\providecommand\pkgparsii{tl$_{4}$} |
| 254 |
\providecommand\pkgparsi{tl$_{3}$} |
| 255 |
\providecommand\pkgpars{\Arg{\pkgparsi}\docpipe\Arg{\pkgparsi}\Arg{\pkgparsii}\docpipe\Arg{\pkgparsi}\Arg{\pkgparsii}\Arg{\pkgparsiii}}%separ |
| 256 |
\providecommand\pkgparta{tl$_{6}$}%tail |
| 257 |
\providecommand\pkgsep[1]{\Arg{#1}} |
| 258 |
\providecommand\pkgval{val$_{i}$} |
| 259 |
\providecommand\pkgwrite{\cs{Ccool}\docarg{\meta{\pkgparpa}}\docpare{i}{\meta{\pkgparin}}\Arg{\pkgparkvl}} |
| 260 |
% ^^A Sort<--- |
| 261 |
\ExplSyntaxOff |
| 262 |
%^^A *** listing |
| 263 |
\tcbuselibrary{listings, breakable} |
| 264 |
\newtcblisting[auto counter] |
| 265 |
{listing}[2][]{ |
| 266 |
noparskip, |
| 267 |
breakable, |
| 268 |
colback=white, |
| 269 |
colframe=black, |
| 270 |
opacitybacktitle=.8,% |
| 271 |
fonttitle=\bfseries, |
| 272 |
title={Listing~\thetcbcounter. #1}, |
| 273 |
arc=0pt, |
| 274 |
outer arc=0pt, |
| 275 |
boxrule=1pt, |
| 276 |
listing and text, |
| 277 |
#2} |
| 278 |
\newtcblisting |
| 279 |
{internal} |
| 280 |
{text only, |
| 281 |
breakable, |
| 282 |
colback=white, |
| 283 |
fontupper=\sffamily, |
| 284 |
arc=1pt, |
| 285 |
outer arc=1pt, |
| 286 |
boxrule=0pt, |
| 287 |
halign=left, |
| 288 |
fontupper=\small\sffamily, |
| 289 |
left=0pt, |
| 290 |
top=0pt, |
| 291 |
bottom=0pt} |
| 292 |
\usepackage{ccool} |
| 293 |
\usepackage{hyperref} %^^A comes last |
| 294 |
\begin{document} |
| 295 |
\DocInput{\jobname.dtx} |
| 296 |
\end{document} |
| 297 |
%</driver> |
| 298 |
% \fi |
| 299 |
% |
| 300 |
% \GetFileInfo{\jobname.sty} |
| 301 |
% \title{The \pkg{ccool} package\thanks{^^A |
| 302 |
% This file describes version \fileversion, last revised \filedate.^^A |
| 303 |
% }^^A |
| 304 |
% } |
| 305 |
% \author{Erwann Rogard\thanks{first.lastname at gmail.com}} |
| 306 |
% |
| 307 |
% \date{Released \filedate} |
| 308 |
% \begin{documentation} |
| 309 |
% |
| 310 |
% \maketitle |
| 311 |
% |
| 312 |
% \begin{abstract} |
| 313 |
% This \LaTeX package provides an interface to define and evaluate key-based replacement rules\cite{interface3}. |
| 314 |
% It can be used to parse the argument specification of a document command\cite{xparse}. |
| 315 |
% \end{abstract} |
| 316 |
% |
| 317 |
% \tableofcontents |
| 318 |
% |
| 319 |
% \part{Usage}\label{part:usage} |
| 320 |
% |
| 321 |
% \DocPhantomSection*{section}{\cs{Ccool}}[usage:cs:ccool] |
| 322 |
% \begin{function}{\Ccool} |
| 323 |
% \begin{syntax} |
| 324 |
% \cs{Ccool}\docparo{\meta{\pkgparhe}}\docpard{\meta{\pkgparpa}}\docpare{c}{\meta{\pkgparin}}\Arg{\pkgparkvl}\pkgparap\pkgparex\docpare{s}{\meta{\doccceptsep}}\docpare{c}{\meta{\pkgparou}}\docparo{\meta{\pkgparta}} |
| 325 |
% \end{syntax}where \meta{\doccceptsep} is either of: \Arg{\pkgparsi}, \Arg{\pkgparsi}\Arg{\pkgparsii}, and \Arg{\pkgparsi}\Arg{\pkgparsii}\Arg{\pkgparsiii}. |
| 326 |
% \begin{description} |
| 327 |
% \item[Semantics] See \autoref{ccool:core}-\ref{ccool:wr}. |
| 328 |
% \end{description} |
| 329 |
% \end{function} |
| 330 |
% |
| 331 |
% \subsection{Core feature} |
| 332 |
% \label{ccool:core} |
| 333 |
% \cs{Ccool}\Arg{\pkgparkvl} executes for each \meta{\pkgkey}|=|\meta{\pkgval}, |
| 334 |
% \begin{enumerate}[label=\emph{\arabic*)}] |
| 335 |
% \item \docassign{\meta{\pkgval} } |
| 336 |
% { \cs{function}\Arg{\pkgval} }\label{step:val} |
| 337 |
% \item define \cs{\meta{\pkgkey}} such that \docexpand{ \cs{\meta{\pkgkey} } }{\meta{\pkgval}}, |
| 338 |
% \label{step:key} |
| 339 |
% \end{enumerate}where \cs{function} is encoded in \docccept{\doccceptgopt}~\pkgoptin. |
| 340 |
% For instance, the side effect of |\Ccool{ Real = \mathbb{R} }| is \docexpand{\cs{Real}}{\docarg{\textbackslash{}mathbb\{R\}}}. |
| 341 |
% To be sparingly used, \docccept{\doccceptgopt}~\pkgoptex controls the type of expansion of \meta{\pkgkey}~and \meta{\pkgval}. |
| 342 |
% |
| 343 |
% if \cs{\meta{\pkgkey}} needs arguments, use \cs{lambdax} from \pkg{lambdax} on the rhs. |
| 344 |
% |
| 345 |
% \subsection{Process the \texorpdfstring{\docccept{\pkgval}}{val_i}'s} |
| 346 |
% \label{ccool:in} |
| 347 |
% \cs{Ccool}\ \docpare{c}{\meta{\pkgparin}}\Arg{\pkgparkvl} is identical to the \nameref{ccool:core}, |
| 348 |
% except it overrides \pkgoptin. |
| 349 |
% |
| 350 |
% In our example, if multiple number systems are defined with \cs{Ccool} (natural, reals, \dots), |
| 351 |
% it is more efficient to omit |\mathbb{.}| inside \meta{\pkgval}, and instead |
| 352 |
% use |c{\mathbb{#1}}|, where |#1| means ``parameter to be replaced''. |
| 353 |
% |
| 354 |
% \subsection{Append to a hook} |
| 355 |
% \label{ccool:ap} |
| 356 |
% \cs{Ccool}\Arg{\pkgparkvl}\pkgparap~is identical to the \nameref{ccool:core}, except it |
| 357 |
% repeats after \cs{CcoolHook}. |
| 358 |
% This is useful to make the side effect persist after a \docccept{\doccceptgroup} (such as \env{theorem}). |
| 359 |
% |
| 360 |
% \subsection{Expand the \texorpdfstring{\docccept{\pkgval}}{val_i}'s} |
| 361 |
% \label{ccool:ex} |
| 362 |
% \cs{Ccool}\Arg{\pkgparkvl}\pkgparex~supplements the \nameref{ccool:core} with |
| 363 |
% the expansion of the \meta{\pkgval}'s using typesetting rules encoded in \docccept{\doccceptgopt}~\pkgoptse |
| 364 |
% and~\pkgoptou. The first are \docccept{\doccceptsep} applied to the \meta{\pkgval}'s to form a \docccept{\docccepttl}, |
| 365 |
% and the second a function applied to the latter. |
| 366 |
% |
| 367 |
% They can be overriden inline by appending further \docpare{s}{\meta{\doccceptsep}}~and~\docpare{c}{\meta{\pkgparou}}, respectively, |
| 368 |
% to the list of arguments. |
| 369 |
% |
| 370 |
% \subsection{Head} |
| 371 |
% \label{ccool:he} |
| 372 |
% \cs{Ccool}\docparo{\meta{\pkgparhe}}\Arg{\pkgparkvl}~expands \meta{\pkgparhe} and executes the \nameref{ccool:core}. |
| 373 |
% |
| 374 |
% There may be situations where it is convenient to pass \meta{\pkgparhe}~as \doccceptempty. |
| 375 |
% |
| 376 |
% \subsection{Tail} |
| 377 |
% \label{ccool:ta} |
| 378 |
% \cs{Ccool}\Arg{\pkgparkvl}\docparo{\meta{\pkgparta}}\Arg{\pkgparkvlnxt}~is identical to |
| 379 |
% \cs{Ccool}\Arg{\pkgparkvl} followed by \cs{Ccool}\docparo{\meta{\pkgparta}}\Arg{\pkgparkvlnxt}. |
| 380 |
% |
| 381 |
% The combination of \nameref{ccool:core}, \nameref{ccool:he}, and \nameref{ccool:ta} allows to integrate typesetting and |
| 382 |
% the creation of commands. |
| 383 |
% |
| 384 |
% \subsection{Parameterize the \texorpdfstring{\docccept{\pkgkey}}{key_i}'s} |
| 385 |
% \label{ccool:pa} |
| 386 |
% \cs{Ccool}\docpard{\meta{\pkgparpa}}\Arg{\pkgparkvl} is identical to the \nameref{ccool:core}, |
| 387 |
% except \meta{\pkgkey} is replaced by \meta{\pkgkey\docpard{\pkgparpa}}. |
| 388 |
% The default value of \meta{\pkgparpa} is encoded in \pkgoptpa. |
| 389 |
% In our example, \meta{\pkgparpa} could be \docarg{Style}. |
| 390 |
% |
| 391 |
% \subsection{Write} |
| 392 |
% \label{ccool:wr} |
| 393 |
% \docccept{\doccceptgopt}~\pkgoptwr~is identical to the \nameref{ccool:core}, |
| 394 |
% except that if \pkgoptwr is set to \cs{BooleanTrue}, |
| 395 |
% the code is written to a file whose \doccceptpath~is encoded in \docccept{\doccceptgopt}~\pkgoptfi. |
| 396 |
% |
| 397 |
% \DocPhantomSection*{section}{\cs{CcoolClear}}{usage:cs:clear} |
| 398 |
% \begin{function}{\CcoolClear} |
| 399 |
% \begin{syntax} |
| 400 |
% \cs{CcoolClear}\docpard{\meta{\pkgparpa}}\docparm{\dots\meta{\doccceptkey_i},\dots} |
| 401 |
% \end{syntax} |
| 402 |
% \begin{description} |
| 403 |
% \item[Semantics] Clears all \cs{\meta{\pkgkey\docpard{\pkgparpa}}}'s |
| 404 |
% \end{description} |
| 405 |
% \end{function} |
| 406 |
% |
| 407 |
% \DocPhantomSection*{section}{\cs{CcoolHook}}{usage:cs:hook} |
| 408 |
% \begin{function}{\CcoolHook} |
| 409 |
% \begin{syntax} |
| 410 |
% \cs{CcoolHook} |
| 411 |
% \end{syntax} |
| 412 |
% \begin{description} |
| 413 |
% \item[Semantics] No side effect or expansion |
| 414 |
% \end{description} |
| 415 |
% \end{function} |
| 416 |
% |
| 417 |
% \changes{v3.2} |
| 418 |
% {2021/09/20} |
| 419 |
% {Removed~usage~for\cs[no-index]{CcoolLambda}~as~superseded~by~\cs[no-index]{LambdaX}.} |
| 420 |
% |
| 421 |
% \DocPhantomSection*{section}{\cs{CcoolOption}}{usage:cs:option} |
| 422 |
% \begin{function}{\CcoolOption} |
| 423 |
% \begin{syntax} |
| 424 |
% \cs{CcoolOption}\docparo{\dots{}\docmetakeyorkeyval[i],\dots} |
| 425 |
% \end{syntax}where \meta{\doccceptkey_i} is either of |
| 426 |
% \pkgoptan, |
| 427 |
% \pkgoptex, |
| 428 |
% \pkgoptfi, |
| 429 |
% \pkgoptin, |
| 430 |
% \pkgoptpa, |
| 431 |
% \pkgoptou, |
| 432 |
% \pkgoptse, |
| 433 |
% and \pkgoptwr. |
| 434 |
% \begin{description} |
| 435 |
% \item[Semantics] Modify the default behavior of \cs{Ccool} |
| 436 |
% \end{description} |
| 437 |
% \end{function} |
| 438 |
% |
| 439 |
% \DocPhantomSection*{subsection}{\pkgoptan}{usage:opt:an} |
| 440 |
% \DescribeOption{\pkgoptan} |
| 441 |
% \begin{description} |
| 442 |
% \item[Semantics] Sets the translation of \textit{and} in language \meta{\doccceptkey} to \meta{\doccceptval} |
| 443 |
% \item[Syntax] \meta{\doccceptkvl} |
| 444 |
% \end{description} |
| 445 |
% |
| 446 |
% \DocPhantomSection*{subsection}{\pkgoptex}{usage:opt:ex} |
| 447 |
% \DescribeOption{\pkgoptex} |
| 448 |
% \begin{description} |
| 449 |
% \item[Syntax] \texttt{eo\docpipe{}ee\docpipe{}ex\docpipe{}xo\docpipe{}xe\docpipe{}xx} |
| 450 |
% \end{description} |
| 451 |
% |
| 452 |
% \DocPhantomSection*{subsection}{\pkgoptfi}{usage:opt:fi} |
| 453 |
% \DescribeOption{\pkgoptfi} |
| 454 |
% \begin{description} |
| 455 |
% \item[Syntax] \meta{\doccceptpath} |
| 456 |
% \end{description} |
| 457 |
% |
| 458 |
% \DocPhantomSection*{subsection}{\pkgoptin}{usage:opt:in} |
| 459 |
% \DescribeOption{\pkgoptin} |
| 460 |
% \begin{description} |
| 461 |
% \item[Syntax] \meta{\doccceptcode}, with |####1| as the \docccept{\doccceptplaceh} |
| 462 |
% \end{description} |
| 463 |
% |
| 464 |
% \DocPhantomSection*{subsection}{\pkgoptpa}{usage:opt:pa} |
| 465 |
% \DescribeOption{\pkgoptpa} |
| 466 |
% \begin{description} |
| 467 |
% \item[Syntax] \meta{\docccepttl} |
| 468 |
% \end{description} |
| 469 |
% |
| 470 |
% \DocPhantomSection*{subsection}{\pkgoptou}{usage:opt:ou} |
| 471 |
% \DescribeOption{\pkgoptou} |
| 472 |
% \begin{description} |
| 473 |
% \item[Default] |\ensuremath{####1}| |
| 474 |
% \item[Syntax] \meta{\doccceptcode}, with |####1| as the \docccept{\doccceptplaceh} |
| 475 |
% \end{description} |
| 476 |
% |
| 477 |
% \DocPhantomSection*{subsection}{\pkgoptse}{usage:opt:se} |
| 478 |
% \DescribeOption{\pkgoptse} |
| 479 |
% \begin{description} |
| 480 |
% \item[Other] Default behavior depends on whether \pkg{babel} and \pkg{amsmath} are loaded |
| 481 |
% \item[Syntax] That of \docccept{\doccceptsep} in \cite[Section 8 of \pkg{l3seq}]{interface3} |
| 482 |
% \end{description} |
| 483 |
% |
| 484 |
% \DocPhantomSection*{subsection}{\pkgoptwr}{usage:opt:wr} |
| 485 |
% \DescribeOption{\pkgoptwr} |
| 486 |
% \begin{description} |
| 487 |
% \item[Syntax] \cs{BooleanFalse}\docpipe\cs{BooleanTrue} |
| 488 |
% \end{description} |
| 489 |
% |
| 490 |
% \DocPhantomSection*{section}{\cs{CcoolRead}}{usage:cs:read} |
| 491 |
% \begin{function}{\CcoolRead} |
| 492 |
% \begin{syntax} |
| 493 |
% \cs{CcoolRead}\docparo{\meta{\doccceptpath}} |
| 494 |
% \end{syntax} |
| 495 |
% \begin{description} |
| 496 |
% \item[Semantics]\docfillblank |
| 497 |
% \begin{enumerate} |
| 498 |
% \item Reads the definitions in \meta{\doccceptpath}. |
| 499 |
% \item Writes to \file{ccool.log}: `read from \meta{\doccceptpath}' |
| 500 |
% \end{enumerate} |
| 501 |
% \end{description} |
| 502 |
% \end{function} |
| 503 |
% |
| 504 |
% \DocPhantomSection*{section}{\cs{CcoolVers}}{usage:cs:vers} |
| 505 |
% \begin{function}{\CcoolVers} |
| 506 |
% \begin{syntax} |
| 507 |
% \cs{CcoolVers} |
| 508 |
% \end{syntax} |
| 509 |
% \begin{description} |
| 510 |
% \item[Semantics] \docexpand{}{the package's version} |
| 511 |
% \end{description} |
| 512 |
% \end{function} |
| 513 |
% \part{Other} |
| 514 |
% |
| 515 |
% \section{Bibliograhy} |
| 516 |
% \printbibliography[heading=none] |
| 517 |
% |
| 518 |
% \section{Do's and dont's} |
| 519 |
% \label{usage:dosdont} |
| 520 |
% |
| 521 |
% \begin{enumerate} |
| 522 |
% \item \docfillblank |
| 523 |
% \begin{itemize} |
| 524 |
% \item[\docissuedont] |Inner=\{####1\}| |
| 525 |
% \item[\docissuesymp] \cs{CcoolRead} fails |
| 526 |
% \item[\docissuedo] |Inner={\char`{####1\char`}}| |
| 527 |
% \end{itemize} |
| 528 |
% \item \docfillblank |
| 529 |
% \begin{itemize} |
| 530 |
% \item[\docissuedont] |$|\meta{\pkgkey}|<x$|. |
| 531 |
% \item[\docissuedo] |$|\cs{\meta{\pkgkey}}|{<}x$| |
| 532 |
% \end{itemize} |
| 533 |
% \item\docfillblank |
| 534 |
% \begin{itemize} |
| 535 |
% \item[\docissuedont] |[a, b)| |
| 536 |
% \item[\docissuedo] |{[}a, b{)}| |
| 537 |
% \end{itemize} |
| 538 |
% \item \docfillblank |
| 539 |
% \begin{itemize} |
| 540 |
% \item[\docissuedont] |\cal F|. |
| 541 |
% \item[\docissuedo] |\cal{F}| or |\mathcal{F}| |
| 542 |
% \end{itemize} |
| 543 |
% \item \docfillblank |
| 544 |
% \begin{itemize} |
| 545 |
% \item[\docissuedont] |\[x_0,x\]| |
| 546 |
% \item[\docissuedo] |\left[x_0,x\right]| |
| 547 |
% \end{itemize} |
| 548 |
%^^A \item \docfillblank |
| 549 |
%^^A \begin{itemize} |
| 550 |
%^^A \item[\docissuedont] Use \docccept{\docxparsed[]} or \docccept{\docxparsee[]}~arguments\cite{xparse} for \nameref{usage:cs:lambda} |
| 551 |
%^^A \item[\docissuedo] Use only \docccept{\docxparsem[]} and \docccept{\docxparseo[]}~arguments |
| 552 |
%^^A \end{itemize} |
| 553 |
% \item \docfillblank |
| 554 |
% \begin{itemize} |
| 555 |
% \item[\docissuedont] |\usepackage[spanish]{babel}| |
| 556 |
% \item[\docissuedo] |\usepackage[spanish.noquoting]{babel}|\cite{a-547018} |
| 557 |
% \end{itemize} |
| 558 |
% \end{enumerate} |
| 559 |
% |
| 560 |
% \section{To do} |
| 561 |
% \begin{enumerate} |
| 562 |
% \item Create an environment for \cs{CoolHook}. |
| 563 |
% \end{enumerate} |
| 564 |
% |
| 565 |
% \section{Support}\label{other:support} |
| 566 |
% |
| 567 |
% This package is available from \url{https://github.com/rogard/ccool}. |
| 568 |
% |
| 569 |
% |
| 570 |
% \changes{v1.0} |
| 571 |
% {2020/03/08} |
| 572 |
% {Initial version} |
| 573 |
% \changes{v1.1} |
| 574 |
% {2020/04/04} |
| 575 |
% {Rearrange: much of the implementation} |
| 576 |
% \changes{v1.1} |
| 577 |
% {2020/04/04} |
| 578 |
% {Replace: \Arg{kvl_{2}}~by~\docpard{\meta{kvl_{2}}}~given that option type \texttt{G} not recommended\cite{xparse}} |
| 579 |
% \changes{v1.1} |
| 580 |
% {2020/04/04} |
| 581 |
% {Replace: \cs[no-index]{OopsOptions}~by~\cs[no-index]{OopsOption}} |
| 582 |
% \changes{v1.1} |
| 583 |
% {2020/04/04} |
| 584 |
% {Replace: \docarg{GenericObject}~by~\docarg{Name}} |
| 585 |
% \changes{v1.1} |
| 586 |
% {2020/04/04} |
| 587 |
% {Replace: \docarg{Separators}~by~\docarg{Separ}} |
| 588 |
% \changes{v1.1} |
| 589 |
% {2020/04/04} |
| 590 |
% {Add:\cs[no-index]{OopsTest}} |
| 591 |
% \changes{v1.1} |
| 592 |
% {2020/04/04} |
| 593 |
% {Add:\cs[no-index]{OopsRestore}} |
| 594 |
% \changes{v1.1} |
| 595 |
% {2020/04/04} |
| 596 |
% {Add: \docarg{Save}} |
| 597 |
% \changes{v1.2} |
| 598 |
% {2020/04/06} |
| 599 |
% {Add: optional \pkgparex to \cs[no-index]{OopsNew} as instruction to expand \pkgparkvl} |
| 600 |
% \changes{v1.2} |
| 601 |
% {2020/04/06} |
| 602 |
% {Replace: \cs[no-index]{OopsClear}\Arg{\pkgparpa} by \cs[no-index]{OopsClear}\docparo{\meta{\doccceptkvl}}} |
| 603 |
% \changes{v1.2} |
| 604 |
% {2020/04/06} |
| 605 |
% {Delete: \meta{kvl_{2}}~and~\meta{code_{2}}} |
| 606 |
% \changes{v1.2} |
| 607 |
% {2020/04/06} |
| 608 |
% {Delete: \cs[no-index]{OopsTest}} |
| 609 |
% \changes{v1.2} |
| 610 |
% {2020/04/06} |
| 611 |
% {Replace: \cs[no-index]{Save} by \cs[no-index]{Write}} |
| 612 |
% \changes{v1.2} |
| 613 |
% {2020/04/06} |
| 614 |
% {Replace: \cs[no-index]{Restore} by \cs[no-index]{Read}} |
| 615 |
% \changes{v1.3} |
| 616 |
% {2020/04/06} |
| 617 |
% {Replace: \cs[no-index]{OopsNew} by \cs[no-index]{Oops}} |
| 618 |
% \changes{v1.3} |
| 619 |
% {2020/04/06} |
| 620 |
% {Replace: \Arg{\pkgparpa} and \docparo{\meta{\pkgparpa}} by \docpard{\meta{\pkgparpa}} } |
| 621 |
% \changes{v1.4} |
| 622 |
% {2020/04/10} |
| 623 |
% {Replace: \docpare{s}{\Arg{\pkgparsi}\Arg{\pkgparsii}\Arg{\pkgparsiii}} |
| 624 |
% by \docpare{s}{\Arg{\pkgparsi}\docpipe\Arg{\pkgparsi}\Arg{\pkgparsii}\docpipe\Arg{\pkgparsi}\Arg{\pkgparsii}\Arg{\pkgparsiii}}} |
| 625 |
% \changes{v1.4} |
| 626 |
% {2020/04/10} |
| 627 |
% {Add:optional \pkgparap to \cs[no-index]{OopsNew} to make side effects presist beyond local group} |
| 628 |
% \changes{v1.4} |
| 629 |
% {2020/04/10} |
| 630 |
% {Add: \cs[no-index]{OopsHook}} |
| 631 |
% \changes{v1.4} |
| 632 |
% {2020/04/10} |
| 633 |
% {Add: \docarg{Expans} (for debugging' sake, but...) } |
| 634 |
% \changes{v1.4} |
| 635 |
% {2020/04/10} |
| 636 |
% {Add: \autoref{usage:dosdont} } |
| 637 |
% \changes{v1.4} |
| 638 |
% {2020/04/10} |
| 639 |
% {Add: \cs[no-index]{OopsDebug} } |
| 640 |
% \changes{v1.5} |
| 641 |
% {2020/04/10} |
| 642 |
% {Delete: dependence on \pkg{datetime} } |
| 643 |
% \changes{v1.5} |
| 644 |
% {2020/04/10} |
| 645 |
% {Add: \pkgoptfi } |
| 646 |
% \changes{v1.6} |
| 647 |
% {2020/04/10} |
| 648 |
% {Rename: \pkg{oops} to \pkg{ccool} (better describes the purpose) } |
| 649 |
% \changes{v1.6} |
| 650 |
% {2020/04/10} |
| 651 |
% {Rename: \cs[no-index]{Oops} to \cs[no-index]{Ccool}} |
| 652 |
% \changes{v1.6} |
| 653 |
% {2020/04/10} |
| 654 |
% {Rename: \cs[no-index]{OopsClear} to \cs[no-index]{CcoolClear}} |
| 655 |
% \changes{v1.6} |
| 656 |
% {2020/04/10} |
| 657 |
% {Rename: \cs[no-index]{OopsDebug} to \cs[no-index]{CcoolDebug}} |
| 658 |
% \changes{v1.6} |
| 659 |
% {2020/04/10} |
| 660 |
% {Rename: \cs[no-index]{OopsHook} to \cs[no-index]{CcoolHook}} |
| 661 |
% \changes{v1.6} |
| 662 |
% {2020/04/10} |
| 663 |
% {Rename: \cs[no-index]{OopsOption} to \cs[no-index]{CcoolOption}} |
| 664 |
% \changes{v1.6} |
| 665 |
% {2020/04/10} |
| 666 |
% {Rename: \cs[no-index]{OopsRead} to \cs[no-index]{CcoolRead}} |
| 667 |
% \changes{v1.7} |
| 668 |
% {2020/04/11} |
| 669 |
% {Delete: \cs[no-index]{CcoolDebug} } |
| 670 |
% \changes{v1.8} |
| 671 |
% {2020/04/12} |
| 672 |
% {Add: \hyperref[usage:cs:lambda]{\cs[no-index]{CcoolLambda}} } |
| 673 |
% \changes{v1.8} |
| 674 |
% {2020/04/12} |
| 675 |
% {Add: \cs[no-index]{CcoolVers} } |
| 676 |
% \changes{v1.9} |
| 677 |
% {2020/04/14} |
| 678 |
% {Add: support for \LuaTeX } |
| 679 |
% \changes{v1.9} |
| 680 |
% {2020/04/14} |
| 681 |
% {Move: from \autoref{part:usage} to \autoref{part:impl}, what is now that part's \autoref{impl:frontend}} |
| 682 |
% \changes{v2.0} |
| 683 |
% {2020/04/15} |
| 684 |
% {Delete: \pkgoptfi's dependency on \pkg{texosquery} and \cs[no-index]{pdfcreationdate}} |
| 685 |
% \changes{v2.0} |
| 686 |
% {2020/04/15} |
| 687 |
% {Add: support for \XeTeX} |
| 688 |
% \changes{v2.0} |
| 689 |
% {2020/04/15} |
| 690 |
% {Update: \cs[no-index]{RequirePackage}, \cs[no-index]{NeedsTeXFormat}'s second argument / TeX Live 2020} |
| 691 |
% \changes{v2.1} |
| 692 |
% {2020/04/17} |
| 693 |
% {Replace: \hyperref[usage:cs:lambda]{\cs[no-index]{CcoolLambda}}'s optional integer argument (number of \texttt{m}'s) |
| 694 |
% by a standard argument list} |
| 695 |
% \changes{v2.1} |
| 696 |
% {2020/04/17} |
| 697 |
% {Replace: \hyperref[ccool:pa]{\meta{\pkgparpa}}'s position within \cs[no-index]{Ccool}'s argument list, from first to second. Greater versatility } |
| 698 |
% \changes{v2.1} |
| 699 |
% {2020/04/17} |
| 700 |
% {Replace: as~the~default~of~\pkgoptpa,~\docarg{Math}~by~\pkgoptpad} |
| 701 |
% \changes{v2.1} |
| 702 |
% {2020/04/17} |
| 703 |
% {Replace: \docccept{\doccceptgopt}~\docarg{Name} by \pkgoptpa } |
| 704 |
% \changes{v2.2} |
| 705 |
% {2020/04/20} |
| 706 |
% {Replace: part of the abstract's with more straighforward descriptions based on input from forum participtants} |
| 707 |
% \changes{v2.3} |
| 708 |
% {2020/05/16} |
| 709 |
% {Replace: for \cs[no-index]{Ccool}, \docpare{i}{} by \docpare{c}{}} |
| 710 |
% \changes{v2.3} |
| 711 |
% {2020/05/16} |
| 712 |
% {Rearranged: \cs{Ccool}'s subsections. Previously, by argument. Now, by feature. } |
| 713 |
% \changes{v2.3} |
| 714 |
% {2020/05/16} |
| 715 |
% {Replace: In \docstep{key}, the created command's implementation, from \cs[no-index]{ProvideDocumentCommand} to \cs[no-index]{DeclareDocumentCommand}} |
| 716 |
% \changes{v2.5} |
| 717 |
% {2020/05/21} |
| 718 |
% {Modify: behavior of \autoref{part:usage}~\nameref{ccool:ex}, rely on \pkg{erw-l3}'s \cs[no-index]{erw_seq_use:Nn} } |
| 719 |
% \changes{v2.5} |
| 720 |
% {2020/05/21} |
| 721 |
% {Modify: Rely on \pkg{erw-l3}'s \cs[no-index]{erw_jobnametimestamp:} } |
| 722 |
% \changes{v2.6} |
| 723 |
% {2020/05/22} |
| 724 |
% {Modify: Rely on \pkg{erw-l3}'s \cs[no-index]{erw_lambda:nnn} } |
| 725 |
% \changes{v2.7} |
| 726 |
% {2020/05/28} |
| 727 |
% {Add: \docccept{\doccceptgopt}~\pkgoptan } |
| 728 |
% \changes{v2.7} |
| 729 |
% {2020/05/28} |
| 730 |
% {Modify: \pkgoptse's default rely on \pkg{babel} and \pkg{amsmath}, if applicable} |
| 731 |
% \changes{v2.7} |
| 732 |
% {2020/05/28} |
| 733 |
% {Modify: Replace \docxparsem by \docxparseo} |
| 734 |
% \changes{v2.8} |
| 735 |
% {2020/05/28} |
| 736 |
% {Fix: conflict between \cs[no-index]{usepackage}\docparo{spanish}\docparm{babel} and \nameref{ccool:pa} } |
| 737 |
% \changes{v2.9} |
| 738 |
% {2020/06/03} |
| 739 |
% {Miscellaneous } |
| 740 |
% \changes{v3.0} |
| 741 |
% {2020/06/04} |
| 742 |
% {Miscellaneous } |
| 743 |
% \changes{v3.1} |
| 744 |
% {2020/10/10} |
| 745 |
% {Replaced: \doclist{thisdeps}'s content, from exhaustive dependencies to those explicit with \cs[no-index]{usepackage}} |
| 746 |
% \changes{v3.2} |
| 747 |
% {2021/09/20} |
| 748 |
% {Removed~listing~changes~(little~information,~difficult~to~keep~track)} |
| 749 |
% |
| 750 |
% \clearpage |
| 751 |
% \part{Listing}\label{part:listing} |
| 752 |
% |
| 753 |
%\phantomsection\addcontentsline{toc}{section}{Tutorial\textgreater} |
| 754 |
%\phantomsection\addcontentsline{toc}{section}{\ref{listing:numbrsys:base}. Let~\texorpdfstring{$\mathbb{N}$}{N} and \texorpdfstring{$\mathbb{R}$}{R} denote\dots} |
| 755 |
% \iffalse |
| 756 |
%<*guardlisting> |
| 757 |
% \fi |
| 758 |
\begin{listing}[``Let~$\mathbb{N}$ and $\mathbb{R}$ denote\dots''] |
| 759 |
{label=listing:numbrsys:base, listing and text} |
| 760 |
Let~$\mathbb{N}$ and $\mathbb{R}$ denote the natural and real numbers. |
| 761 |
\end{listing} |
| 762 |
% \iffalse |
| 763 |
%</guardlisting> |
| 764 |
% \fi |
| 765 |
% |
| 766 |
% \phantomsection\addcontentsline{toc}{section} |
| 767 |
% {\ref{listing:numbrsys:cmd}. Same as \ref{listing:numbrsys:base}, with \cs{NewDocumentCommand}} |
| 768 |
% \iffalse |
| 769 |
%<*guardlisting> |
| 770 |
% \fi |
| 771 |
\begin{listing}[ Same as \ref{listing:numbrsys:base}, with \cs{NewDocumentCommand}] |
| 772 |
{label=listing:numbrsys:cmd, listing and text} |
| 773 |
\DeclareDocumentCommand\Nat{}{\mathbb{N}} |
| 774 |
\DeclareDocumentCommand\Real{}{\mathbb{R}} |
| 775 |
Let~$\Nat$ and $\Real$ denote the natural and real numbers. |
| 776 |
\end{listing} |
| 777 |
% \iffalse |
| 778 |
%</guardlisting> |
| 779 |
% \fi |
| 780 |
% |
| 781 |
% \phantomsection\addcontentsline{toc}{section} |
| 782 |
% {\ref{listing:numbrsys:in}. Same as \ref{listing:numbrsys:cmd}, with \cs{Ccool}} |
| 783 |
% \iffalse |
| 784 |
%<*guardlisting> |
| 785 |
% \fi |
| 786 |
\begin{listing}[ Same as \ref{listing:numbrsys:cmd}, with \cs{Ccool} ] |
| 787 |
{label=listing:numbrsys:in, listing and text} |
| 788 |
\begingroup |
| 789 |
\Ccool c{\mathbb{#1}}{ Nat = {N}, Real = {R} } |
| 790 |
Let~$\Nat$ and $\Real$~denote the natural and real numbers. |
| 791 |
\endgroup |
| 792 |
\end{listing} |
| 793 |
% \iffalse |
| 794 |
%</guardlisting> |
| 795 |
% \fi |
| 796 |
% |
| 797 |
% \phantomsection\addcontentsline{toc}{section} |
| 798 |
% {\ref{listing:numbrsys:ex}. Same as \ref{listing:numbrsys:in}, with expansion} |
| 799 |
% \iffalse |
| 800 |
%<*guardlisting> |
| 801 |
\fi |
| 802 |
\begin{listing}[ Same as \ref{listing:numbrsys:in}, with expansion] |
| 803 |
{label=listing:numbrsys:ex, listing and text} |
| 804 |
\begingroup |
| 805 |
\Ccool[Let~] |
| 806 |
c{\mathbb{#1}}{ Nat = {N}, Real = {R} }* |
| 807 |
[~denote the natural and real numbers.]{} |
| 808 |
\endgroup |
| 809 |
\end{listing} |
| 810 |
% \iffalse |
| 811 |
%</guardlisting> |
| 812 |
% \fi |
| 813 |
% |
| 814 |
% \changes{v3.2} |
| 815 |
% {2021/09/20} |
| 816 |
% {\cs[no-index]{begingroup}~and~\cs[no-index]{endgroup}~inside~listings.} |
| 817 |
% |
| 818 |
% \phantomsection\addcontentsline{toc}{section} |
| 819 |
% {\ref{listing:numbrsys:pa}. Same as \ref{listing:numbrsys:in}, parameterized} |
| 820 |
% \iffalse |
| 821 |
%<*guardlisting> |
| 822 |
% \fi |
| 823 |
\begin{listing}[ Same as \ref{listing:numbrsys:in}, parameterized] |
| 824 |
{label=listing:numbrsys:pa, listing and text} |
| 825 |
\begingroup |
| 826 |
\Ccool<foo>c{\mathbb{#1}}{ Nat = {N}, Real = {R} } |
| 827 |
[Let $\Nat<foo>$ and $\Real<foo>$ denote the natural and real numbers.]{} |
| 828 |
\endgroup |
| 829 |
\end{listing} |
| 830 |
% \iffalse |
| 831 |
%</guardlisting> |
| 832 |
% \fi |
| 833 |
% \phantomsection\addcontentsline{toc}{section}{\textless} |
| 834 |
% |
| 835 |
% \changes{v3.2} |
| 836 |
% {2021/09/20} |
| 837 |
% {\cs[no-index]{texorpdfstring}~was~used~with~one~argument~instead~of~two~in~listing~titles,~so~removed~it.} |
| 838 |
% |
| 839 |
% \phantomsection\addcontentsline{toc}{section}{\ref{listing:mvt:i}. Mittelwertsatz f\"ur \texorpdfstring{$n$}{n} Variable. } |
| 840 |
% \iffalse |
| 841 |
%<*guardlisting> |
| 842 |
% \fi |
| 843 |
\begin{listing}[{Mittelwertsatz f\"ur $n$ Variable\cite[17.3]{tcolorbox}}] |
| 844 |
{label=listing:mvt:i} |
| 845 |
\begingroup |
| 846 |
\CcoolOption[ Write = \BooleanTrue ] |
| 847 |
\selectlanguage{german} |
| 848 |
\newtheorem{theorem}{Theorem} |
| 849 |
\AfterEndEnvironment{theorem}{\CcoolHook} |
| 850 |
\Ccool c{\mathbb{#1}} |
| 851 |
{ N = { N } , R = { R } }+[] |
| 852 |
{ Grad = { \operatorname{grad} } }+ |
| 853 |
[\begin{theorem} |
| 854 |
[Mittelwertsatz f\"ur $n$ Variable]Es~sei~] |
| 855 |
{ OffMenge = {D}, Ci = {C^{1}}, Strecke = { \left[x_0,x\right] } }+ |
| 856 |
[$n\in\N$,~$\OffMenge\subseteq\N^n$ eine offene Menge und $f\in\Ci(\OffMenge,\R)$. |
| 857 |
Dann gibt es auf jeder Strecke $\Strecke\subset\OffMenge$ einen Punkt $\xi\in\Strecke$,~] |
| 858 |
{ Steig = { \frac{ f(x)-f(x_0) }{ x-x_0 } }, Punkt = { \xi } }+ |
| 859 |
[so dass gilt |
| 860 |
\begin{equation*} |
| 861 |
\Steig = \Grad f(\Punkt)^{\top} |
| 862 |
\end{equation*} |
| 863 |
\end{theorem}] |
| 864 |
{} |
| 865 |
(Check: $\N$, $\Punkt$) |
| 866 |
\endgroup |
| 867 |
\CcoolOption |
| 868 |
\end{listing} |
| 869 |
% \iffalse |
| 870 |
%</guardlisting> |
| 871 |
% \fi |
| 872 |
% |
| 873 |
% \phantomsection\addcontentsline{toc}{section}{\ref{listing:mvt:ii}. Listing~\ref{listing:mvt:i} read from file} |
| 874 |
% \iffalse |
| 875 |
%<*guardlisting> |
| 876 |
% \fi |
| 877 |
\begin{listing}[Listing~\ref{listing:mvt:i} read from file] |
| 878 |
{label=listing:mvt:ii} |
| 879 |
\CcoolRead ~$\N$ $\R$ $\OffMenge$ $\Ci$ $\Strecke$ |
| 880 |
\CcoolClear |
| 881 |
\end{listing} |
| 882 |
% \iffalse |
| 883 |
%</guardlisting> |
| 884 |
% \fi |
| 885 |
% |
| 886 |
% \changes{v3.2} |
| 887 |
% {2021/09/20} |
| 888 |
% {Removed~listing~`Hello, world! (for testing's sake)'.~That~should~be~for~l3build} |
| 889 |
% |
| 890 |
% \phantomsection\addcontentsline{toc}{section}{\ref{listing:proba:i}. Probability space} |
| 891 |
% \iffalse |
| 892 |
%<*guardlisting> |
| 893 |
% \fi |
| 894 |
\begin{listing}[Probability space] |
| 895 |
{label=listing:proba:i} |
| 896 |
\begingroup |
| 897 |
\Ccool[Let~] |
| 898 |
{ Space = \Omega, Field = \mathcal{F}, Meas = \mathcal{P} } |
| 899 |
*s{{,}}c{$\{#1\}$} |
| 900 |
[~denote the probability space, where~]{ PowerSet = { 2^{\Space} } } |
| 901 |
[$\Field\subset \PowerSet$.] |
| 902 |
{} |
| 903 |
\endgroup |
| 904 |
\end{listing} |
| 905 |
% \iffalse |
| 906 |
%</guardlisting> |
| 907 |
% \fi |
| 908 |
% |
| 909 |
% \changes{v3.2} |
| 910 |
% {2021/09/20} |
| 911 |
% {Updated~listings~with~\cs{LambdaX}~in~place~of~\cs{CcoolLambda}} |
| 912 |
% |
| 913 |
% \phantomsection\addcontentsline{toc}{section}{\ref{listing:poly:real:i}. Families of polynomial functions} |
| 914 |
% \iffalse |
| 915 |
%<*guardlisting> |
| 916 |
% \fi |
| 917 |
\begin{listing}[Families of polynomial functions] |
| 918 |
{label=listing:poly:real:i} |
| 919 |
\CcoolOption[ Write = \BooleanTrue ] |
| 920 |
\Ccool c{\mathbb{#1}}{ Nat = {N}, Real = {R} } |
| 921 |
[Let~] |
| 922 |
{ PolyR = \LambdaX[o]{\Real\IfValueT{#1}{_#1}[X] } } |
| 923 |
[$\PolyR[n]$ and $\PolyR$, denote the families of polynomial functions on $\Real$, of order $n$ et and their union over $n \in \Nat$, respectively. ] |
| 924 |
{} |
| 925 |
\CcoolClear |
| 926 |
\CcoolOption |
| 927 |
\end{listing} |
| 928 |
% \iffalse |
| 929 |
%</guardlisting> |
| 930 |
% \fi |
| 931 |
% |
| 932 |
% \phantomsection\addcontentsline{toc}{section}{\ref{listing:poly:real:ii}. Listing~\ref{listing:poly:real:i} read from file} |
| 933 |
% \iffalse |
| 934 |
%<*guardlisting> |
| 935 |
% \fi |
| 936 |
\begin{listing}[\ref{listing:poly:real:i} read from file] |
| 937 |
{label=listing:poly:real:ii} |
| 938 |
\begingroup |
| 939 |
\CcoolRead $\PolyR[n]$ et $\PolyR$ |
| 940 |
\endgroup |
| 941 |
\end{listing} |
| 942 |
% \iffalse |
| 943 |
%</guardlisting> |
| 944 |
% \fi |
| 945 |
% |
| 946 |
% \changes{v3.2} |
| 947 |
% {2021/09/20} |
| 948 |
% {Updated~listing~`Fonction~et~fonctionelle',~with~use~of~parameter} |
| 949 |
% \iffalse |
| 950 |
%<*guardlisting> |
| 951 |
% \fi |
| 952 |
\begin{listing}[Fonction et fonctionelle] |
| 953 |
{label=listing:fonc:i} |
| 954 |
\CcoolOption[ Write = \BooleanTrue ] |
| 955 |
\selectlanguage{french} |
| 956 |
\Ccool<eval>{ fun = \LambdaX{(#1)} }[]<op>{ fun = \LambdaX[mm]{#1[#2]} } |
| 957 |
[Supposons une fonction $f\fun<eval>{t}$, et \'etudions le probl\`eme o\`u la fonctionnelle $\fun<op>{S}{f}$ est donn\'ee par\dots]{} |
| 958 |
\CcoolClear |
| 959 |
\CcoolOption |
| 960 |
\end{listing} |
| 961 |
% \iffalse |
| 962 |
%</guardlisting> |
| 963 |
% \fi |
| 964 |
% |
| 965 |
% \phantomsection\addcontentsline{toc}{section}{\ref{listing:fonc:ii}. Listing~\ref{listing:fonc:i} read from file} |
| 966 |
% \iffalse |
| 967 |
%<*guardlisting> |
| 968 |
% \fi |
| 969 |
\begin{listing}[\ref{listing:fonc:i} read from file] |
| 970 |
{label=listing:fonc:ii} |
| 971 |
\CcoolRead $\fun<eval>{t}$, $\fun<op>{S}{f}$ |
| 972 |
\CcoolClear |
| 973 |
\end{listing} |
| 974 |
% \iffalse |
| 975 |
%</guardlisting> |
| 976 |
% \fi |
| 977 |
% |
| 978 |
% \phantomsection\addcontentsline{toc}{section}{\ref{listing:cusum:i}. CUSUM statistic.} |
| 979 |
% \iffalse |
| 980 |
%<*guardlisting> |
| 981 |
% \fi |
| 982 |
\begin{listing}[CUSUM statistic\cite{oh-2005}] |
| 983 |
{label=listing:cusum:i} |
| 984 |
\begingroup |
| 985 |
\CcoolOption[ Write = \BooleanTrue ] |
| 986 |
\newtheorem{definition}{Definition} |
| 987 |
\AfterEndEnvironment{definition}{\CcoolHook} |
| 988 |
\Ccool{ |
| 989 |
SuchThat = { ;~ }, |
| 990 |
Time = { t }, |
| 991 |
Process = { \xi }, |
| 992 |
StopT = { T }, |
| 993 |
EvalAt = \LambdaX{(#1)} |
| 994 |
} |
| 995 |
[The CUSUM statistic process and the corresponding one-sided CUSUM stopping time are defined as follows: |
| 996 |
\begin{definition}\label{the CUSUM statistic}. Let~] |
| 997 |
{ |
| 998 |
Scale = { \lambda }, |
| 999 |
Real = {\mathcal{R}} |
| 1000 |
}+*s{{~\in~}} |
| 1001 |
[~and~] |
| 1002 |
{ CUSUMthresh = { \nu } }+*c{$#1\in\Real^{+}$.} |
| 1003 |
[~Define the following processes:] |
| 1004 |
{ |
| 1005 |
LogWald = { u }, |
| 1006 |
CUSUMst = { \StopT_{c} }, |
| 1007 |
CUSUM = { y }, |
| 1008 |
LogWaldInf = { m } |
| 1009 |
}+ |
| 1010 |
[\begin{enumerate} |
| 1011 |
\item{ |
| 1012 |
$\LogWald_{\Time}\EvalAt{ \Scale } = \Scale\Process_{\Time} - \frac{1}{2}\Scale^2\Time$; |
| 1013 |
$\LogWaldInf_{\Time}\EvalAt{ \Scale } = \inf_{ 0\le s \le \Time }\CUSUM_{s} \EvalAt{ \Scale }$. |
| 1014 |
} |
| 1015 |
\item{ |
| 1016 |
$\CUSUM_{\Time}\EvalAt{ \Scale } = \LogWaldInf_{\Time}\EvalAt{ \Scale } - \LogWald_{\Time}\EvalAt{ \Scale }\ge0$, |
| 1017 |
which is the CUSUM statistic process. |
| 1018 |
} |
| 1019 |
\item{ |
| 1020 |
$\CUSUMst \EvalAt{ \Scale, \LogWaldInf } = \inf\left[ \Time \ge 0 \SuchThat \CUSUM_{\Time}\EvalAt{\Scale} \ge \LogWaldInf \right]$, |
| 1021 |
which is the CUSUM stopping time. |
| 1022 |
} |
| 1023 |
\end{enumerate} |
| 1024 |
\end{definition}\par]{} |
| 1025 |
|
| 1026 |
(Check: $\Scale$, $\CUSUM$) |
| 1027 |
\endgroup |
| 1028 |
\CcoolOption |
| 1029 |
% \end{listing} |
| 1030 |
% \iffalse |
| 1031 |
%</guardlisting> |
| 1032 |
% \fi |
| 1033 |
% |
| 1034 |
% \phantomsection\addcontentsline{toc}{section}{\ref{listing:cusum:ii}. Listing~\ref{listing:cusum:i} read from file} |
| 1035 |
% \iffalse |
| 1036 |
%<*guardlisting> |
| 1037 |
% \fi |
| 1038 |
\begin{listing}[Listing~\ref{listing:cusum:i} read from file] |
| 1039 |
{label=listing:cusum:ii} |
| 1040 |
\begingroup |
| 1041 |
\CcoolRead $\Time$ $\Process$ $\Scale$ $\Real$ $\CUSUMthresh$ $\LogWald$ $\CUSUMst$ $\CUSUM$ $\LogWaldInf$ |
| 1042 |
\endgroup |
| 1043 |
\end{listing} |
| 1044 |
% \iffalse |
| 1045 |
%</guardlisting> |
| 1046 |
% \fi |
| 1047 |
% |
| 1048 |
% \StopEventually{ |
| 1049 |
% \clearpage |
| 1050 |
% \PrintChanges |
| 1051 |
% \PrintIndex %^^A https://tex.stackexchange.com/q/610349/112708 |
| 1052 |
% } |
| 1053 |
% |
| 1054 |
%\end{documentation} |
| 1055 |
% \begin{implementation} |
| 1056 |
% \part{Implementation}\label{part:impl} |
| 1057 |
% \section{Opening} |
| 1058 |
% \begin{macrocode} |
| 1059 |
%<*package> |
| 1060 |
%<@@=ccool> |
| 1061 |
\ExplSyntaxOn |
| 1062 |
% \end{macrocode} |
| 1063 |
% \changes{v3.2} |
| 1064 |
% {2021/09/20} |
| 1065 |
% {Removed~dependence~on~\pkg{erw-l3}.} |
| 1066 |
% \changes{v3.2} |
| 1067 |
% {2021/09/20} |
| 1068 |
% {Added~dependence~on~\pkg{lambdax}.} |
| 1069 |
% |
| 1070 |
% \section{\textsf{aux}} |
| 1071 |
% \begin{macro}{\@@_aux_inner_set:n} |
| 1072 |
% \begin{arguments} |
| 1073 |
% \item \meta{code} |
| 1074 |
% \end{arguments} |
| 1075 |
% \begin{macrocode} |
| 1076 |
\cs_new_protected:Nn \@@_aux_inner_set:n |
| 1077 |
{ |
| 1078 |
\cs_gset:Npn \@@_aux_inner:n ##1 {#1} |
| 1079 |
\cs_generate_variant:Nn \@@_aux_inner:n { e } |
| 1080 |
} |
| 1081 |
% \end{macrocode} |
| 1082 |
% \end{macro} |
| 1083 |
% \begin{macro}{\@@_aux_key:w } |
| 1084 |
% \begin{arguments} |
| 1085 |
% \item \meta{ key } |
| 1086 |
% \item \meta{ value } |
| 1087 |
% \end{arguments} |
| 1088 |
% \begin{macrocode} |
| 1089 |
\cs_new_protected:Npn \@@_aux_key:w #1 = #2 \q_stop |
| 1090 |
{ |
| 1091 |
\seq_gput_right:Nx \g@@_aux_key_seq { \tl_trim_spaces:n{#1} } |
| 1092 |
} |
| 1093 |
% \end{macrocode} |
| 1094 |
% \end{macro} |
| 1095 |
% \begin{macro}{\@@_aux_key:n } |
| 1096 |
% \begin{arguments} |
| 1097 |
% \item \meta{ key = value } |
| 1098 |
% \end{arguments} |
| 1099 |
% \begin{macrocode} |
| 1100 |
\cs_new_protected:Nn \@@_aux_key:n |
| 1101 |
{ |
| 1102 |
\@@_aux_key:w #1 \q_stop |
| 1103 |
} |
| 1104 |
% \end{macrocode} |
| 1105 |
% \end{macro} |
| 1106 |
% \begin{macro}{\@@_aux_key:N } |
| 1107 |
% \begin{arguments} |
| 1108 |
% \item \meta{ seq } |
| 1109 |
% \end{arguments} |
| 1110 |
% \begin{macrocode} |
| 1111 |
\cs_new_protected:Nn \@@_aux_key:N |
| 1112 |
{ |
| 1113 |
\seq_gclear_new:N \g@@_aux_key_seq |
| 1114 |
\seq_map_function:NN #1 \@@_aux_key:n |
| 1115 |
} |
| 1116 |
% \end{macrocode} |
| 1117 |
% \end{macro} |
| 1118 |
% \begin{macro}{\@@_aux_outer_set:n} |
| 1119 |
% \begin{arguments} |
| 1120 |
% \item \meta{ inline code } |
| 1121 |
% \end{arguments} |
| 1122 |
% \begin{macrocode} |
| 1123 |
\cs_new_protected:Nn \@@_aux_outer_set:n |
| 1124 |
{ |
| 1125 |
\cs_gset:Npn \@@_aux_outer:n ##1 {#1} |
| 1126 |
} |
| 1127 |
% \end{macrocode} |
| 1128 |
% \end{macro} |
| 1129 |
% \begin{macro}{\@@_aux_prop:nn} |
| 1130 |
% \begin{macrocode} |
| 1131 |
\prop_new:N \g@@_aux_prop |
| 1132 |
\cs_new_protected:Nn \@@_aux_prop:nn |
| 1133 |
{ |
| 1134 |
\prop_gput:Nnn \g@@_aux_prop{#1}{#2} |
| 1135 |
} |
| 1136 |
\cs_generate_variant:Nn \@@_aux_prop:nn { eo, ee, ex, xo, xe, xx } |
| 1137 |
% \end{macrocode} |
| 1138 |
% \end{macro} |
| 1139 |
% \begin{macro}{\@@_aux_prop:w} |
| 1140 |
% \begin{arguments} |
| 1141 |
% \item \meta{ key } |
| 1142 |
% \item \meta{ value } |
| 1143 |
% \end{arguments} |
| 1144 |
% \begin{macrocode} |
| 1145 |
\tl_new:N \g@@_option_expans_tl |
| 1146 |
\cs_new_protected:Npn \@@_aux_prop:w #1 = #2 \q_stop |
| 1147 |
{ |
| 1148 |
\exp_args:Nx |
| 1149 |
\use:c{@@_aux_prop:\g@@_option_expans_tl} |
| 1150 |
{ \tl_trim_spaces:n{#1} } |
| 1151 |
{ \@@_aux_inner:n{ \tl_trim_spaces:n{#2} } } |
| 1152 |
} |
| 1153 |
% \end{macrocode} |
| 1154 |
% \end{macro} |
| 1155 |
% \begin{macro}{\@@_aux_prop:n} |
| 1156 |
% \begin{arguments} |
| 1157 |
% \item \meta{ key = value } |
| 1158 |
% \end{arguments} |
| 1159 |
% \begin{macrocode} |
| 1160 |
\cs_new_protected:Nn \@@_aux_prop:n |
| 1161 |
{ |
| 1162 |
\@@_aux_prop:w #1 \q_stop |
| 1163 |
} |
| 1164 |
% \end{macrocode} |
| 1165 |
% \end{macro} |
| 1166 |
% \begin{macro}{\@@_aux_prop:N} |
| 1167 |
% \begin{arguments} |
| 1168 |
% \item \meta{keyval list} |
| 1169 |
% \end{arguments} |
| 1170 |
% \begin{macrocode} |
| 1171 |
\cs_new_protected:Nn \@@_aux_prop:N |
| 1172 |
{ |
| 1173 |
\prop_gclear_new:N \g@@_aux_prop |
| 1174 |
\seq_if_empty:NTF #1 |
| 1175 |
{ \c_empty_tl } |
| 1176 |
{ |
| 1177 |
\seq_map_function:NN #1 \@@_aux_prop:n |
| 1178 |
} |
| 1179 |
} |
| 1180 |
% \end{macrocode} |
| 1181 |
% \end{macro} |
| 1182 |
% \begin{macro}{\@@_aux_val:Nn} |
| 1183 |
% \begin{arguments} |
| 1184 |
% \item \meta{ seq } |
| 1185 |
% \item \meta{ tl var name } |
| 1186 |
% \end{arguments} |
| 1187 |
% \begin{macrocode} |
| 1188 |
\cs_new_protected:Nn \@@_aux_val:Nn |
| 1189 |
{ |
| 1190 |
\seq_gclear_new:N \g@@_aux_val_seq |
| 1191 |
\@@_seq_from_prop:NNn \g@@_aux_val_seq #1 { \@@_prop_name:n{#2} } |
| 1192 |
} |
| 1193 |
% \end{macrocode} |
| 1194 |
% \end{macro} |
| 1195 |
% \begin{macrocode} |
| 1196 |
\cs_new:Nn\@@_aux_merge:nn{#1#2} |
| 1197 |
% \end{macrocode} |
| 1198 |
% \section{\textsf{lang}} |
| 1199 |
% \begin{macrocode} |
| 1200 |
\prop_new:N \g@@_lang_and_prop |
| 1201 |
% \end{macrocode} |
| 1202 |
% \begin{macro}{\@@_lang_and_update:n} |
| 1203 |
% \begin{macrocode} |
| 1204 |
% \changes{v3.2} |
| 1205 |
% {2021/09/20} |
| 1206 |
% {Replace~\cs[no-index]{erw_prop_keyval:Nn}~by~\cs[no-index]{prop_set_from_keyval:Nn}} |
| 1207 |
\cs_new_protected:Nn \@@_lang_and_update:n |
| 1208 |
{ |
| 1209 |
\prop_set_from_keyval:Nn |
| 1210 |
\g@@_lang_and_prop |
| 1211 |
{ #1 } |
| 1212 |
} |
| 1213 |
\cs_generate_variant:Nn \@@_lang_and_update:n { e } |
| 1214 |
% \end{macrocode} |
| 1215 |
% \end{macro} |
| 1216 |
% \begin{macro}{\@@_lang_and:n, \@@_lang_and:} |
| 1217 |
% \begin{macrocode} |
| 1218 |
\cs_new:Nn \@@_lang_and:n |
| 1219 |
{ |
| 1220 |
\prop_if_in:NnTF |
| 1221 |
\g@@_lang_and_prop |
| 1222 |
{#1} |
| 1223 |
{\prop_item:Nn\g@@_lang_and_prop{#1}} |
| 1224 |
{ |
| 1225 |
\msg_warning:nnn{@@}{lang_and}{#1} |
| 1226 |
\@@_lang_and:n{english} |
| 1227 |
} |
| 1228 |
} |
| 1229 |
\ifcsdef{languagename} |
| 1230 |
{ |
| 1231 |
\cs_new:Nn \@@_lang_and:{\exp_args:No\@@_lang_and:n{\languagename}} |
| 1232 |
} |
| 1233 |
{ |
| 1234 |
\cs_new:Nn \@@_lang_and:{english} |
| 1235 |
} |
| 1236 |
% \end{macrocode} |
| 1237 |
% \end{macro} |
| 1238 |
% \begin{variable}{\c@@_lang_and_tl} |
| 1239 |
%\NB{todo}{Non latin-alphabet languages} |
| 1240 |
% \begin{macrocode} |
| 1241 |
\tl_const:Nn \c@@_lang_and_tl |
| 1242 |
{ |
| 1243 |
%^^A https://www.overleaf.com/learn/latex/International_language_support |
| 1244 |
afrikaans=en, |
| 1245 |
basque=eta, |
| 1246 |
catalan=i, |
| 1247 |
croatian=i, |
| 1248 |
czech=a, |
| 1249 |
danish=og, |
| 1250 |
dutch=en, |
| 1251 |
english=and, |
| 1252 |
esperanto=kaj, |
| 1253 |
estonian=ja, |
| 1254 |
finnish=ja, |
| 1255 |
french=et, |
| 1256 |
galician=e, |
| 1257 |
german=und, |
| 1258 |
hungarian=\'es, |
| 1259 |
icelandic=og, |
| 1260 |
indonesian=dan, |
| 1261 |
irish=agus, |
| 1262 |
italian=e, |
| 1263 |
kurmanji=\^u, |
| 1264 |
latin=et, |
| 1265 |
latvian=un, |
| 1266 |
lithuanian=ir, |
| 1267 |
ngerman=und, |
| 1268 |
polish=i, |
| 1269 |
portuguese=e, |
| 1270 |
romanian=\c{s}i, |
| 1271 |
slovak=a, |
| 1272 |
spanish=y, |
| 1273 |
swedish=och, |
| 1274 |
swissgerman=und, |
| 1275 |
turkish=ve, |
| 1276 |
turkmen=we, |
| 1277 |
welsh=a |
| 1278 |
} |
| 1279 |
% \end{macrocode} |
| 1280 |
% \end{variable} |
| 1281 |
% \section{\textsf{log}} |
| 1282 |
% \begin{macro}{\@@_log_close:} |
| 1283 |
% \begin{macrocode} |
| 1284 |
\iow_new:N \g@@_log_iow |
| 1285 |
\AtEndDocument{\iow_close:N \g@@_log_iow} |
| 1286 |
\bool_set_false:N \g@@_log_open_bool |
| 1287 |
\cs_new_protected:Nn \@@_log_close: |
| 1288 |
{ |
| 1289 |
\iow_close:N \g@@_log_iow |
| 1290 |
\bool_gset_false:N \g@@_log_open_bool |
| 1291 |
} |
| 1292 |
% \end{macrocode} |
| 1293 |
% \end{macro} |
| 1294 |
% \begin{macro}{\@@_log_open:} |
| 1295 |
% \begin{macrocode} |
| 1296 |
\tl_new:N \g@@_log_file_tl |
| 1297 |
\cs_new_protected:Nn \@@_log_open: |
| 1298 |
{ |
| 1299 |
\tl_gset:Nx \g@@_log_to_tl{\g@@_log_file_tl} |
| 1300 |
\iow_open:Nn \g@@_log_iow {\g@@_log_to_tl} |
| 1301 |
\bool_gset_true:N \g@@_log_open_bool |
| 1302 |
} |
| 1303 |
% \end{macrocode} |
| 1304 |
% \end{macro} |
| 1305 |
% \begin{macro}{\@@_log_read:n} |
| 1306 |
% \begin{arguments} |
| 1307 |
% \item \meta{path} |
| 1308 |
% \end{arguments} |
| 1309 |
% \begin{macrocode} |
| 1310 |
\cs_new_protected:Nn \@@_log_read:n |
| 1311 |
{ |
| 1312 |
\file_input:n{#1} |
| 1313 |
\tl_log:n{read~from~#1} |
| 1314 |
} |
| 1315 |
\cs_generate_variant:Nn \@@_log_read:n { e } |
| 1316 |
% \end{macrocode} |
| 1317 |
% \end{macro} |
| 1318 |
% \begin{macro}{\@@_log_read:} |
| 1319 |
% \begin{macrocode} |
| 1320 |
\cs_new_protected:Nn \@@_log_read: |
| 1321 |
{ |
| 1322 |
\@@_log_read:e{\g@@_log_to_tl} |
| 1323 |
} |
| 1324 |
% \end{macrocode} |
| 1325 |
% \end{macro} |
| 1326 |
% \begin{macro}{\@@_log_write:n} |
| 1327 |
% \begin{macrocode} |
| 1328 |
\tl_new:N \g@@_log_to_tl |
| 1329 |
\cs_new_protected:Nn \@@_log_write:n |
| 1330 |
{ |
| 1331 |
\bool_if:nTF{ \g@@_log_open_bool } |
| 1332 |
{ |
| 1333 |
\iow_now:Nn \g@@_log_iow {#1} |
| 1334 |
\tl_log:n{ write~to~#1 } |
| 1335 |
} |
| 1336 |
{ \msg_error:nnn{ @@ }{ iow }{ \g@@_log_iow } } |
| 1337 |
} |
| 1338 |
\cs_generate_variant:Nn \@@_log_write:n { e } |
| 1339 |
% \end{macrocode} |
| 1340 |
% \end{macro} |
| 1341 |
% \section{\textsf{make_key}} |
| 1342 |
% \begin{macro}{\@@_make_key:Nn} |
| 1343 |
% \begin{arguments} |
| 1344 |
% \item \meta{ token } |
| 1345 |
% \item \meta{ key } |
| 1346 |
% \end{arguments} |
| 1347 |
% \begin{macrocode} |
| 1348 |
\cs_new_protected:Nn \@@_make_key:Nn |
| 1349 |
{ |
| 1350 |
\exp_args:NNx |
| 1351 |
\DeclareDocumentCommand{#1} |
| 1352 |
{ D<>{\g@@_option_param_tl} } |
| 1353 |
{ |
| 1354 |
\@@_prop_item:nn{##1}{#2} |
| 1355 |
} |
| 1356 |
} |
| 1357 |
\cs_generate_variant:Nn \@@_make_key:Nn {c} |
| 1358 |
% \end{macrocode} |
| 1359 |
% \end{macro} |
| 1360 |
% \begin{macro}{\@@_make_key:n} |
| 1361 |
% \begin{arguments} |
| 1362 |
% \item \meta{ key } |
| 1363 |
% \end{arguments} |
| 1364 |
% \begin{macrocode} |
| 1365 |
\cs_new_protected:Nn \@@_make_key:n |
| 1366 |
{ |
| 1367 |
\@@_make_key:cn{#1}{#1} |
| 1368 |
} |
| 1369 |
\cs_generate_variant:Nn \@@_make_key:n { e } |
| 1370 |
% \end{macrocode} |
| 1371 |
% \end{macro} |
| 1372 |
% \begin{macro}{\@@_make_key:N} |
| 1373 |
% \begin{arguments} |
| 1374 |
% \item \meta{ seq } |
| 1375 |
% \end{arguments} |
| 1376 |
% \begin{macrocode} |
| 1377 |
\cs_new_protected:Nn \@@_make_key:N |
| 1378 |
{ |
| 1379 |
\seq_map_function:NN #1 \@@_make_key:e |
| 1380 |
} |
| 1381 |
% \end{macrocode} |
| 1382 |
% \end{macro} |
| 1383 |
% \section{\textsf{make_ccool}} |
| 1384 |
% \begin{macro}{\@@_make_ccool_exp:nnn} |
| 1385 |
% \begin{macrocode} |
| 1386 |
% ^^A \erw_seq_use:Nn |
| 1387 |
\cs_new_protected:Nn \@@_make_ccool_exp:nnn |
| 1388 |
{ |
| 1389 |
\@@_aux_val:Nn \g@@_aux_key_seq {#1} |
| 1390 |
\@@_aux_outer_set:n{#3} |
| 1391 |
\@@_aux_outer:n |
| 1392 |
{ |
| 1393 |
\exp_args:NNf |
| 1394 |
\@@_seq_use:Nn |
| 1395 |
\g@@_aux_val_seq |
| 1396 |
{#2} |
| 1397 |
} |
| 1398 |
} |
| 1399 |
% \end{macrocode} |
| 1400 |
% \end{macro} |
| 1401 |
% \begin{macro}{\@@_make_ccool_key:nnn} |
| 1402 |
% \begin{macrocode} |
| 1403 |
\cs_new_protected:Nn \@@_make_ccool_key:nnn |
| 1404 |
{ |
| 1405 |
\@@_prop_if_exist:nTF{#1} |
| 1406 |
{ \c_empty_tl } |
| 1407 |
{ \@@_prop_new:n{#1} } |
| 1408 |
\exp_args:No \@@_aux_inner_set:n{#2} |
| 1409 |
\seq_set_from_clist:Nn \g@@_aux_keyval_seq {#3} |
| 1410 |
\@@_aux_prop:N \g@@_aux_keyval_seq |
| 1411 |
\@@_prop_append:Nn \g@@_aux_prop {#1} |
| 1412 |
\@@_aux_key:N \g@@_aux_keyval_seq |
| 1413 |
\@@_make_key:N \g@@_aux_key_seq |
| 1414 |
} |
| 1415 |
% \end{macrocode} |
| 1416 |
% \end{macro} |
| 1417 |
% \begin{macro}{\@@_make_ccool_sideeffect:nnn}\cite{a-536597} |
| 1418 |
% \begin{macrocode} |
| 1419 |
\cs_new_protected:Nn \@@_make_ccool_sideeffect:nnn |
| 1420 |
{ |
| 1421 |
\@@_make_ccool_key:nnn{#1}{#2}{#3} |
| 1422 |
\bool_if:nTF{ \g@@_log_open_bool } |
| 1423 |
{ |
| 1424 |
\@@_log_write:n |
| 1425 |
{ |
| 1426 |
\begingroup |
| 1427 |
\def \@@_log_entry { \Ccool<#1>c{#2}{#3} } \expandafter |
| 1428 |
\endgroup \@@_log_entry |
| 1429 |
} |
| 1430 |
}{\c_empty_tl} |
| 1431 |
} |
| 1432 |
% \end{macrocode} |
| 1433 |
% \end{macro} |
| 1434 |
% \begin{macro}{\@@_make_ccool:nnnn} |
| 1435 |
% \begin{arguments} |
| 1436 |
% \item \meta{ token list } |
| 1437 |
% \item \meta{ seq_{1} } |
| 1438 |
% \item \meta{ seq_{2} } |
| 1439 |
% \item \meta{ prop } |
| 1440 |
% \end{arguments} |
| 1441 |
% \begin{macrocode} |
| 1442 |
\cs_new_protected:Npn \@@_make_ccool:nnnn #1 #2 #3 #4 |
| 1443 |
{ |
| 1444 |
\exp_args:NNx \DeclareDocumentCommand \Ccool |
| 1445 |
{%^^A 2 3 4 5 6 7 8 9 |
| 1446 |
+o D<>{#1} E{ c }{{#2}} m t+ s E{ s c }{{#3}{#4}} +o |
| 1447 |
} |
| 1448 |
{ |
| 1449 |
\IfValueT{##1}{##1} |
| 1450 |
\@@_make_ccool_sideeffect:nnn{##2}{##3}{##4} |
| 1451 |
\IfBooleanT{##6} |
| 1452 |
{ |
| 1453 |
\@@_make_ccool_exp:nnn{##2}{##7}{##8} |
| 1454 |
} |
| 1455 |
\bool_if:nTF{##5} |
| 1456 |
{ |
| 1457 |
\gappto{\CcoolHook} |
| 1458 |
{ |
| 1459 |
\@@_make_ccool_sideeffect:nnn{##2}{##3}{##4} |
| 1460 |
} |
| 1461 |
} |
| 1462 |
{\c_empty_tl} |
| 1463 |
\IfValueT{##9} |
| 1464 |
{ |
| 1465 |
\exp_not:n{ \Ccool[##9] } |
| 1466 |
} |
| 1467 |
} |
| 1468 |
} |
| 1469 |
% \end{macrocode} |
| 1470 |
% \end{macro} |
| 1471 |
% \section{\textsf{msg}} |
| 1472 |
% \begin{macrocode} |
| 1473 |
\msg_new:nnn {@@} |
| 1474 |
{ iow } |
| 1475 |
{#1~is~closed~can't~write} |
| 1476 |
\msg_new:nnn {@@} |
| 1477 |
{lang_and} |
| 1478 |
{~key~#1~missing~for~global~option~'And';~falling~back~on~'english'} |
| 1479 |
% \end{macrocode} |
| 1480 |
% \section{\textsf{option}} |
| 1481 |
% \begin{macro}{\@@_option_inner:n} |
| 1482 |
% \begin{arguments} |
| 1483 |
% \item \meta{code} |
| 1484 |
% \end{arguments} |
| 1485 |
% \begin{macrocode} |
| 1486 |
\tl_new:N \g@@_option_inner_tl |
| 1487 |
\cs_new_protected:Nn \@@_option_inner:n |
| 1488 |
{ |
| 1489 |
\tl_gset:Nn \g@@_option_inner_tl {#1} |
| 1490 |
} |
| 1491 |
% \end{macrocode} |
| 1492 |
% \end{macro} |
| 1493 |
% \begin{macro}{\@@_option_param:n} |
| 1494 |
% \begin{arguments} |
| 1495 |
% \item \meta{token list} |
| 1496 |
% \end{arguments} |
| 1497 |
% \begin{macrocode} |
| 1498 |
\tl_new:N \g@@_option_param_tl |
| 1499 |
\cs_new_protected:Nn \@@_option_param:n |
| 1500 |
{ |
| 1501 |
\tl_gset:Nn \g@@_option_param_tl{#1} |
| 1502 |
} |
| 1503 |
% \end{macrocode} |
| 1504 |
% \end{macro} |
| 1505 |
% \begin{macro}{\@@_option_outer:n} |
| 1506 |
% \begin{arguments} |
| 1507 |
% \item \meta{ inline code } |
| 1508 |
% \end{arguments} |
| 1509 |
% \begin{macrocode} |
| 1510 |
\tl_new:N \g@@_option_outer_tl |
| 1511 |
\cs_new_protected:Nn \@@_option_outer:n |
| 1512 |
{ |
| 1513 |
\tl_gset:Nn \g@@_option_outer_tl {#1} |
| 1514 |
} |
| 1515 |
% \end{macrocode} |
| 1516 |
% \end{macro} |
| 1517 |
% \begin{macro}{\@@_option_separ:n} |
| 1518 |
% \begin{arguments} |
| 1519 |
% \item \Arg{ tl_{1} }\Arg{ tl_{2} }\Arg{ tl_{3} } |
| 1520 |
% \end{arguments} |
| 1521 |
% \begin{macrocode} |
| 1522 |
\tl_new:N \g@@_option_separ_tl |
| 1523 |
\cs_new_protected:Nn \@@_option_separ:n |
| 1524 |
{ |
| 1525 |
\cs_gset:Npn \g@@_option_separ_tl {#1} |
| 1526 |
} |
| 1527 |
% \end{macrocode} |
| 1528 |
% \end{macro} |
| 1529 |
% \begin{variable}{\g@@_option_separ_tl} |
| 1530 |
% \begin{macrocode} |
| 1531 |
\ifcsdef{text} |
| 1532 |
{ |
| 1533 |
\tl_const:Nn \c@@_option_separ_default_tl |
| 1534 |
{ |
| 1535 |
{ \text{{\ }\@@_lang_and:{\ }} } |
| 1536 |
{ \text{,{\ }} } |
| 1537 |
{ \text{,{\ }\@@_lang_and:{\ }} } |
| 1538 |
} |
| 1539 |
} |
| 1540 |
{ |
| 1541 |
\tl_const:Nn \c@@_option_separ_default_tl |
| 1542 |
{ |
| 1543 |
{ {\ }\@@_lang_and:{\ } } |
| 1544 |
{ ,{\ } } |
| 1545 |
{ ,{\ }\@@_lang_and:{\ } } |
| 1546 |
} |
| 1547 |
} |
| 1548 |
% \end{macrocode} |
| 1549 |
% \end{variable} |
| 1550 |
% \section{\textsf{prop}} |
| 1551 |
% \begin{macro}{\@@_prop_append:NN} |
| 1552 |
% \begin{arguments} |
| 1553 |
% \item \meta{ prop_{1} } |
| 1554 |
% \item \meta{ prop_{2} } |
| 1555 |
% \end{arguments} |
| 1556 |
% \begin{macrocode} |
| 1557 |
\cs_new_protected:Npn \@@_prop_append:NN #1 #2 |
| 1558 |
{ |
| 1559 |
\cs_set:Nn \@@_prop_append:nn |
| 1560 |
{ |
| 1561 |
\prop_gput:Nnx #1 {##1}{ \prop_item:Nn #2{##1} } |
| 1562 |
} |
| 1563 |
\prop_map_function:NN #2 \@@_prop_append:nn |
| 1564 |
} |
| 1565 |
\cs_generate_variant:Nn \@@_prop_append:NN { cN } |
| 1566 |
% \end{macrocode} |
| 1567 |
% \end{macro} |
| 1568 |
% \begin{macro}{\@@_prop_append:Nn} |
| 1569 |
% \begin{arguments} |
| 1570 |
% \item \meta{ prop } |
| 1571 |
% \item \meta{ tl var name } |
| 1572 |
% \end{arguments} |
| 1573 |
% \begin{macrocode} |
| 1574 |
\cs_new_protected:Nn \@@_prop_append:Nn |
| 1575 |
{ |
| 1576 |
\@@_prop_append:cN{ \@@_prop_name:n {#2} } #1 |
| 1577 |
} |
| 1578 |
% \end{macrocode} |
| 1579 |
% \end{macro} |
| 1580 |
% \begin{macro}{\@@_prop_clear_new:n} |
| 1581 |
% \begin{arguments} |
| 1582 |
% \item \meta{ tl var name } |
| 1583 |
% \end{arguments} |
| 1584 |
% \begin{macrocode} |
| 1585 |
\cs_new_protected:Nn \@@_prop_clear_new:n |
| 1586 |
{ |
| 1587 |
\exp_args:No \prop_clear_new:c{ \@@_prop_name:n {#1} } |
| 1588 |
} |
| 1589 |
% \end{macrocode} |
| 1590 |
% \end{macro} |
| 1591 |
% \begin{macro}{\@@_prop_clear_new_map:n} |
| 1592 |
% \begin{arguments} |
| 1593 |
% \item \meta{ keyval list } |
| 1594 |
% \end{arguments} |
| 1595 |
% \begin{macrocode} |
| 1596 |
\cs_new_protected:Nn \@@_prop_clear_new_map:n |
| 1597 |
{ |
| 1598 |
\seq_set_from_clist:Nn \g@@_aux_key_seq {#1} |
| 1599 |
\seq_map_function:NN \g@@_aux_key_seq \@@_prop_clear_new:n |
| 1600 |
} |
| 1601 |
% \end{macrocode} |
| 1602 |
% \end{macro} |
| 1603 |
% \begin{macro}{\@@_prop_if_exist:nTF} |
| 1604 |
% \begin{arguments} |
| 1605 |
% \item \meta{tl_{1}} |
| 1606 |
% \item \meta{tl_{2}} |
| 1607 |
% \item \meta{tl_{3}} |
| 1608 |
% \end{arguments} |
| 1609 |
% \begin{macrocode} |
| 1610 |
\cs_new:Nn \@@_prop_if_exist:nTF |
| 1611 |
{ |
| 1612 |
\prop_if_exist:cTF{ \@@_prop_name:n {#1} }{#2}{#3} |
| 1613 |
} |
| 1614 |
% \end{macrocode} |
| 1615 |
% \end{macro} |
| 1616 |
% \begin{macro}{\@@_prop_item:nn} |
| 1617 |
% \begin{arguments} |
| 1618 |
% \item \meta{ tl var name } |
| 1619 |
% \item \meta{ key } |
| 1620 |
% \end{arguments} |
| 1621 |
% \begin{macrocode} |
| 1622 |
\cs_new:Nn \@@_prop_item:nn |
| 1623 |
{ |
| 1624 |
\prop_item:cn { \@@_prop_name:n {#1} } {#2} |
| 1625 |
} |
| 1626 |
% \end{macrocode} |
| 1627 |
% \end{macro} |
| 1628 |
% \begin{macro}{\@@_prop_name:n} |
| 1629 |
% \begin{arguments} |
| 1630 |
% \item \meta{ tl var name } |
| 1631 |
% \end{arguments} |
| 1632 |
% \begin{macrocode} |
| 1633 |
\cs_new:Npn \@@_prop_name:n #1{ @@_#1 } |
| 1634 |
% \end{macrocode} |
| 1635 |
% \end{macro} |
| 1636 |
% \begin{macro}{\@@_prop_new:n} |
| 1637 |
% \begin{arguments} |
| 1638 |
% \item \meta{ tl var name } |
| 1639 |
% \end{arguments} |
| 1640 |
% \begin{macrocode} |
| 1641 |
\cs_new_protected:Nn \@@_prop_new:n |
| 1642 |
{ |
| 1643 |
\prop_new:c{ \@@_prop_name:n {#1} } |
| 1644 |
} |
| 1645 |
% \end{macrocode} |
| 1646 |
% \end{macro} |
| 1647 |
% \section{\textsf{seq}} |
| 1648 |
% \begin{macro}{\@@_seq_from_prop:NNn} |
| 1649 |
% \begin{arguments} |
| 1650 |
% \item \meta{ seq_{1} } |
| 1651 |
% \item \meta{ seq_{2} } (keys) |
| 1652 |
% \item \meta{ prop } |
| 1653 |
% \end{arguments} |
| 1654 |
% \begin{macrocode} |
| 1655 |
\cs_new_protected:Nn \@@_seq_from_prop:NNn |
| 1656 |
{ |
| 1657 |
\cs_set_protected:Nn \@@_seq_from_prop:n |
| 1658 |
{ |
| 1659 |
\seq_gput_right:No #1 { \prop_item:cn{#3}{##1} } |
| 1660 |
} |
| 1661 |
\seq_map_function:NN #2 \@@_seq_from_prop:n |
| 1662 |
} |
| 1663 |
% \end{macrocode} |
| 1664 |
% \end{macro} |
| 1665 |
% \section{\textsf{seq_use}} |
| 1666 |
% \begin{macro}{\@@_seq_from_prop:NNn} |
| 1667 |
% \begin{macrocode} |
| 1668 |
% \changes{v3.2} |
| 1669 |
% {2021/09/20} |
| 1670 |
% {Added~\cs[no-index]{__ccool_seq_use:Nn}~in~replacement~of~\cs[no-index][erw_seq_use:Nn]} |
| 1671 |
\msg_new:nnn{@@}{separ}{#1~expects~1~to~3~items,~#2} |
| 1672 |
\cs_new:Nn \@@_seq_use:Nn |
| 1673 |
{ |
| 1674 |
\exp_last_unbraced:NNf |
| 1675 |
\seq_use:Nnnn #1 |
| 1676 |
\@@_tl_separators:n{#2} |
| 1677 |
} |
| 1678 |
\cs_new:Nn \@@_tl_separators:n |
| 1679 |
{ \@@_tl_separators:en{ \tl_count:n{#1} }{#1} } |
| 1680 |
\cs_new:Nn \@@_tl_separators:nn |
| 1681 |
{ \int_case:nnTF {#1} |
| 1682 |
{ {1} |
| 1683 |
{ \prg_replicate:nn{ 3 }{#2} } |
| 1684 |
{2} |
| 1685 |
{ |
| 1686 |
{ \use_ii:nn #2 } |
| 1687 |
{ \use_i:nn #2 } |
| 1688 |
{ \use_i:nn #2 \use_ii:nn #2 } |
| 1689 |
} |
| 1690 |
{3}{#2} |
| 1691 |
} |
| 1692 |
{ \c_empty_tl } |
| 1693 |
{ |
| 1694 |
\msg_error:nnnn { @@ } |
| 1695 |
{ separ } |
| 1696 |
{ \@@_tl_separators:nn } |
| 1697 |
{#2} |
| 1698 |
} |
| 1699 |
} |
| 1700 |
\cs_generate_variant:Nn \@@_tl_separators:nn { e } |
| 1701 |
% \end{macrocode} |
| 1702 |
% \end{macro} |
| 1703 |
% \section{Front-end}\label{impl:frontend} |
| 1704 |
% \DocPhantomSection*{subsection}{\cs{CcoolClear}}{impl:cs:clear} |
| 1705 |
% \begin{macro}{\CcoolClear} |
| 1706 |
% \begin{macrocode} |
| 1707 |
\NewDocumentCommand{ \CcoolClear } |
| 1708 |
{ D<>{\g@@_option_param_tl} } |
| 1709 |
{ |
| 1710 |
\@@_prop_clear_new_map:n{#1} |
| 1711 |
} |
| 1712 |
% \end{macrocode} |
| 1713 |
% \end{macro} |
| 1714 |
% \DocPhantomSection*{subsection}{\cs{CcoolHook}}{impl:cs:hook} |
| 1715 |
% \begin{macro}{\CcoolHook} |
| 1716 |
% \begin{macrocode} |
| 1717 |
\NewDocumentCommand{\CcoolHook}{}{\c_empty_tl} |
| 1718 |
% \end{macrocode} |
| 1719 |
% \end{macro} |
| 1720 |
% \DocPhantomSection*{subsection}{\cs{CcoolLambda}}{impl:cs:lambda} |
| 1721 |
% \begin{macro}{\CcoolLambda} |
| 1722 |
% \NB{todo}{allow only m- or o-type arguments} |
| 1723 |
% \begin{macrocode} |
| 1724 |
% \changes{v3.2} |
| 1725 |
% {2021/09/20}{\cs[CcoolLambda]'s~implementation~switched~from~\pkg{erw-l3}~to~\pkg{lambdax};~kept~only~for~backward~compat.} |
| 1726 |
\ProvideDocumentCommand \CcoolLambda { O{m} m } |
| 1727 |
{ \lambdax:nn{#1}{#2} } |
| 1728 |
% \end{macrocode} |
| 1729 |
% \end{macro} |
| 1730 |
% \DocPhantomSection*{subsection}{\cs{CcoolOption}}{impl:cs:option} |
| 1731 |
% \begin{macro}{\CcoolOption} |
| 1732 |
% \NB{todo}{Fix placeholders passed to options requiring code (only one pound sign)} |
| 1733 |
% \NB{abandon}{Requirement: write to file if Write; Update: redundant with \cs{Ccool}+Write} |
| 1734 |
% \begin{macrocode} |
| 1735 |
\NewDocumentCommand{ \CcoolOption } |
| 1736 |
{ O{ And, Expans, File, Inner, Param, Outer, Separ, Write } } |
| 1737 |
{ |
| 1738 |
\keys_set:nn{ @@ }{#1} |
| 1739 |
} |
| 1740 |
% \end{macrocode} |
| 1741 |
% \end{macro} |
| 1742 |
% \begin{macrocode} |
| 1743 |
\keys_define:nn { @@ } |
| 1744 |
{ |
| 1745 |
% \end{macrocode} |
| 1746 |
% \begin{macrocode} |
| 1747 |
And .code:n = { \@@_lang_and_update:e{ #1 } }, |
| 1748 |
And .default:n = { \c@@_lang_and_tl }, |
| 1749 |
And .initial:n = { \c@@_lang_and_tl }, |
| 1750 |
% \end{macrocode} |
| 1751 |
% \begin{macrocode} |
| 1752 |
Expans .multichoices:nn = { eo, ee, ex, xo, xe, xx } |
| 1753 |
{ \tl_gset_eq:NN \g@@_option_expans_tl \l_keys_choice_tl }, |
| 1754 |
Expans .default:n = { xo }, |
| 1755 |
Expans .initial:n = { xo }, |
| 1756 |
% \end{macrocode} |
| 1757 |
% \begin{macrocode} |
| 1758 |
% \changes{v3.2} |
| 1759 |
% {2021/09/20} |
| 1760 |
% {Removed~module~key~File's~relianced~on~a~timestamp~(clumsy)} |
| 1761 |
File .code:n = { \tl_gset:Nx \g@@_log_file_tl{#1} } } |
| 1762 |
\cs_new_protected:Nn |
| 1763 |
\@@_keys_define_file:n |
| 1764 |
{\keys_define:nn { @@ } |
| 1765 |
{File .code:n = { \tl_gset:Nx \g@@_log_file_tl{#1} }, |
| 1766 |
File .default:n = { #1 }, |
| 1767 |
File .initial:n = { #1 } } } |
| 1768 |
\cs_generate_variant:Nn\@@_keys_define_file:n{e} |
| 1769 |
\@@_keys_define_file:e |
| 1770 |
{\exp_args:Ne\@@_aux_merge:nn{\c_sys_jobname_str}{_ccool_log}} |
| 1771 |
% \end{macrocode} |
| 1772 |
% \begin{macrocode} |
| 1773 |
\keys_define:nn { @@ } |
| 1774 |
{ |
| 1775 |
Inner .code:n={ |
| 1776 |
\@@_option_inner:n{#1} |
| 1777 |
\exp_last_unbraced:Nf |
| 1778 |
\@@_make_ccool:nnnn |
| 1779 |
{ |
| 1780 |
{ \g@@_option_param_tl } |
| 1781 |
{ \g@@_option_inner_tl } |
| 1782 |
{ \g@@_option_separ_tl } |
| 1783 |
{ \g@@_option_outer_tl } |
| 1784 |
} |
| 1785 |
}, |
| 1786 |
Inner .value_required:n = false, |
| 1787 |
Inner .default:n = {####1}, |
| 1788 |
Inner .initial:n = {####1}, |
| 1789 |
% \end{macrocode} |
| 1790 |
% \begin{macrocode} |
| 1791 |
Param .code:n={ |
| 1792 |
\@@_option_param:n{#1} |
| 1793 |
\exp_last_unbraced:Nf |
| 1794 |
\@@_make_ccool:nnnn |
| 1795 |
{ |
| 1796 |
{ \g@@_option_param_tl } |
| 1797 |
{ \g@@_option_inner_tl } |
| 1798 |
{ \g@@_option_separ_tl } |
| 1799 |
{ \g@@_option_outer_tl } |
| 1800 |
} |
| 1801 |
}, |
| 1802 |
Param .value_required:n = false, |
| 1803 |
Param .default:n = { Default }, |
| 1804 |
Param .initial:n = { Default }, |
| 1805 |
% \end{macrocode} |
| 1806 |
% \begin{macrocode} |
| 1807 |
Outer .code:n={ |
| 1808 |
\@@_option_outer:n{#1} |
| 1809 |
\exp_last_unbraced:Nf |
| 1810 |
\@@_make_ccool:nnnn |
| 1811 |
{ |
| 1812 |
{ \g@@_option_param_tl } |
| 1813 |
{ \g@@_option_inner_tl } |
| 1814 |
{ \g@@_option_separ_tl } |
| 1815 |
{ \g@@_option_outer_tl } |
| 1816 |
} |
| 1817 |
}, |
| 1818 |
Outer .value_required:n = false, |
| 1819 |
Outer .default:n = { \ensuremath{####1} }, |
| 1820 |
Outer .initial:n = { \ensuremath{####1} }, |
| 1821 |
% \end{macrocode} |
| 1822 |
% \begin{macrocode} |
| 1823 |
Separ .code:n={ |
| 1824 |
\@@_option_separ:n{#1} |
| 1825 |
\exp_last_unbraced:Nf |
| 1826 |
\@@_make_ccool:nnnn |
| 1827 |
{ |
| 1828 |
{ \g@@_option_param_tl } |
| 1829 |
{ \g@@_option_inner_tl } |
| 1830 |
{ \g@@_option_separ_tl } |
| 1831 |
{ \g@@_option_outer_tl } |
| 1832 |
} |
| 1833 |
}, |
| 1834 |
Separ .value_required:n = false, |
| 1835 |
Separ .default:n = { \c@@_option_separ_default_tl }, |
| 1836 |
Separ .initial:n = { \c@@_option_separ_default_tl }, |
| 1837 |
% \end{macrocode} |
| 1838 |
% \begin{macrocode} |
| 1839 |
Write .code:n = { |
| 1840 |
\bool_if:nTF{#1} |
| 1841 |
{\@@_log_open:} |
| 1842 |
{\@@_log_close:} |
| 1843 |
}, |
| 1844 |
Write .value_required:n = false, |
| 1845 |
Write .default:n = \BooleanFalse, |
| 1846 |
Write .initial:n = \BooleanFalse |
| 1847 |
% \end{macrocode} |
| 1848 |
% \begin{macrocode} |
| 1849 |
} |
| 1850 |
% \end{macrocode} |
| 1851 |
% \begin{macro}{\CcoolRead} |
| 1852 |
% \begin{macrocode} |
| 1853 |
\NewDocumentCommand{\CcoolRead} |
| 1854 |
{o} |
| 1855 |
{ |
| 1856 |
\IfValueTF{#1} |
| 1857 |
{\@@_log_read:e{#1}} |
| 1858 |
{\@@_log_read:} |
| 1859 |
} |
| 1860 |
% \end{macrocode} |
| 1861 |
% \end{macro} |
| 1862 |
% \begin{macro}{\CcoolVers} |
| 1863 |
% \begin{macrocode} |
| 1864 |
\NewDocumentCommand{\CcoolVers} |
| 1865 |
{} |
| 1866 |
{\use:c{[email protected]}} |
| 1867 |
% \end{macrocode} |
| 1868 |
% \end{macro} |
| 1869 |
% \section{Closing} |
| 1870 |
% \begin{macrocode} |
| 1871 |
\ExplSyntaxOff |
| 1872 |
%</package> |
| 1873 |
% \end{macrocode} |
| 1874 |
% \end{implementation} |
| 1875 |
% \Finale |
| 1876 |
\endinput |