Debian Codegraph @

texmf-dist/source/latex/contract/contract.dtx

raw
1 % \iffalse meta-comment
2 % ======================================================================
3 % contract.dtx
4 % Copyright (c) 2007–2026 Markus Kohm
5 %
6 % This file is part of the LaTeX package `contract'.
7 %
8 % This work may be distributed and/or modified under the conditions of
9 % the LaTeX Project Public License, version 1.3c of the license.
10 % The latest version of this license is in
11 % http://www.latex-project.org/lppl.txt
12 % and version 1.3c or later is part of all distributions of LaTeX
13 % version 2005/12/01 or later and of this work.
14 %
15 % This work has the LPPL maintenance status "maintained".
16 %
17 % The Current Maintainer and author of this work is Markus Kohm.
18 %
19 % This work consists of the files listed in MANIFEST.md.
20 % ======================================================================
21 %<identify>%%% --- docstrip run: identify ---
22 %<doc>%%% --- docstrip run: doc ---
23 %<init>%%% --- docstrip run: init ---
24 %<options>%%% --- docstrip run: options ---
25 %<postoptions>%%% --- docstrip run: postoptions ---
26 %<body>%%% --- docstrip run: body ---
27 %<final>%%% --- docstrip run: final ---
28 %<*dtx>
29 \expandafter\ifx\csname ProvidesFile\endcsname\relax
30 \def\ProvidesFile#1[#2]{}
31 \fi
32 \ProvidesFile{contract.dtx}[%
33 %</dtx>
34 %<package&identify>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
35 %<package&identify>\providecommand*\DeclareRelease[3]{}
36 %<package&identify>\providecommand*\DeclareCurrentRelease[2]{}
37 %<package&identify>\DeclareCurrentRelease{v0.9}{2024-02-02}
38 %<package&identify>\ProvidesPackage{contract}[%
39 %<*dtx|(package&identify)>
40 2026-04-23 v0.92
41 %<*dtx>
42 source of
43 %</dtx>
44 package for jurists
45 ]
46 %</dtx|(package&identify)>
47 %<*dtx>
48 \ifx\documentclass\undefined
49 %</dtx>
50 %<*ins>
51 \input docstrip.tex
52 \generate{\usepreamble\defaultpreamble
53 % \file{contract.ins}{%
54 % \from{contract.dtx}{ins}%
55 % }%
56 \file{contract.sty}{%
57 \from{contract.dtx}{package,identify}%
58 \from{contract.dtx}{package,init}%
59 \from{contract.dtx}{package,options}%
60 \from{contract.dtx}{package,postoptions}%
61 \from{contract.dtx}{package,body}%
62 \from{contract.dtx}{package,final}%
63 }%
64 }%
65 %</ins>
66 %<*dtx>
67 \else
68 \let\endbatchfile\relax
69 \fi
70 %</dtx>
71 %<*ins>
72 \endbatchfile
73 %</ins>
74 %<*dtx>
75 \documentclass[USenglish]{koma-script-source-doc}
76 \usepackage[T1]{fontenc}
77 \usepackage{lmodern}
78 \usepackage[ngerman,main=USenglish]{babel}
79 \usepackage{hvlogos}
80 \usepackage{tabularx}
81 \usepackage{graphicx}
82
83 % Note: The scrguide-… packages may currently not be available in any TeX
84 % distribution.
85 \usepackage[colorize]{scrguide-listings}
86 \usepackage{scrguide-doclink}
87 \usepackage{scrguide-index}
88
89 \usepackage{booktabs}
90 \usepackage{csquotes}
91 \usepackage[style=alphabetic,autolang=other]{biblatex}
92 \begin{filecontents}{\jobname.bib}
93 @online{pkg:babel,
94 author={Bezos López, Javier and Braams, Johannes L.},
95 version={24.1},
96 date={2024-01-07},
97 title={\pkg*{babel} --- Multilingual support for \LaTeX, Lua\LaTeX,
98 \XeLaTeX{} and Plain \TeX},
99 url={https://ctan.org/pkg/babel},
100 urldate={2024-01-08},
101 note={This package manages culturally-determined typographical (and other)
102 rules for a wide range of languages. A document may select a single
103 language to be supported, or it may select several, in which case the
104 document may switch from one language to another in a variety of ways.
105
106 Babel uses contributed configuration files that provide the detail of
107 what has to be done for each language, as well as \file{.ini} files
108 for about 300 languages from around the World, including many written
109 in non-Latin and RTL scripts. Many of them work with pdf\LaTeX, as
110 well as with \XeLaTeX{} and Lua\LaTeX, out of the box. A few even
111 work with plain formats.},
112 }
113 @online{pkg:koma-script,
114 author={Markus Kohm},
115 version={3.41},
116 date={2023-07-07},
117 title={{\KOMAScript} --- A bundle of versatile classes and packages},
118 url={https://ctan.org/pkg/koma-script},
119 urldate={2023-07-14},
120 note={The \KOMAScript{} bundle provides replacements for the \cls*{article},
121 \cls*{report}, and \cls*{book} classes with emphasis on typography and
122 versatility. There is also a letter class.},
123 }
124 @manual{pkg:koma-script:manual:de,
125 langid={ngerman},
126 author={Markus Kohm},
127 date={2023-06-16},
128 title={{\KOMAScript}},
129 subtitle={Die Anleitung},
130 url={http://mirrors.ctan.org/macros/latex/contrib/koma-script/scrguide-de.pdf}
131 ,
132 urldate={2023-07-04},
133 }
134 @manual{pkg:koma-script:manual:en,
135 author={Markus Kohm},
136 date={2023-06-16},
137 title={{\KOMAScript}},
138 subtitle={The Guide},
139 url={http://mirrors.ctan.org/macros/latex/contrib/koma-script/scrguide-en.pdf},
140 urldate={2023-07-14},
141 }
142 @book{bk:koma-script,
143 langid ={ngerman},
144 author ={Kohm, Markus},
145 title ={{\KOMAScript}},
146 subtitle ={Eine Sammlung von Klassen und Paketen für {\LaTeXe}},
147 year =2020,
148 edition =7,
149 publisher={Lehmanns Media},
150 address ={Berlin},
151 series ={Edition DANTE},
152 isbn ={978-3-96543-097-6},
153 note ={Print-Ausgabe},
154 }
155 @book{ebk:koma-script,
156 langid ={ngerman},
157 author ={Kohm, Markus},
158 title ={{\KOMAScript}},
159 subtitle ={Eine Sammlung von Klassen und Paketen für {\LaTeXe}},
160 year =2020,
161 edition =7,
162 publisher={Lehmanns Media},
163 address ={Berlin},
164 series ={Edition DANTE},
165 isbn ={978-3-96543-103-4},
166 note ={eBook-Ausgabe},
167 }
168 \@online{pkg:parskip,
169 author ={Frank Mittelbach and Robin Fairbairns and H. Partl},
170 version ={2.0h},
171 date ={2021-03-14},
172 title ={\pkg*{parskip} --- Layout with zero \len{parindent}, non-zero \len{parskip}},
173 url ={https://www.ctan.org/pkg/parskip},
174 urldate ={2024-01-19},
175 note ={Simply changing \len{parskip} and \len{parindent} leaves a
176 layout that is untidy; this package (though it is no
177 substitute for a properly-designed class) helps alleviate this
178 untidiness.},
179 }
180 @manual{pkg:parskip:manual,
181 author ={Frank Mittelbach},
182 title ={The \pkg*{parskip} package},
183 date ={2021-03-14},
184 abstract ={The \pkg*{parskip} package helps in implementing paragraph
185 layouts where the paragraphs are separated by a vertical space
186 instead of (or in addition to) indenting them.
187
188 The package can be used with any document class at any size.
189 By default it produces the following paragraph layout: Zero
190 \len{parindent} and non-zero \len{parskip}. The stretchable
191 glue in \len{parskip} helps \LaTeX{} in finding the best place
192 for page breaks},
193 url ={http://mirrors.ctan.org/macros/latex/contrib/parskip/parskip.pdf},
194 urldate ={2024-01-19},
195 }
196 \end{filecontents}
197 \addbibresource{\jobname.bib}
198 \setcounter{StandardModuleDepth}{2}
199 \setcounter{IndexColumns}{2}
200 \setcounter{GlossaryColumns}{2}
201 \providecommand*\targ[1]{\texttt{\char`\{#1\char`\}}}
202 \providecommand*\toarg[1]{\texttt{[#1]}}
203 \newenvironment{syntax}{%
204 \list{}{%
205 \listparindent -\leftmargin
206 \rightmargin \leftmargin
207 \leftmargin 2\leftmargin
208 \itemindent \listparindent
209 \parsep 0pt plus 1pt
210 }%
211 \def\obeyedlinedline{\item\relax}%
212 \obeylines
213 \obeyedlinedline
214 \MacroFont
215 }{%
216 \endlist
217 }
218 \makeatletter
219 \newenvironment{desctabular}{%
220 \renewcommand*{\arraystretch}{1.25}%
221 \newcommand{\entry}[2]{%
222 \l@addto@macro\desctab@content{%
223 \relax
224 \renewcommand*\arraystretch{1}\begin{tabular}[t]{@{}l@{}}##1\end{tabular}
225 & ##2\tabularnewline
226 }%
227 }
228 \newcommand\desctab@content{\begin{tabularx}{\linewidth}{@{}lX@{}}\toprule}%
229 }{%
230 \desctab@content
231 \bottomrule
232 \end{tabularx}
233 }
234 \makeatother
235 \newenvironment{desclist}{%
236 \newcommand*{\desccaption}[2]{%
237 \par
238 \vspace{5\baselineskip}\pagebreak[2]\vspace{-5\baselineskip}\nopagebreak
239 \captionof{table}{##1}\nopagebreak
240 \begin{desctabular}
241 }%
242 }{%
243 \end{desctabular}
244 }
245 \newenvironment{Example}{%
246 \lstset{belowskip=0pt plus 1pt minus .5pt}%
247 \labeling{{\usekomafont{disposition}\Examplename:}}
248 \item[{\usekomafont{disposition}\Examplename:}]%
249 }{%
250 \endlabeling
251 }
252 \newcaptionname{USenglish}{\Examplename}{Example}
253
254 \DeclareTOCStyleEntry[dynnumwidth,dynindent]{section}{section}
255 \DeclareTOCStyleEntries[dynnumwidth,dynindent]{subsection}
256 {subsection,subsubsection}
257
258 \DeclareLinkFallback{Counter}{tocdepth}
259 {https://en.wikibooks.org/wiki/LaTeX/Tables_of_Contents_and_Lists_of_Figures}
260 \DeclareLinkFallback{Macro}{arabic}
261 {https://en.wikibooks.org/wiki/LaTeX/Counters#Counter_style}
262 \DeclareLinkFallback{Macro}{begin}
263 {https://en.wikibooks.org/wiki/LaTeX/Basics#LaTeX_environments}
264 \DeclareLinkFallback{Macro}{bfseries}
265 {https://en.wikibooks.org/wiki/LaTeX/Fonts#Font_styles}
266 \DeclareLinkFallback{Macro}{end}
267 {https://en.wikibooks.org/wiki/LaTeX/Basics#LaTeX_environments}
268 \DeclareLinkFallback{Macro}{refstepcounter}
269 {https://en.wikibooks.org/wiki/LaTeX/Counters#Counter_manipulation}
270 \DeclareLinkFallback{Macro}{sffamily}
271 {https://en.wikibooks.org/wiki/LaTeX/Fonts#Font_styles}
272
273 \DeclareLinkFallback{Macro}{newcommand}
274 {https://mirrors.ctan.org/macros/latex/base/usrguide-historic.pdf#subsection.3.4}
275 \DeclareLinkFallback{Macro}{renewcommand}
276 {https://mirrors.ctan.org/macros/latex/base/usrguide-historic.pdf#subsection.3.4}
277
278 \DeclareLinkFallback{Macro}{defineshorthand}
279 {http://mirrors.ctan.org/macros/latex/required/babel/base/babel.pdf#subsection.1.10}
280 \DeclareLinkFallback{Macro}{useshorthands}
281 {http://mirrors.ctan.org/macros/latex/required/babel/base/babel.pdf#subsection.1.10}
282
283 \DeclareLinkFallback{Macro}{setkeys}
284 {https://mirrors.ctan.org/macros/latex/required/graphics/keyval.pdf#section.3}
285
286 \DeclareLinkFallback{Macro}{documentclass}
287 {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#12}
288 \DeclareLinkFallback{Macro}{dots}
289 {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#a7}
290 \DeclareLinkFallback{Macro}{label}
291 {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#2b}
292 \DeclareLinkFallback{Macro}{large}
293 {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#b3}
294 \DeclareLinkFallback{Macro}{pageref}
295 {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#2b}
296 \DeclareLinkFallback{Macro}{paragraph}
297 {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#2a}
298 \DeclareLinkFallback{Macro}{ref}
299 {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#2b}
300 \DeclareLinkFallback{Macro}{section}
301 {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#2a}
302 \DeclareLinkFallback{Macro}{subparagraph}
303 {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#2a}
304 \DeclareLinkFallback{Macro}{usepackage}
305 {http://mirrors.ctan.org/info/lshort/english/lshort.pdf#13}
306
307 \DeclareLinkFallback{Macro}{addsec}
308 {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:maincls.cmd.addsec}
309 \DeclareLinkFallback{Macro}{markboth}
310 {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:maincls.cmd.markboth}
311 \DeclareLinkFallback{Macro}{markright}
312 {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:maincls.cmd.markright}
313
314 \DeclareLinkFallback{Macro}{newkomafont}
315 {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:maincls-experts.cmd.newkomafont}
316
317 \DeclareLinkFallback{Macro}{providecaptionname}
318 {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:scrbase.cmd.providecaptionname}
319
320 \DeclareLinkFallback{Macro}{KOMAoption}
321 {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:scrextend.cmd.KOMAoption}
322 \DeclareLinkFallback{Macro}{KOMAoptions}
323 {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:scrextend.cmd.KOMAoptions}
324 \DeclareLinkFallback{Macro}{addtokomafont}
325 {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:scrextend.cmd.addtokomafont}
326 \DeclareLinkFallback{Macro}{setkomafont}
327 {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:scrextend.cmd.setkomafont}
328 \DeclareLinkFallback{Macro}{usekomafont}
329 {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:scrextend.cmd.usekomafont}
330 \DeclareLinkFallback{Macro}{usekomafont}
331 {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:maincls-experts.cmd.newkomafont}
332
333 \DeclareLinkFallback{Macro}{DeclareTOCStyleEntry}
334 {http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguide-en.pdf#desc:tocbasic.cmd.DeclareTOCStyleEntry}
335 \begin{document}
336 \nocite{pkg:koma-script}
337 \DocInput{contract.dtx}
338 \end{document}
339 %</dtx>
340 % \fi
341 %
342 % \changes{v0.0.1}{2023-10-10}{new \KOMAScript{} spin-off}
343 % \changes{v0.9}{2024-02-02}{first release as standalone package}
344 %
345 % \GetFileInfo{contract.dtx}
346 % \title{%^^A
347 % \LaTeX{} Package \pkg*{contract}%^^A
348 % \thanks{%^^A
349 % The repository of this package can be found at
350 % \url{https://codeberg.org/komascript/latex-contract.git}
351 % where you also should report issues.%^^A
352 % }%^^A
353 % }
354 % \date{Version \fileversion{} of \filedate}
355 % \author{\href{mailto:[email protected]}{Markus Kohm}}
356 % \maketitle
357 % \begin{abstract}
358 % The \pkg*{contract} package is intended for cautelar jurisprudence. It is
359 % intended to provide flexible help for lawyers and notaries in drafting
360 % contracts, statutes and legal commentaries. It has been developed in
361 % cooperation with Dr~Alexander Willand, and is still in the process of
362 % development.
363 %
364 % Package \pkg*{contract} is a
365 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} spin-off. It has
366 % been released from 2011 till 2023 as \pkg*{scrjura}. With
367 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} 3.42
368 % \pkg*{scrjura} is removed from
369 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} and released as
370 % new package \pkg*{contract}.
371 % \end{abstract}
372 %
373 % \tableofcontents
374 % \listoftables
375 % \listoffigures
376 %
377 % \addpart{User Manual}
378 %
379 % If you want to write a contract\Index{contract}, the articles of association
380 % for a company or an association, a law, or a legal commentary, the package
381 % \pkg*{contract} will provide typographical support. Although \pkg*{contract}
382 % is intended to provide general help for legal documents, the contract is the
383 % central element of the package. Particular attention is paid to
384 % clauses\Index{clause}, titles, and numbered provisions\,---\,if there are
385 % several of them in a clause\,---, numbered sentences, entries in the table
386 % of contents, and cross references according to German standards.
387 %
388 % The package has been developed in cooperation with Dr Alexander Willand of
389 % Karls\-ruhe. Many of its features go back to constructive inquiries from
390 % Prof Heiner Richter of the Hochschule Stralsund University of Applied
391 % Sciences.
392 %
393 % Some of you may search for the German user manual formally available in
394 % \cite{pkg:koma-script:manual:de}. The author's acute overload has resulted
395 % in this no longer being freely available. However, the corresponding chapter
396 % in \cite{bk:koma-script} and \cite{ebk:koma-script} is still accessible and
397 % applicable with appropriate adjustments to the package name.
398 %
399 %
400 % \section{Package Loading and Option Setting}
401 %
402 % You can load the package as common using:
403 % \begin{syntax}
404 % \cs{usepackage}\oarg{options}|{contract}|\quad.
405 % \end{syntax}
406 % In case of package \pkg*{contract} the \meta{options} are
407 % \meta{key}|=|\meta{value} options.
408 % \begin{description}
409 % \item[Note:] In case of using package \pkg*{contract} with package
410 % \pkg{hyperref} you should load \pkg{hyperref} always after
411 % \pkg*{contract}.
412 % \end{description}
413 %
414 % \DescribeCommand\contractSetup
415 % To change options after loading the package, you should use:
416 % \begin{syntax}
417 % \cs{contractSetup}\marg{options}
418 % \end{syntax}
419 % with \meta{options} is a comma separated list of \meta{key}=\meta{value}
420 % options as explained before.
421 % \begin{description}
422 % \item[Note:] Currently the options are still implemented using the internal
423 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} package
424 % \href{https://www.ctan.org/pkg/koma-script}{\pkg*{scrkbase}}\footnote{You
425 % need at least \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}
426 % v3.39 to have \pkg*{scrkbase} and all other \KOMAScript{} packages
427 % required by \pkg*{scrkbase} and \pkg*{contract} installed. If you use
428 % the recommended installation with the package manager of your
429 % \TeX{} distribution this version requirement should be fulfilled by
430 % installing the \KOMAScript{} package or by updating an already
431 % installed \KOMAScript.}. Therefore
432 % you could also setup \meta{options} using the
433 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} commands
434 % \cs{KOMAoptions} or \cs{KOMAoption}, which are described in
435 % \cite{pkg:koma-script:manual:en}. Moreover, because of the implementation,
436 % currently \cs{contractSetup} could also be used to setup other
437 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} options not
438 % related to package \pkg*{contract}. However, you should avoid this,
439 % because it will fail, when the implementation will be changed.
440 % \end{description}
441 %
442 % \section{Changing the Fonts of Elements}
443 % \label{sec:textmarkup}
444 %
445 % Currently package \pkg*{contract} still uses the font selection features of
446 % the internal \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}
447 % package \pkg{scrkbase}. So the commands \cs{setkomafont},
448 % \cs{addtokomafont}, and \cs{usekomafont}, which are described in
449 % \cite{pkg:koma-script:manual:en}, can be used to change the fonts of the
450 % following elements:
451 % \begin{description}\setkomafont{descriptionlabel}{}
452 % \item[{\fnt{Clause}:}] \hfill\\
453 % Alias for \fnt{\meta{environment}.Clause} within any contract environment,
454 % e.\,g., \fnt{contract.Clause} within environment \env{contract}. If no
455 % corresponding element is defined, \fnt{contract.Clause} is used.
456 % \item[{\fnt{contract.Clause}:}]
457 % \hfill\mbox{(Default: \cs{sffamily}\cs{bfseries}\cs{large})}\\
458 % The heading of a \cs{Clause} within the environment \env{contract}.
459 % \item[{\fnt{\meta{environment}.Clause}:}]
460 % \hfill\mbox{(Default: \emph{none})}\\
461 % The heading of a \cs{Clause} within environment \meta{environment}, which
462 % has been defined using \cs{DeclareNewJuraEnvironment}, if the font has
463 % been setup using property |ClauseFont| or the element has been defined
464 % explicitly.
465 % \item[{\fnt{parnumber}:}]
466 % \hfill\mbox{(Default: \emph{empty})}\\
467 % The paragraph number within a contract environment.
468 % \item[{\fnt{sentencenumber}:}]
469 % \hfill\mbox{(Default: \emph{empty})}\\
470 % The sentence number printed by \cs{Sentence}.
471 % \end{description}
472 %
473 % \begin{description}
474 % \item[Note:] There are plans to no longer use package \pkg*{scrkbase}, but
475 % maybe package \pkg{scrextend} instead, if \pkg*{scrjura} is used with a
476 % non-\KOMAScript{} class. So the commands \cs{setkomafont},
477 % \cs{addtokomafont} and \cs{usekomafont} would still be available in
478 % future.
479 % \end{description}
480 %
481 % \section{Clauses in the Table of Contents}
482 % \label{sec:toc}
483 %
484 % The headings of clauses can also be added automatically to the table of
485 % contents, if desired. For this the package uses command
486 % \cs{DeclareTOCStyleEntry} of
487 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} package
488 % \pkg{tocbasic} to define an entry level named |cpar|. Usage of package
489 % \pkg{tocbasic} also means, that you should not use another package to
490 % configure the Table of Contents, e.g., \pkg{tocloft}, \pkg{tocstyle} etc.
491 %
492 % \DescribeOption{juratotoc}
493 % \SpecialOptionIndex{juratotoc\quotechar=\meta{boolean}}
494 % \SpecialOptionIndex{juratotoc\quotechar=\meta{integer}}
495 % Clauses\Index{clause} are shown in the table of contents only if their
496 % level number is less than or equal to the
497 % \cnt{tocdepth} counter. By default, the level
498 % number is \len{maxdimen}, which is also used if the option is switched
499 % off using \opt[element=juratotoc]{juratotoc=false}. Because the
500 % \cnt{tocdepth} counter usually has a one-digit value,
501 % clause entries are therefore not normally displayed in the table of contents.
502 %
503 % If you switch on the option using the
504 % \opt[element=juratotoc]{juratotoc=true}, the level number 2 is used so that
505 % clauses are shown in the table of contents on the same level as
506 % subsections. For the default setting of \cnt{tocdepth}, clauses are then
507 % shown in all \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}
508 % classes or standard classes.
509 %
510 % You can also use \opt[element=juratotoc]{juratotoc=\meta{integer}} to use
511 % \meta{integer} instead of \len{maxdimen} or 2 as level number.
512 %
513 % Internally usage of this option results in a call of
514 % \begin{syntax}
515 % \cs{DeclareTOCStyleEntry}\toarg{level=\meta{integer}}\targ{default}\targ{cpar}
516 % \end{syntax}
517 % respectively
518 % \begin{syntax}
519 % \cs{DeclareTOCStyleEntry}\toarg{level=2}\targ{default}\targ{cpar}
520 % \end{syntax}
521 % respectively
522 % \begin{syntax}
523 % \cs{DeclareTOCStyleEntry}\toarg{level=\cs{maxdimen}}\targ{default}\targ{cpar}\quad.
524 % \end{syntax}
525 %
526 % \DescribeOption[noindex]{juratocindent}
527 % \SpecialOptionIndex{juratocindent\quotechar=\meta{length}}
528 % \DescribeOption[noindex]{juratocnumberwidth}
529 % \SpecialOptionIndex{juratocnumberwidth\quotechar=\meta{length}}
530 % These options determine the indentation and spacing for clause entries in
531 % the table of contents. Any valid \meta{length} can be assigned. The defaults
532 % are the same as for subsection entries in \cls{scrartcl}.
533 %
534 % Internally, usage of these options results in calls to:
535 % \begin{syntax}
536 % \cs{DeclareTOCStyleEntry}\toarg{indent=\meta{length}}\targ{default}\targ{cpar}
537 % \end{syntax}
538 % respective
539 % \begin{syntax}
540 % \cs{DeclareTOCStyleEntry}\toarg{numwidth=\meta{length}}\targ{default}\targ{cpar}\quad.
541 % \end{syntax}
542 %
543 % \section{Environment for Contracts}
544 % \label{sec:contract}
545 %
546 % The essential mechanisms of package \pkg*{contract} are available only
547 % inside contract environments, either the predefined \env{contract} or any
548 % other environment defined with command \cs{DeclareNewJuraEnvironment}.
549 %
550 % \DescribeEnv{contract}^^A
551 % Currently, this is the one and only predefined environment for
552 % \pkg*{contract}. Using it activates automatic numbering of paragraphs and
553 % the \cs{Clause} and \cs{SubClause} commands, which will be documented below,
554 % are given concrete form.
555 %
556 % The \env{contract} environment must
557 % not be nested within itself. Within a document, however, you can use the
558 % environment several times. The clauses within these environments are treated
559 % as if they were within a single environment. As a result, ending the
560 % environment really only temporarily interrupts it, and the old environment is
561 % continued by the beginning of a new environment. However, you cannot end the
562 % environment within a clause. If you want instead print several contracts,
563 % you would need to define several contract environments using command
564 % \cs{DeclareNewJuraEnvironment}.
565 %
566 % \DescribeOption{contract}
567 % The whole document becomes a contract\Index{contract} if you use this option
568 % while loading the package with:
569 % \begin{syntax}
570 % \cs{usepackage}\toarg{\opt{contract}}\targ{contract}
571 % \end{syntax}
572 % or as a global option with \cs{documentclass}. The document then behaves
573 % exactly as if it would contain one \env{contract} environment.
574 %
575 %
576 % \subsection{Clauses}
577 % \label{sec:clause}
578 %
579 % Clauses^^A
580 % \Index[see{clause}]{section}^^A
581 % \Index[see{clause}]{paragraph}^^A
582 % \Index[indexmain]{clause}^^A
583 % \footnote{%^^A
584 % In English, a ``clause'' in a legal document is a section, paragraph, or
585 % phrase that relates to a particular point. Although it is common in English
586 % to also use the terms ``article'' or ``section'' for what we here call a
587 % ``clause'', we use the latter term throughout to avoid confusion with the
588 % \cls{article} class and the \cs{section} and
589 % \cs{paragraph} sectioning divisions of most document
590 % classes.} in a legal sense are defined in package \pkg*{contract} only
591 % within contracts\Index{contract}, that is inside the
592 % \env{contract} environment or other environments declared
593 % with \cs{DeclareNewJuraEnvironment}.
594 %
595 % \DescribeCommand{\Clause}
596 % \DescribeCommand{\SubClause}
597 % Each clause starts either with \cs{Clause}\oarg{property list} or
598 % \cs{SubClause}\oarg{property list}. The optional argument \meta{property
599 % list} is a comma separated list of \meta{key}|=|\meta{value}.
600 %
601 % These are the most important commands inside of a contract. Without using
602 % any additional \meta{key}, \cs{Clause} creates the heading of a clause,
603 % which consists of the sign ``\S'', followed by its number. In contrast,
604 % \cs{SubClause} creates the heading of a clause with the last number used by
605 % \cs{Clause} and adds a lower-case letter. \cs{SubClause} is mainly intended
606 % for cases where an act or a contract is amended and not only are clauses
607 % changed or deleted but new clauses are inserted between existing ones
608 % without completely changing the numbering.
609 %
610 % Both commands accept a comma-separated list of \meta{key}|=|\meta{value}
611 % properties and also some \meta{key}s without value. An overview
612 % of the available properties is shown in \autoref{tab:Clause.options}.
613 % The most important of them will be discussed in more detail.
614 %
615 % \begin{table}
616 % \captionabove{Available properties for the optional argument of
617 % \cs{Clause} and \cs{SubClause}}%^^A
618 % \label{tab:Clause.options}
619 % \begin{desctabular}
620 % \entry{|dummy|}{%^^A
621 % The heading will not be printed but is counted in the automatic
622 % numbering.%^^A
623 % }%^^A
624 % \entry{|head=|\meta{running head}}{%^^A
625 % If running heads are active, this \meta{running head} is used instead
626 % of the clause \meta{title}.%^^A
627 % }%^^A
628 % \entry{|nohead|}{%^^A
629 % The running head stays unchanged.%^^A
630 % }%^^A
631 % \entry{|notocentry|}{%^^A
632 % Does not make an entry into the table of contents.%^^A
633 % }%^^A
634 % \entry{|number=|\meta{number}}{%^^A
635 % Uses \meta{number} for the output of the clause number.%^^A
636 % }%^^A
637 % \entry{|preskip=|\meta{skip}}{%^^A
638 % Changes the vertical \meta{skip} before the clause heading.%^^A
639 % }%^^A
640 % \entry{|postskip=|\meta{skip}}{%^^A
641 % Changes the vertical \meta{skip} after the clause heading.%^^A
642 % }%^^A
643 % \entry{|title=|\meta{title}}{%^^A
644 % The clause \meta{title} will be printed in addition to the clause
645 % number. This is also used as the default for the \meta{running head}
646 % and the \meta{entry} in the table of contents.%^^A
647 % }%^^A
648 % \entry{|tocentry=|\meta{entry}}{%^^A
649 % Regardless of the clause \meta{title}, an \meta{entry} into the
650 % table of contents will be made, if such entries are activated (see
651 % option \opt{juratotoc}).%^^A
652 % }%^^A
653 % \end{desctabular}
654 % \end{table}
655 %
656 % By default, a skip of two lines is inserted before the heading and a skip of
657 % one line afterwards. You can change the size of these skips with the
658 % |preskip| and |postskip| properties. The new values apply not only
659 % to the current clause but from the current clause until the end of the
660 % current contract environment. You can also make the appropriate settings in
661 % advance with
662 % \begin{syntax}
663 % \cs{setkeys}\targ{\env{contract}}%^^A
664 % \targ{preskip=\meta{skip},postskip=\meta{skip}}
665 % \end{syntax}
666 % regardless of the specific clause and outside of a contract environment. You
667 % can also set these options inside the preamble after loading
668 % \pkg*{contract}, but you cannot set them while loading the package or by
669 % using \cs{contractSetup}.
670 %
671 % By default, clause headings use the font style
672 % \cs{sffamily}\cs{bfseries}\cs{large}. See \autoref{sec:textmarkup} for
673 % information about how to change the font for element \fnt{contract.Clause}.
674 %
675 % With the |title|, |head|, and |tocentry| property, you can title a clause in
676 % addition to the number. You should enclose the \meta{value} of each property
677 % inside curly brackets. Otherwise, for example, commas which are meant to be
678 % part of the \meta{value} will be confused with the delimiters between
679 % different properties of the \meta{property list}. Empty values for |head|
680 % and |tocentry| cause empty entries. If you want to avoid an entry, use the
681 % |nohead| resp. |notocentry| property.
682 %
683 % Instead of consecutive numbers, you can also set a clause number manually
684 % with the |number| property. However, this does not affect the numbers of
685 % the subsequent clauses. Empty numbers are not possible. Fragile commands
686 % inside |number| have to be protected with \cs{protect}. You should use
687 % only numbers and letters as a |number|.
688 %
689 % With the |dummy| property, you can suppress the output of the whole heading
690 % of a clause. The automatic numbering, however, will still count this
691 % clause. In this way, you can skip an automatically numbered clause with
692 %\begin{syntax}
693 % \cs{Clause}\toarg{dummy}
694 %\end{syntax}
695 % in case the clause corresponding clause has been deleted in a later version
696 % of a contract.
697 %
698 % Note that the |dummy| property only accepts the \meta{value}s |true| and
699 % |false|. All other \meta{value}s are usually ignored, but can lead to an
700 % error message in the worst case scenario.
701 %
702 % \DescribeCommand{\Clauseformat}
703 % As already mentioned, clauses and subclauses are normally numbered. The
704 % number is formatted with the help of the \cs{Clauseformat} command, which
705 % expects the \meta{number} as the only argument. The default is the
706 % following:
707 %\begin{syntax}
708 % \cs{newcommand*}\targ{\cs{Clauseformat}}\toarg{1}\targ{\cs{S}~\#1}
709 %\end{syntax}
710 % This produces the section mark, \cs{S} (\S), followed by a non-breaking
711 % space and the number. If you redefine this command, be sure it remains
712 % expandable.
713 %
714 % \DescribeOption{juratitlepagebreak}^^A
715 % \SpecialOptionIndex{juratitlepagebreak\quotechar=\meta{boolean}}^^A
716 % Usually, page breaks are prohibited within heading of all kinds. However,
717 % some lawyers require page breaks within clause headings. You can allow such
718 % a break by using option \opt{juratitlepagebreak} or
719 % \opt[element=juratitlepagebreak]{juratitlepagebreak=\meta{boolean}}. Boolean
720 % values of \texttt{true} or \texttt{false} can be used to toggle the option
721 % on or off. Using the option without a value is the same as using
722 % \texttt{true}. The option can be used as an optional argument of
723 % \cs{documentclass}, \cs{usepackage} when loading package \pkg*{contract}, or
724 % as an argument of \cs{contractSetup}.
725 %
726 % \DescribeOption[noindex]{clausemark}
727 % \SpecialOptionIndex{clausemark\quotechar=\meta{value}}
728 % Since clauses are a subordinate structure with independent numbering, they
729 % do not produce running heads by default. You can, however, create running
730 % heads with various settings using:
731 % \begin{syntax}
732 % \opt{clausemark}=\meta{value}
733 % \end{syntax}
734 % as an optional argument of \cs{documentclass}, \cs{usepackage} when loading
735 % package \pkg*{contract}, or as an argument of \cs{contractSetup}. You can
736 % find the available \meta{value}s and their meanings in
737 % \autoref{tab:clausemark}.
738 % \begin{table}
739 % \captionabove{Available values for the \opt{clausemark} option to
740 % activate running heads}%^^A
741 % \label{tab:clausemark}%^^A
742 % \begin{desctabular}
743 % \entry{\optvalue{both}}{%^^A
744 % Clauses generate left and right marks for running heads, if the
745 % document provides automatic running heads.%^^A
746 % \SpecialOptionIndex{clausemark\quotechar=both}%^^A
747 % }%^^A
748 % \entry{\optvalue{false}, \optvalue{off}, \optvalue{no}}{%^^A
749 % Clauses do not generate marks for running heads and therefore do not
750 % change running heads.%^^A
751 % \SpecialOptionIndex{clausemark\quotechar=false}%^^A
752 % }%^^A
753 % \entry{\optvalue{forceboth}}{%^^A
754 % Clauses use \cs{markboth} to generate left and right
755 % marks for running heads even if the document does not provide
756 % automatic running heads for the current page style.%^^A
757 % \SpecialOptionIndex{clausemark\quotechar=forceboth}%^^A
758 % }%^^A
759 % \entry{\optvalue{forceright}}{%^^A
760 % Clauses use \cs{markright} to generate right marks for
761 % running heads even if the document does not provide automatic running
762 % heads for the current page style.%^^A
763 % \SpecialOptionIndex{clausemark\quotechar=forceright}%^^A
764 % }%^^A
765 % \entry{\optvalue{right}}{%^^A
766 % Clauses generate right marks for running heads, if the document
767 % provides automatic running heads.%^^A
768 % \SpecialOptionIndex{clausemark\quotechar=right}%^^A
769 % }%^^A
770 % \end{desctabular}
771 % \end{table}
772 %^^A
773 %
774 %
775 % \subsection{Paragraphs}
776 % \label{sec:par}
777 % \Index{paragraph>numbering}%^^A
778 % Within clauses, \pkg*{contract} usually numbers paragraphs automatically.
779 % With this, the paragraphs provide a powerful structuring element, similar to
780 % \cs{paragraph} or \cs{subparagraph} in
781 % normal documents. For this reason, contracts usually use a vertical skip
782 % between paragraphs. The \pkg*{contract} package does not provide its own
783 % mechanism for this. Instead, you should uses the
784 % \opt{parskip}\SpecialOptionIndex{parskip} option of the
785 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}
786 % classes. If you do not use a
787 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} class, see the
788 % documentation of the used class or package \pkg{parskip}
789 % \nocite{pkg:parskip}\cite{pkg:parskip:manual}.
790 %
791 %
792 % \DescribeOption{parnumber}
793 % \SpecialOptionIndex{parnumber\quotechar=\meta{value}}
794 % The option can be used as an optional argument of \cs{documentclass},
795 % \cs{usepackage} when loading package \pkg*{contract}, or as an argument of
796 % \cs{contractSetup}.
797 %
798 % The default numbering of paragraphs is
799 % \opt[element=parnumber]{parnumber=auto}\SpecialOptionIndex{parnumber\quotechar=auto}
800 % and
801 % \opt[element=parnumber]{parnumber=true}\SpecialOptionIndex{parnumber\quotechar=true}. Sometimes
802 % you may need to disable the automatic numbering. You can do this with
803 % \opt[element=parnumber]{parnumber=false}\SpecialOptionIndex{parnumber\quotechar=false}.
804 % In this case, only the sentence numbering is reset.
805 %
806 % To implement this option, it has been necessary to hook into the
807 % paragraph-building mechanism of \LaTeX. In some rare cases, this can have a
808 % negative effect. If so, you can undo the change with
809 % \opt[element=parnumber]{parnumber=manual}\SpecialOptionIndex{parnumber\quotechar=manual}.
810 % On the other hand, \LaTeX{} itself sometimes undoes the change. In those
811 % cases you can activate it again with
812 % \opt[element=parnumber]{parnumber=auto}\SpecialOptionIndex{parnumber\quotechar=auto}.
813 %
814 % Clauses that consist of a single paragraph do not automatically receive a
815 % paragraph number. For this to work, there must not be two clauses with an
816 % identical number in a document. However should you ever need such numbering,
817 % you should switch to another contract environment (see
818 % \cs{DeclareNewJuraEnvironment}). Note that the number of
819 % paragraphs in a clause is not available before the end of the
820 % clause. Therefore you need a least two \LaTeX{} runs before the automatic
821 % paragraph numbering is correct.
822 %
823 %
824 % \DescribeCounter{par}
825 % \DescribeCommand{\thepar}
826 % \DescribeCommand{\parformat}
827 % \DescribeCommand{\parformatseparation}
828 % For numbering the paragraphs inside a clause we use the \cnt{par} counter.
829 % The output of \cs{thepar} will display an Arabic number, because the
830 % default is \cs{arabic}\targ{par}. \cs{parformat} provides the
831 % format, which is \cs{thepar} in rounded brackets. When numbering a
832 % paragraph manually, you should also use \cs{parformat}. It makes sense to
833 % call \cs{parformat} with a subsequent \cs{parformatseparation}, or at
834 % least a \cs{nobreakspace} or tilde.
835 %
836 % With automatic numbering, \cs{parformat} is followed by
837 % \cs{parformatseparation}, which currently consists of
838 % \cs{nonbreakspace}, the non-breakable space.
839 %
840 % The paragraph number is usually printed using the currently active font.
841 % See \autoref{sec:textmarkup} for information how to change the font of the
842 % \fnt{parnumber} element.
843 %
844 % \begin{description}
845 % \item{Note:} \pkg*{contract} currently assumes internally that
846 % \cs{thepar} is an Arabic number. Therefore you should definitely not
847 % redefine it!
848 % \end{description}
849 %
850 %
851 % \DescribeCommand{\withoutparnumber}
852 % If the paragraph number is not printed, \pkg*{contract} executes the
853 % \cs{withoutparnumber} command at the beginning of the new paragraph. The
854 % initial definition of this command is empty. This means it is a kind of
855 % dummy command that does nothing. It has been implemented because of a user
856 % request. Most users can ignore this command.
857 %
858 %
859 % \DescribeCommand{\ellipsispar}
860 % \DescribeCommand{\parellipsis}
861 % Sometimes\,---\,particularly in comparative commentaries\,---\,it is
862 % desirable to omit paragraphs but to mark the omission. Those omitted
863 % paragraphs\Index{paragraph>omission} should be taken into account by the
864 % paragraph counter. The package \pkg*{contract} provides the command
865 % \cs{ellipsispar} to do this.
866 %
867 % By default, \cs{ellipsispar} omits precisely one paragraph. Using the
868 % optional argument of
869 % \begin{syntax}
870 % \cs{ellipsispar}\oarg{number}
871 % \end{syntax}
872 % you can omit multiple paragraphs. In any case, the output shows just one
873 % unnumbered paragraph, which consists only of the ellipsis defined by
874 % \cs{parellipsis}. The automatic numbering of paragraphs takes the
875 % \meta{number} of omitted paragraphs into account.
876 % \begin{Example}
877 % Suppose you are writing a comment on the German\footnote{Please remember,
878 % this translation does not refer to an existing law but is only an example
879 % of how you might realise such a commentary with \pkg*{contract}.} penal
880 % code, but only on paragraph 3 of \S~2. Nevertheless, you'd like to
881 % indicate the omission indirectly. You can do this with:
882 %\begin{lstcode}[gobble=1]
883 % \documentclass[parskip=half]{scrartcl}
884 % \usepackage{contract}
885 % \begin{document}
886 % \begin{contract}
887 % \Clause{title={Temporal application},number=2}
888 % \ellipsispar[2]
889 %
890 % If the law that applies at the time the criminal act is
891 % committed is changed before the verdict, then the most
892 % lenient law shall be applicable.
893 %
894 % \ellipsispar[3]
895 % \end{contract}
896 % \end{document}
897 %\end{lstcode}
898 % To see the result, just give it a try.
899 % \end{Example}
900 %
901 % The ellipsis is by default \cs{textellipsis}, if such a command is
902 % defined. If not, \cs{dots} is used. You can redefine \cs{parellipsis} at any
903 % time with \cs{renewcommand}.
904 %
905 %
906 % \subsection{Sentences}
907 % \label{sec:sentence}
908 %
909 % \Index{sentence>number}%^^A
910 % Paragraphs in contracts consist of one or more sentences, some of which may
911 % also be numbered. However, as automatic numbering is cumbersome and
912 % error-prone, it has not yet been implemented in
913 % \pkg*{contract}. Semi-automatic numbering, however, is supported.
914 %
915 % \DescribeCounter{sentence}
916 % \DescribeCommand{\thesentence}
917 % \DescribeCommand{\sentencenumberformat}
918 % \DescribeCommand{\Sentence}
919 % Manual numbering of sentences is done with the \cs{Sentence} command. It
920 % adds one to the \cnt{sentence} counter. By default,
921 % \cs{sentencenumberformat} prints \cs{thesentence} as an Arabic number in
922 % superscript.
923 %
924 % The sentence number is usually printed using the currently active font.
925 % See \autoref{sec:textmarkup} for information how to change the font of the
926 % \fnt{sentencenumber} element.
927 %
928 % Using \pkg{babel} offers an easy way to define a shorthand for
929 % \cs{Sentence}:%^^A
930 % \phantomsection\label{sec:shorthandexample}%^^A
931 %\begin{lstcode}[moretexcs={useshorthands,defineshorthand},gobble=1]
932 % \useshorthands{'}
933 % \defineshorthand{'S}{\Sentence\ignorespaces}
934 %\end{lstcode}
935 % With this definition, any space after \lstinline|'S| will be ignored. You
936 % can even use the dot as an abbreviation for a dot and a new sentence number:
937 %\begin{lstcode}[moretexcs={useshorthands,defineshorthand},gobble=1]
938 % \defineshorthand{'.}{. \Sentence\ignorespaces}
939 %\end{lstcode}
940 % For details regarding \cs{useshorthands} and \cs{defineshorthand},
941 % please consult the manual of the \pkg{babel} package (see
942 % \cite{pkg:babel}). You can find an example of their application in
943 % \autoref{sec:example}, \autopageref{sec:example}.%^^A
944 %
945 %
946 % \section{Cross References}
947 % \label{sec:ref}
948 %
949 % The conventional mechanism to set cross references using \cs{label},
950 % \cs{ref}, and \cs{pageref} does not suffice for clauses, paragraphs, and
951 % sentences. Therefore \pkg*{contract} provides additional commands.
952 %
953 % \DescribeCommand{\ref}
954 % \DescribeCommand{\refL}
955 % \DescribeCommand{\refS}
956 % \DescribeCommand{\refN}
957 % The commands
958 % \begin{syntax}
959 % \cs{ref}\marg{label}
960 % \cs{refL}\marg{label}
961 % \cs{refS}\marg{label}
962 % \cs{refN}\marg{label}
963 % \end{syntax}
964 % give a full reference to clause, paragraph and sentence. \cs{refL} is a long
965 % text, \cs{refS} a short text, and \cs{refN} an abbreviated, numeric form.
966 % \cs{ref} defaults to \cs{refL}.
967 %
968 %
969 % \DescribeCommand{\refClause}
970 % \DescribeCommand{\refClauseN}
971 % The commands
972 % \begin{syntax}
973 % \cs{refClause}\marg{label}
974 % \cs{refClauseN}\marg{label}
975 % \end{syntax}
976 % reference a clause without displaying the paragraph or
977 % sentences. \cs{refClause} puts a section mark (\S) in front of the
978 % reference, while \cs{refClauseN} does not.
979 %
980 %
981 % \DescribeCommand{\refPar}
982 % \DescribeCommand{\refParL}
983 % \DescribeCommand{\refParS}
984 % \DescribeCommand{\refParN}
985 % The commands
986 % \begin{syntax}
987 % \cs{refPar}\marg{label}
988 % \cs{refParL}\marg{label}
989 % \cs{refParS}\marg{label}
990 % \cs{refParN}\oarg{number format}\marg{label}
991 % \end{syntax}
992 % reference a paragraph of a clause. The differences between the forms
993 % correspond to the differences between \cs{refL}, \cs{refN} and \cs{refS}. A
994 % feature worth noting is the optional argument of \cs{refParN}. Usually the
995 % numeric reference to a paragraph uses a Roman number. You can, however,
996 % specify a different \meta{number format} in the optional argument. This
997 % option primarily makes sense to use Arabic numbers. By default, \cs{refPar}
998 % is \cs{refParL}.
999 %
1000 %
1001 % \DescribeCommand{\refSentence}
1002 % \DescribeCommand{\refSentenceL}
1003 % \DescribeCommand{\refSentenceS}
1004 % \DescribeCommand{\refSentenceN}
1005 % The commands
1006 % \begin{syntax}
1007 % \cs{refSentence}\marg{label}
1008 % \cs{refSentenceL}\marg{label}
1009 % \cs{refSentenceS}\marg{label}
1010 % \cs{refSentenceN}\marg{label}
1011 % \end{syntax}
1012 % reference a sentence of a paragraph. Again, there is a long text form, a
1013 % short text form, and a numerical form. By default, \cs{refSentence} is
1014 % \cs{refSentenceL}.%^^A
1015 %
1016 %
1017 % \DescribeOption[noindex]{ref}
1018 % \SpecialOptionIndex{ref\quotechar=\meta{value}}
1019 % The results of \cs{ref}, \cs{refPar}, and \cs{refSentence} depend on the
1020 % option
1021 % \begin{syntax}
1022 % \opt{ref}|=|\meta{value}
1023 % \end{syntax}
1024 % that can be used as an optional argument of \cs{documentclass},
1025 % \cs{usepackage} when loading package \pkg*{contract}, or as an argument of
1026 % \cs{contractSetup}. The default is \opt[element=ref]{ref=long} and
1027 % therefore \cs{refL}, \cs{refParL} and \cs{refSentenceL}. You can find the
1028 % available \meta{value}s for his option and their meaning in
1029 % \autoref{tab:ref}.%^^A
1030 % %^^A
1031 % \begin{table}
1032 % \captionabove[{%^^A
1033 % Available values for the \opt{ref} option to configure the
1034 % cross reference format%^^A
1035 % }]{%^^A
1036 % Available values for the \opt{ref} option to configure the
1037 % cross reference format of \cs{ref},
1038 % \cs{refPar}, and \cs{refSentence}%^^A
1039 % \label{tab:ref}%^^A
1040 % }%^^A
1041 % \begin{desctabular}
1042 % \entry{\optvalue{long}}{%^^A
1043 % A combination of \optvalue{parlong} and \optvalue{sentencelong}.%^^A
1044 % \SpecialOptionIndex{ref\quotechar=long}%^^A
1045 % }%^^A
1046 % \entry{\optvalue{numeric}}{%^^A
1047 % A combination of \optvalue{parnumeric} and
1048 % \optvalue{sentencenumeric}.%^^A
1049 % \SpecialOptionIndex{ref\quotechar=numeric}%^^A
1050 % }%^^A
1051 % \entry{\optvalue{clauseonly}, \optvalue{onlyclause},\\
1052 % \optvalue{ClauseOnly}, \optvalue{OnlyClause}}{%^^A
1053 % A combination of \optvalue{paroff} and \optvalue{sentenceoff}. Note
1054 % that \cs{refPar} and \cs{refSentence}
1055 % produce empty results!%^^A
1056 % \SpecialOptionIndex{ref\quotechar=long}%^^A
1057 % }%^^A
1058 % \entry{\optvalue{parlong}, \optvalue{longpar},\\
1059 % \optvalue{ParL}}{%^^A
1060 % Paragraphs are referenced in long textual form.%^^A
1061 % \SpecialOptionIndex{ref\quotechar=parlong}%^^A
1062 % }%^^A
1063 % \entry{\optvalue{parnumeric}, \optvalue{numericpar}, \optvalue{ParN}}{%^^A
1064 % Paragraphs are referenced in simple numerical form.%^^A
1065 % \SpecialOptionIndex{ref\quotechar=parnumeric}%^^A
1066 % }%^^A
1067 % \entry{\optvalue{paroff}, \optvalue{nopar}}{%^^A
1068 % Paragraphs have no reference. Note that \cs{refPar}
1069 % produces an empty result!%^^A
1070 % \SpecialOptionIndex{ref\quotechar=paroff}%^^A
1071 % }%^^A
1072 % \entry{\optvalue{parshort}, \optvalue{shortpar}, \optvalue{ParS}}{%^^A
1073 % Paragraphs are referenced in short textual form.%^^A
1074 % \SpecialOptionIndex{ref\quotechar=parshort}%^^A
1075 % }%^^A
1076 % \entry{\optvalue{sentencelong}, \optvalue{longsentence}, \\
1077 % \optvalue{SentenceL}}{%^^A
1078 % Sentences are referenced in long textual form.%^^A
1079 % \SpecialOptionIndex{ref\quotechar=parlong}%^^A
1080 % }%^^A
1081 % \entry{\optvalue{sentencenumeric}, \optvalue{numericsentence},\\
1082 % \optvalue{SentenceN}}{%^^A
1083 % Sentences are referenced in simple numeric form.%^^A
1084 % \SpecialOptionIndex{ref\quotechar=sentencenumeric}%^^A
1085 % }%^^A
1086 % \entry{\optvalue{sentenceoff}, \optvalue{nosentence}}{%^^A
1087 % Sentences have no reference. Note that
1088 % \cs{refSentence} produces an empty result!%^^A
1089 % \SpecialOptionIndex{ref\quotechar=sentenceoff}%^^A
1090 % }%^^A
1091 % \entry{\optvalue{sentenceshort}, \optvalue{shortsentence},\\
1092 % \optvalue{SentenceS}}{%^^A
1093 % Sentences are referenced in short textual form.%^^A
1094 % \SpecialOptionIndex{ref\quotechar=sentenceshort}%^^A
1095 % }%^^A
1096 % \entry{\optvalue{short}}{%^^A
1097 % A combination of \optvalue{parshort} and \optvalue{sentenceshort}.%^^A
1098 % \SpecialOptionIndex{ref\quotechar=value}%^^A
1099 % }%^^A
1100 % \end{desctabular}
1101 % \end{table}
1102 %
1103 % \begin{Example}
1104 % Suppose you always want to reference paragraphs in the form ``paragraph 1
1105 % in clause 1''. As there is no predefined command for this, you have to
1106 % create your own definition from the available options. You can achieve
1107 % this easily with:%^^A
1108 %\begin{lstcode}[gobble=1]
1109 % \newcommand*{\refParM}[1]{%
1110 % paragraph~\refParN[arabic]{#1}
1111 % in clause~\refClauseN{#1}%
1112 % }
1113 %\end{lstcode}
1114 % This new command can be used in the same way as
1115 % \cs{refParL}.%^^A
1116 % \end{Example}%^^A
1117 %
1118 % You can find examples of results of the basic commands\,---\,this means the
1119 % commands, that are independent from option \opt{ref}\,---\,in
1120 % \autoref{tab:refexamples}.%^^A
1121 % %^^A
1122 % \begin{table}
1123 % \KOMAoptions{captions=topbeside}%^^A
1124 % \setcapindent{0pt}%^^A
1125 % \begin{captionbeside}{Example outputs of the \opt{ref}-independent
1126 % cross reference commands}[l]
1127 % \begin{tabular}[t]{ll}
1128 % \toprule
1129 % Command & Example output \\
1130 % \midrule
1131 % \cs{refL}\marg{label} & \S{} 1 paragraph 1 sentence 1 \\
1132 % \cs{refS}\marg{label} & \S{} 1 par. 1 sent. 1 \\
1133 % \cs{refN}\marg{label} & \S{} 1 I 1. \\
1134 % \cs{refClause}\marg{label} & \S{} 1 \\
1135 % \cs{refClauseN}\marg{label} & 1 \\
1136 % \cs{refParL}\marg{label} & paragraph 1 \\
1137 % \cs{refParS}\marg{label} & par. 1 \\
1138 % \cs{refParN}\marg{label} & I \\
1139 % \cs{refParN}\toarg{arabic}\marg{label} & 1 \\
1140 % \cs{refParN}\toarg{roman}\marg{label} & i \\
1141 % \cs{refSentenceL}\marg{label} & sentence 1 \\
1142 % \cs{refSentenceS}\marg{label} & sent. 1 \\
1143 % \cs{refSentenceN}\marg{label} & 1. \\
1144 % \bottomrule
1145 % \end{tabular}
1146 % \end{captionbeside}
1147 % \label{tab:refexamples}
1148 % \end{table}
1149 %
1150 %
1151 % \section{Additional Contract Environments}
1152 % \label{sec:newenv}
1153 %
1154 % Some users do not use \pkg*{contract} to draft contracts or commentaries on
1155 % individual laws but to examine different types of laws, which may not
1156 % necessarily use the section prefix (\S) before the title of each clause but
1157 % perhaps something like ``Art.'' or ``IAS'', and so forth. An independent
1158 % counter is also required for each of these different clause types.
1159 %
1160 % \DescribeCommand{\DeclareNewJuraEnvironment}
1161 % You can use:
1162 % \begin{syntax}
1163 % \cs{DeclareNewJuraEnvironment}\marg{environment}\oarg{property list}\\%^^A
1164 % \marg{start commands}\marg{end commands}
1165 % \end{syntax}
1166 % to define new and independent environments for contracts or other legal
1167 % texts. The argument \meta{environment} is the name of the new environment,
1168 % of course. The \meta{start commands} are commands which will be executed at
1169 % the beginning of the environment, as if they were added directly after
1170 % \cs{begin}\marg{environment}. Correspondingly \meta{end commands} will be
1171 % executed at the end of the environment, as if added directly before
1172 % \cs{end}\marg{environment}. Without a \meta{property list} the new
1173 % environment behaves like the \env{contract} environment, but with its own
1174 % counters. You can use several \meta{key}|=|\meta{value} properties as a
1175 % comma-separated \meta{property list}. See
1176 % \autoref{tab:DeclareNewJuraEnvironment} for the currently supported
1177 % \meta{options}.
1178 %
1179 % \begin{table}
1180 % \captionabove{Properties provided by \cs{DeclareNewJuraEnvironment} for
1181 % new contract environments}\label{tab:DeclareNewJuraEnvironment}%^^A
1182 % \begin{desctabular}
1183 % \entry{|Clause=|\meta{command}}{%^^A
1184 % Defines the \meta{command} to which the \cs{Clause}
1185 % command is mapped within the environment. This \meta{command}, like the
1186 % one documented for \env{contract}, expects exactly one
1187 % argument. To use it correctly requires advanced knowledge of the
1188 % \pkg*{contract}'s internal functioning. Furthermore, the requirements
1189 % for the \meta{command} may change in future versions. Therefore it is
1190 % recommended not to use this option!%^^A
1191 % }%^^A
1192 % \entry{|ClauseFont=|\meta{commands}}{%^^A
1193 % If this property is used, a new \fnt{\meta{environment}.Clause}
1194 % element is defined with the
1195 % \meta{commands} used as its default setting. If the element was
1196 % previously defined as an alias, it will become an independent element
1197 % instead. If it has already been defined as an independent element, the
1198 % \meta{commands} are used as new font settings. Please note the
1199 % limitations for font settings in \autoref{sec:textmarkup}.%^^A
1200 % }%^^A
1201 % \entry{|SubClause=|\meta{command}}{%^^A
1202 % Defines the \meta{command} to which the
1203 % \cs{SubClause} command is mapped within the
1204 % environment. This \meta{command}, like the one documented for
1205 % \env{contract}, expects exactly one argument. To use it
1206 % correctly requires advanced knowledge of the \pkg*{contract}'s internal
1207 % functioning. Furthermore, the requirements for the \meta{command} may
1208 % change in future versions. Therefore it is recommended not to use this
1209 % property!%^^A
1210 % }%^^A
1211 % \entry{|Sentence=|\meta{command}}{%^^A
1212 % Defines the \meta{command} to which the \cs{Sentence}
1213 % is mapped within the environment. This \meta{command} must not have an
1214 % argument. Typically it should add one to the
1215 % \cnt{sentence} (using \cs{refstepcounter}) counter and display it
1216 % appropriately. It is particularly important to avoid adding unwanted
1217 % spaces.%^^A
1218 % }%^^A
1219 % \entry{|ClauseNumberFormat=|\meta{command}}{%^^A
1220 % Formats the numbers of clauses within the environment. The
1221 % \meta{command} should expect exactly one argument: the number of the
1222 % clause. If the \meta{command} implements a series of commands and the
1223 % number is the last argument of a that series, you can directly use the
1224 % series of commands as \meta{command}.%^^A
1225 % }
1226 % \end{desctabular}
1227 % \end{table}
1228 % \begin{Example}
1229 % To define the environment for articles we mentioned in the preface of this
1230 % section, it is sufficient to write:
1231 %\begin{lstcode}[gobble=1]
1232 % \DeclareNewJuraEnvironment{Article}[ClauseNumberFormat=Art.~]{}{}
1233 %\end{lstcode}
1234 % If we are using a \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}
1235 % class and want to separate the paragraphs in this environment with space
1236 % instead of using paragraph indentation, we can use:
1237 %\begin{lstcode}[gobble=1]
1238 % \DeclareNewJuraEnvironment{Article}[ClauseNumberFormat=Art.~]
1239 % {\KOMAoptions{parskip}}{}
1240 %\end{lstcode}
1241 % In cross references, ``Art.'' will of course be used instead of ``\S''.%^^A
1242 %
1243 % The new environment is used like \env{contract}:
1244 %\begin{lstcode}[gobble=1]
1245 % \begin{Article}
1246 % \Clause{}
1247 % Human dignity is inviolable. To respect and protect people is a
1248 % duty of all state authority.
1249 % \end{Article}
1250 %\end{lstcode}
1251 % \end{Example}
1252 %
1253 %
1254 % \section{Support for Different Languages}
1255 % \label{sec:babel}
1256 %
1257 % The \pkg*{contract} package has been developed in cooperation with a German
1258 % lawyer. Therefore it initially supported only the languages |german|,
1259 % |ngerman|, |austrian|, and |naustrian|. Nevertheless, it has been designed
1260 % to support common language packages like \pkg{babel}. Users can easily make
1261 % changes by using \cs{providecaptionname}. If you have definitive information
1262 % about the correct legal terms and conventions of a language, please contact
1263 % the \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} author. Support
1264 % for English has been added in this way, and so \pkg*{contract} now also
1265 % provides terms for the languages |english|, |american|, |british|,
1266 % |canadian|, |USenglish|, and |UKenglish|.
1267 %
1268 % \DescribeCommand{\parname}
1269 % \DescribeCommand{\partshortname}
1270 % \DescribeCommand{\sentencename}
1271 % \DescribeCommand{\sentenceshortname}
1272 % These are the language-dependent terms used by \pkg*{contract}. The meaning
1273 % of the terms and their English defaults are shown in
1274 % \autoref{tab:captionnames}. The package itself defines them by
1275 % using \cs{providecaptionname} inside
1276 % \cs{begin}\targ{document} only if other requirements have not already
1277 % been met. If you use \pkg*{contract} with an unsupported language, the
1278 % package will throw an error.%^^A
1279 % %^^A
1280 % \begin{table}
1281 % \KOMAoptions{captions=topbeside}%^^A
1282 % \setcapindent{0pt}%^^A
1283 % \begin{captionbeside}
1284 % [{%^^A
1285 % Meanings and English defaults of language-dependent terms%^^A
1286 % }]{%^^A
1287 % Meanings and English defaults of language-dependent terms, if not
1288 % already defined%^^A
1289 % } [l]
1290 % \begin{tabular}[t]{lll}
1291 % \toprule
1292 % Command & Meaning & Default \\
1293 % \midrule
1294 % \cs{parname} & long form ``paragraph'' & paragraph \\
1295 % \cs{parshortname} & short form ``paragraph'' & par. \\
1296 % \cs{sentencename} & long form ``sentence'' & sentence \\
1297 % \cs{sentenceshortname} & short form ``sentence'' & sent. \\
1298 % \bottomrule
1299 % \end{tabular}
1300 % \end{captionbeside}
1301 % \label{tab:captionnames}
1302 % \end{table}
1303 %
1304 %
1305 %
1306 % \section{A Detailed Example}
1307 % \label{sec:example}
1308 %
1309 % You may remember the letter from the \cls{scrlttr2} chapter of the
1310 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} manual
1311 % \cite{pkg:koma-script:manual:en}, in which a club member wanted to remind
1312 % the board about an overdue meeting that was prescribed by the club's
1313 % by-laws. Such club by-laws are a kind of contract, and you can create them
1314 % using \pkg*{contract}.
1315 %
1316 % \lstinputcode[{xleftmargin=2em,%^^A
1317 % linerange=1-2}]{contract-example-en.tex}%^^A
1318 % We use class \cls{scrartcl}. Because paragraph distance instead of paragraph
1319 % indentation is usual in club by-laws, we load the class with option
1320 % \opt[element=parskip]{parskip=half}.
1321 %
1322 % \lstinputcode[{xleftmargin=2em,%^^A
1323 % linerange=4-4}]{contract-example-en.tex}%^^A
1324 % The club rules are in British English. Therefore we load the \pkg{babel}
1325 % package with the \opt{british} option too.
1326 %
1327 % \lstinputcode[{xleftmargin=2em,%^^A
1328 % linerange={6-6,8-8}}]{contract-example-en.tex}%^^A
1329 % We make some default font settings. Earlier versions of the example also
1330 % loaded the \pkg{textcomp} package here for an improved section mark
1331 % (\S). Since \LaTeX{} 2020/02/01, however, the desired functionality is
1332 % directly integrated in the \LaTeX{} kernel.
1333 %
1334 % \lstinputcode[{xleftmargin=2em,%^^A
1335 % linerange=11-11}]{contract-example-en.tex}%^^A
1336 % Later in the document, we want lists numbered not with Arabic numbers but with
1337 % lower-case letters. We can do this easily with the \pkg{enumerate}
1338 % package. Alternatively, we could have used the \pkg{enumitem} package.
1339 %
1340 % \lstinputcode[{moretexcs={useshorthands,defineshorthand},%^^A
1341 % xleftmargin=2em,%^^A
1342 % linerange=13-21}]{contract-example-en.tex}%^^A
1343 % Now it is time for \pkg*{contract}. The
1344 % \opt[element=clausemark]{clausemark=forceboth}\SpecialOptionIndex{clausemark=forceboth}
1345 % option forces clauses to create left and right marks for the running
1346 % head. On the other hand, we do not want \cs{section} to change the marks for
1347 % the running head. Therefore we use the \pstyle{myheadings} page style. This
1348 % page style generally does not provide automatic running heads.
1349 %
1350 % Later, we also want a table of contents with the clauses. This can be
1351 % achieved with the \opt{juratotoc} option. Doing so we will see that the
1352 % default width for these numbers is insufficient for the clause numbers in
1353 % the table of contents. With
1354 % \opt[element=juratocnumberwidth]{juratocnumberwidth=2.5em}\SpecialOptionIndex{juratocnumberwidth\quotechar=\meta{length}},
1355 % we reserve more space.
1356 %
1357 % The definition of shorthands has already been explained in
1358 % \autoref{sec:shorthandexample}. In this example we do the same thing
1359 % to simplify the input.
1360 %
1361 % \lstinputcode[{xleftmargin=2em,%^^A
1362 % linerange=23-23}]{contract-example-en.tex}%^^A
1363 % It is time to begin the actual document.
1364 %
1365 % \lstinputcode[{xleftmargin=2em,%^^A
1366 % linerange=25-29}]{contract-example-en.tex}%^^A
1367 % Like other documents, the by-laws have a title. We created it with the usual
1368 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} commands%\iffalse
1369 % (see \autoref{sec:maincls.titlepage}, starting on
1370 % \autopageref{sec:maincls.titlepage})%\fi
1371 % .
1372 %
1373 % \lstinputcode[{xleftmargin=2em,%^^A
1374 % linerange=31-31}]{contract-example-en.tex}%^^A
1375 % As already mentioned, we want to create a table of contents.
1376 %
1377 % \lstinputcode[{xleftmargin=2em,%^^A
1378 % linerange=33-37}]{contract-example-en.tex}%^^A
1379 % Preambles are not unusual in club by-laws. Here we use
1380 % \cs{addsec} to create one because we want it to have an entry
1381 % in the table of contents.
1382 %
1383 % \lstinputcode[{xleftmargin=2em,%^^A
1384 % linerange=39-39}]{contract-example-en.tex}%^^A
1385 % Here we use a small trick. The articles of the club by-laws should be numbered
1386 % with upper-case letters instead of Arabic numbers, just as
1387 % the appendix sections of an article using \cls{scrartcl} are.
1388 %
1389 % \lstinputcode[{xleftmargin=2em,%^^A
1390 % linerange=41-43}]{contract-example-en.tex}%^^A
1391 % We begin the contract with the first article.
1392 %
1393 % \lstinputcode[{xleftmargin=2em,%^^A
1394 % linerange=44-54}]{contract-example-en.tex}%^^A
1395 % The first clause has a number and a title. We will do the same with all
1396 % following clauses.
1397 %
1398 % The first paragraph of the clause contains nothing unusual. Because it is not
1399 % the only paragraph, every paragraph will be automatically preceded by a
1400 % paragraph number. Note that the numbering the first paragraph requires at
1401 % least two \LaTeX{} runs. Since this is the case for the table of contents as
1402 % well, this does not create any additional problems.
1403 %
1404 % In the second paragraph we have two sentences. Here we can see the shorthands
1405 % \texttt{'S} and \texttt{'.} in action. The first one only generates the
1406 % sentence number. The second one generates not only the full stop but also the
1407 % sentence number. With this, both sentences are numbered.
1408 %
1409 % \lstinputcode[{xleftmargin=2em,%^^A
1410 % linerange=55-70}]{contract-example-en.tex}%^^A
1411 % The second clause: again this contains several paragraphs, some of which
1412 % include several sentences. The second paragraph also has a numbered list. In
1413 % the last paragraph, we set a label, because we want to reference it later.
1414 %
1415 % \lstinputcode[{xleftmargin=2em,%^^A
1416 % linerange=72-78}]{contract-example-en.tex}%^^A
1417 % The third clause contains something special: a cross reference. Here we use
1418 % the long form with clause, paragraph, and sentence. If we decided later that
1419 % sentences should not be included in the reference, we could use the
1420 % \opt{ref=nosentence} option to set this globally.
1421 %
1422 % \lstinputcode[{xleftmargin=2em,%^^A
1423 % linerange=80-81}]{contract-example-en.tex}%^^A
1424 % Here we have a special kind of clause. In earlier versions of the club
1425 % by-laws,
1426 % this was a real clause, but it was later removed. However, the
1427 % numbering of the following clauses should not be changed by removing this
1428 % one. Therefore the \cs{Clause} statement has not been
1429 % removed but supplemented by |dummy| property. With this, we also can set
1430 % a label even though the clause will not be printed.
1431 %
1432 % \lstinputcode[{xleftmargin=2em,%^^A
1433 % linerange=82-86}]{contract-example-en.tex}%^^A
1434 % Another article begins. To avoid problems with the paragraph numbering, we
1435 % interrupt the \env{contract} environment.
1436 %
1437 % \lstinputcode[{xleftmargin=2em,%^^A
1438 % linerange=87-87}]{contract-example-en.tex}%^^A
1439 % The first clause of the next article also has been deleted.
1440 %
1441 % \lstinputcode[{xleftmargin=2em,%^^A
1442 % linerange=89-98}]{contract-example-en.tex}%^^A
1443 % Here we have a real clause again. We cross reference one of the deleted
1444 % clauses and also set a label.
1445 %
1446 % \lstinputcode[{xleftmargin=2em,%^^A
1447 % linerange=100-104}]{contract-example-en.tex}%^^A
1448 % Once more, this is a special kind of clause. This time we have not removed a
1449 % clause but added one without renumbering the following clauses. To do so,
1450 % we use \cs{SubClause}. Therefore the clause number is the
1451 % same like the previous one but with an appended ``a''.
1452 %
1453 % \lstinputcode[{xleftmargin=2em,%^^A
1454 % linerange=106-126}]{contract-example-en.tex}%^^A
1455 % The other clauses of this article are very usual. You already know all the
1456 % features used for them.
1457 %
1458 % \lstinputcode[{xleftmargin=2em,%^^A
1459 % linerange=128-141}]{contract-example-en.tex}%^^A
1460 % There follows another article no special features.
1461 %
1462 % \lstinputcode[{xleftmargin=2em,%^^A
1463 % linerange=143-143}]{contract-example-en.tex}%^^A
1464 % Then the \LaTeX{} document ends. You can see first three pages in
1465 % \autoref{fig:example}.%^^A
1466 % %^^A
1467 % \begin{figure}
1468 % \centering
1469 % \frame{\includegraphics[page=1,width=.482\textwidth,%^^A
1470 % height=.49\textheight,keepaspectratio]{contract-example-en}}\enskip
1471 % \frame{\includegraphics[page=2,width=.482\textwidth,%^^A
1472 % height=.49\textheight,keepaspectratio]{contract-example-en}}\par
1473 % \smallskip
1474 % \frame{\includegraphics[page=3,width=.482\textwidth,%^^A
1475 % height=.49\textheight,keepaspectratio]{contract-example-en}}\enskip
1476 % \frame{\includegraphics[page=4,width=.482\textwidth,%^^A
1477 % height=.49\textheight,keepaspectratio]{contract-example-en}}\par
1478 % \caption{The four pages of the CfCH example of
1479 % \protect\autoref{sec:example}}
1480 % \label{fig:example}
1481 % \end{figure}
1482 %
1483 % \section{From \pkg*{scrjura} to \pkg*{contract}}
1484 % \label{sec:switchpackage}
1485 %
1486 % If you have been using the \pkg*{scrjura} package and are now switching to
1487 % the \pkg*{contract} package, there are a few things you need to be aware of:
1488 % \begin{itemize}
1489 % \item Instead of
1490 % \begin{syntax}
1491 % \cs{usepackage}\oarg{options}\targ{scrjura}\quad,
1492 % \end{syntax}
1493 % should now use
1494 % \begin{syntax}
1495 % \cs{usepackage}\oarg{options}\targ{contract}\quad.
1496 % \end{syntax}
1497 % The same \meta{options} are allowed as the \pkg*{scrjura} package
1498 % understands.
1499 % \item Instead of using \cs{KOMAoptions} or \cs{KOMAoption} to set
1500 % \meta{options} for the \pkg*{contract} package, use \cs{contractSetup}.
1501 % \item The \cs{Clause} and \cs{SubClause} commands now have an optional
1502 % argument instead of a mandatory argument. This makes more sense because it
1503 % is allowed to use \cs{Clause} or \cs{SubClause} without an
1504 % argument. Instead of braces, the list of properties must be given
1505 % in square brackets, for example:
1506 %\begin{lstcode}[gobble=1]
1507 % \Clause[title={title of clause}]
1508 %\end{lstcode}
1509 % Therefore, even more care should be taken to ensure that the values of
1510 % each property are enclosed in braces. Otherwise, there may be problems not
1511 % only with commas, but also with square brackets in the values.
1512 % \item Check your code if you have used or redefined any internal macros as
1513 % several of them have been renamed.
1514 % \end{itemize}
1515 %
1516 % \section{State of Development}
1517 % \label{sec:draft}
1518 %
1519 % Since \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}~3.24, the
1520 % \pkg*{scrjura} package has shared the version number of the classes and
1521 % other important packages of
1522 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}. Package
1523 % \pkg*{contract} on the other hand now has a new version number independent
1524 % from \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript}.
1525 %
1526 % Independent from the version number you should note that so far, the
1527 % interaction of the \env{contract} environment with the many different
1528 % settings possible with other \LaTeX{} environments, packages, or classes has
1529 % not been tested. The main reason for this is that \pkg*{contract} is very
1530 % specialized and far beyond the author's ordinary practice. So the author
1531 % mostly relies on detailed user feedback.
1532 %
1533 %
1534 % \MaybeStop{%
1535 % \printbibliography[heading=bibintoc]
1536 % \PrintChanges
1537 % \PrintIndex
1538 % }
1539 %
1540 % \addpart{Implementation}
1541 %
1542 % \begin{macrocode}
1543 %<*package>
1544 % \end{macrocode}
1545 %
1546 % \changes{scrjura-v0.7b}{2014/11/11}{General renaming of ``Paragraph'' into
1547 % ``Clause''}
1548 %
1549 % \section{Cooperation with \pkg{hyperref}}
1550 %
1551 % If \pkg{hyperref} has already loaded before \pkg*{contract} the package cannot
1552 % work correctly. So we throw an error. Maybe it would be a good idea to make
1553 % this error fatal. But currently it is only an error.
1554 % \begin{macrocode}
1555 %<*init>
1556 \@ifpackageloaded{hyperref}{%
1557 \PackageError{contract}{Package hyperref already loaded}{%
1558 If you want to use package contract with package hyperref, you have
1559 to\MessageBreak
1560 load package contract before package hyperref.\MessageBreak
1561 To solve the problem, you just should move the loading of package
1562 hyperref\MessageBreak
1563 behind the loading of package contract.}%
1564 }
1565 %</init>
1566 % \end{macrocode}
1567 %
1568 % \section{Prerequisites}
1569 %
1570 % \changes{v0.92}{2024/06/07}{need at least \pkg*{scrkbase} v3.39}
1571 % We need package \pkg{scrkbase}. We could load this also together with
1572 % \pkg{tocbasic}, which is loaded later. But loading it on its own, we can
1573 % require a minimum version. At least the version of 2022/11/11 would be
1574 % needed, but the release was 2023/04/17 v3.39. So this is the version we
1575 % request.
1576 % \begin{description}
1577 % \item[Todo:] Package \pkg*{contract} is no longer a
1578 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} package. So it
1579 % should not use the internal
1580 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} package
1581 % \pkg{scrkbase}. For keys of contract environments we can just load
1582 % \pkg{scrbase}. For package options we should either also switch to
1583 % \pkg{scrbase} or use native key-value options of \LaTeX. After doing so we
1584 % would be able to replace \pkg*{scrkbase} at least by \pkg{scrextend}. With
1585 % this package we still could use commands like
1586 % \cs{setkomafont}. Theoretically we would also be able to still use
1587 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} options, but this
1588 % would still not be recommended.
1589 % \end{description}
1590 % \begin{macrocode}
1591 %<*init>
1592 \RequirePackage{scrkbase}[2023/04/17]
1593 %</init>
1594 % \end{macrocode}
1595 %
1596 % And now, \pkg{tocbasic}.
1597 % \begin{macrocode}
1598 %<*init>
1599 \RequirePackage{tocbasic}
1600 %</init>
1601 % \end{macrocode}
1602 %
1603 % \section{Options}%
1604 % \begin{option}{contract}
1605 % \begin{macro}{\if@documentcontract,
1606 % \@documentcontractfalse,\@documentcontracttrue}
1607 % \changes{scrjura-v3.36}{2022/01/25}{switched to a
1608 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} option} Option
1609 % \opt{contract} can be used to make the whole document to be a
1610 % contract. But in this case you are not allowed to reuse the \env{contract}
1611 % environment in the document. Nor is it allowed to stop or restart the
1612 % contract. With older \LaTeX{} this is done by adding \cs{contract} to the
1613 % end of \cs{document}. With an up to date \LaTeX{} we us a hook.
1614 % \begin{macrocode}
1615 %<*options>
1616 \KOMA@ifkey{contract}{@documentcontract}
1617 \IfLTXAtLeastTF{2020/10/01}{%
1618 \AddToHook{begindocument/end}{%
1619 \RelaxFamilyKey[.contract.sty]{KOMA}{contract}%
1620 \if@documentcontract\expandafter\contract\fi
1621 }%
1622 }{%
1623 \g@addto@macro\document{%
1624 \RelaxFamilyKey[.contract.sty]{KOMA}{contract}%
1625 \if@documentcontract\expandafter\contract\fi
1626 }%
1627 }
1628 %</options>
1629 % \end{macrocode}
1630 % \end{macro}
1631 % \end{option}
1632 %
1633 % \begin{option}{juratotoc}
1634 % \changes{scrjura-v3.39}{2022/11/11}{initial dot in member argument of
1635 % option storage commands removed}
1636 % Allow to set the toc level of the entries. Value \optvalue{true} is
1637 % the same like \optvalue{2}, value \optvalue{false} is the same like
1638 % \cs{maxdimen}. \changes{scrjura-v0.7}{2013/11/04}{usage of renewed
1639 % interface with \cs{FamilyKeyState}}
1640 % \changes{scrjura-v0.9a}{2015/03/09}{internal value storage}
1641 % \begin{macro}{\if@juratotoc}
1642 % \changes{scrjura-v0.6}{2011/09/29}{replaced by counter}
1643 % \begin{counter}{juratoclevel}
1644 % \changes{scrjura-v0.6}{2011/09/29}{definition moved}
1645 % \changes{scrjura-v3.27}{2019/02/25}{removed}
1646 % \begin{macro}{\toclevel@cpar}
1647 % \changes{scrjura-v0.7}{2013/06/09}{new, because of \pkg{hyperref}}
1648 % \changes{scrjura-v3.27}{2019/02/25}{handled by \pkg{tocbasic}}
1649 % \begin{macrocode}
1650 %<*options>
1651 \KOMA@key{juratotoc}[true]{%
1652 \KOMA@set@ifkey{juratotoc}{@tempswa}{#1}%
1653 \ifx\FamilyKeyState\FamilyKeyStateProcessed
1654 \if@tempswa
1655 \DeclareTOCStyleEntry[level=2]{default}{cpar}%
1656 \else
1657 \DeclareTOCStyleEntry[level=\maxdimen]{default}{cpar}%
1658 \fi
1659 \else
1660 \DeclareTOCStyleEntry[level=#1]{default}{cpar}%
1661 \fi
1662 \KOMA@kav@xreplacevalue{contract.sty}{juratotoc}{\cpartocdepth}%
1663 }
1664 \KOMA@kav@xadd{contract.sty}{juratotoc}{\cpartocdepth}%
1665 %</options>
1666 % \end{macrocode}
1667 % \end{macro}
1668 % \end{counter}
1669 % \end{macro}
1670 % \end{option}
1671 %
1672 % \begin{option}{juratocnumberwidth,juratocindent}
1673 % \changes{scrjura-v0.6}{2011/09/29}{new}
1674 % \changes{scrjura-v0.7}{2013/11/04}{usage of renewed interface with
1675 % \cs{FamilyKeyState}}
1676 % \changes{scrjura-v0.9a}{2015/03/09}{internal value storage}
1677 % \changes{scrjura-v3.39}{2022/11/11}{initial dot in member argument of option storage
1678 % commands removed}
1679 % \begin{ilength}{\cpar@numberwidth,\cpar@indent}
1680 % \changes{scrjura-v0.6}{2011/09/29}{new}
1681 % \changes{scrjura-v3.27}{2019/02/25}{replaced by usage of \cs{DeclareTOCStyleEntry}}
1682 % Indent and number width of the toc entries.
1683 % \begin{description}
1684 % \item[Todo:] Since we are using package \pkg{tocbasic} for the ToC entries
1685 % these options (and lengths) are not needed any longer, but users should
1686 % use \cs{DeclareTOCStyleEntry} to setup the number width and indent of the
1687 % entries.
1688 % \end{description}
1689 % \begin{macrocode}
1690 %<*options>
1691 \KOMA@key{juratocnumberwidth}{%
1692 \DeclareTOCStyleEntry[numwidth=#1]{default}{cpar}%
1693 \FamilyKeyStateProcessed
1694 \KOMA@kav@replacevalue{contract.sty}{juratocnumberwidth}{#1}%
1695 }
1696 \KOMA@kav@add{contract.sty}{juratocnumberwidth}{2em}
1697 \KOMA@key{juratocindent}{%
1698 \DeclareTOCStyleEntry[indent=#1]{default}{cpar}%
1699 \FamilyKeyStateProcessed
1700 \KOMA@kav@replacevalue{contract.sty}{juratocindent}{#1}%
1701 }
1702 \KOMA@kav@add{contract.sty}{juratocindent}{1.5em}%
1703 %</options>
1704 % \end{macrocode}
1705 % \end{ilength}
1706 % \end{option}
1707 %
1708 % \begin{option}{juratitlepagebreak}
1709 % \changes{scrjura-v0.5b}{2010/04/05}{new}
1710 % The options sets the boolean \cs{if@juratitlepagebreak}.
1711 % \begin{macro}{\if@juratitlepagebreak,
1712 % \@juratitlepagebreaktrue,\@juratitlepagebreakfalse}
1713 % If the boolean is \cs{iftrue} page breaks inside clause headings are
1714 % allowed (which is not recommended).
1715 % \begin{description}
1716 % \item[Todo:] Re-implementation either using a native key-value option (easy)
1717 % or a new \pkg{scrbase} family.
1718 % \end{description}
1719 % \begin{macrocode}
1720 %<*options>
1721 \KOMA@ifkey{juratitlepagebreak}{@juratitlepagebreak}
1722 %</options>
1723 % \end{macrocode}
1724 % \end{macro}
1725 % \end{option}
1726 %
1727 % \begin{option}{parnumber}
1728 % \changes{scrjura-v0.6}{2011/09/29}{new}
1729 % \changes{scrjura-v0.6a}{2012/10/15}{value mistake message changed}
1730 % \changes{scrjura-v0.7}{2013/11/04}{usage of renewed interface with
1731 % \cs{FamilyKeyState}}
1732 % \changes{scrjura-v0.9a}{2015/03/09}{internal value storage}
1733 % \changes{scrjura-v3.28}{2019/11/18}{\cs{ifstr} renamed into \cs{Ifstr}}
1734 % \changes{scrjura-v3.39}{2022/11/11}{initial dot in member argument of option storage
1735 % commands removed}
1736 % The options switches the (automatic) paragraph numbering.
1737 % \begin{description}
1738 % \item[Todo:] Re-implementation either using a native key-value option (easy)
1739 % or a new \pkg{scrbase} family.
1740 % \end{description}
1741 % \begin{macrocode}
1742 %<*options>
1743 \newif\ifparnumber
1744 \KOMA@key{parnumber}[true]{%
1745 \Ifstr{#1}{auto}{%
1746 \AutoPar
1747 \FamilyKeyStateProcessed
1748 \KOMA@kav@remove{contract.sty}{parnumber}{manual}%
1749 \KOMA@kav@remove{contract.sty}{parnumber}{auto}%
1750 \KOMA@kav@add{contract.sty}{parnumber}{auto}%
1751 }{%
1752 \Ifstr{#1}{manual}{%
1753 \ManualPar
1754 \FamilyKeyStateProcessed
1755 \KOMA@kav@remove{contract.sty}{parnumber}{manual}%
1756 \KOMA@kav@remove{contract.sty}{parnumber}{auto}%
1757 \KOMA@kav@add{contract.sty}{parnumber}{manual}%
1758 }{%
1759 \KOMA@set@ifkey{parnumber}{parnumber}{#1}%
1760 \KOMA@kav@replacebool{contract.sty}{parnumber}{parnumber}%
1761 }%
1762 }%
1763 }
1764 \KOMA@kav@add{contract.sty}{parnumber}{true}
1765 \KOMA@kav@add{contract.sty}{parnumber}{auto}
1766 %</options>
1767 % \end{macrocode}
1768 % \end{option}
1769 %
1770 % \begin{option}{paragraphmark,clausemark}
1771 % \changes{scrjura-v0.9h}{2016/04/11}{\opt{paragraphmark} renamed to
1772 % \opt{clausemark}}
1773 % \changes{scrjura-v0.7}{2013/11/04}{usage of renewed interface with
1774 % \cs{FamilyKeyState}}
1775 % \changes{scrjura-v0.9a}{2015/03/09}{internal value storage}
1776 % \changes{scrjura-v3.39}{2022/11/11}{initial dot in member argument of option
1777 % storage commands removed}
1778 % \begin{description}
1779 % \item[Todo:] Re-implementation either using a native key-value option
1780 % or a new \pkg{scrbase} family (easy).
1781 % \end{description}
1782 % \begin{option}{markright,markboth}
1783 % \changes{scrjura-v0.7}{2013/11/04}{deprecated}
1784 % \changes{scrjura-v3.39}{2022/11/16}{only with \KOMAScript~3}
1785 % \begin{description}
1786 % \item[Todo:] Remove deprecated options, because they need an internal
1787 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} macro.
1788 % \end{description}
1789 % \begin{command}{\Clausemark}
1790 % \changes{scrjura-v0.5e}{2011/08/31}{support for \cs{MakeMarkcase}}
1791 % The options are used to activate either \cs{markright} or \cs{markboth} for
1792 % clauses. \cs{Clausemark} expects not only the title but also the
1793 % number. So it differs from, e.g., \cs{chaptermark}, which uses the counter
1794 % automatically. But maybe I will change this some time.
1795 % \begin{macrocode}
1796 %<*options>
1797 \newcommand*{\Clausemark}[1]{}
1798 \KOMA@key{clausemark}{%
1799 \begingroup
1800 \KOMA@set@ncmdkey{clausemark}{@tempa}{%
1801 {false}{0},{off}{0},{no}{0},%
1802 {forceright}{1},%
1803 {forceboth}{2},%
1804 {right}{3},%
1805 {both}{4}%
1806 }{#1}%
1807 \ifx\FamilyKeyState\FamilyKeyStateProcessed
1808 \ifcase\number\@tempa
1809 \endgroup
1810 \let\Clausemark\@gobble
1811 \or
1812 \endgroup
1813 \renewcommand*{\Clausemark}[1]{%
1814 \markright{\csname MakeMarkcase\endcsname{##1}}}%
1815 \or
1816 \endgroup
1817 \renewcommand*{\Clausemark}[1]{%
1818 \markboth{\csname MakeMarkcase\endcsname{##1}}%
1819 {\csname MakeMarkcase\endcsname{##1}}}%
1820 \or
1821 \endgroup
1822 \renewcommand*{\Clausemark}[1]{%
1823 \ifx
1824 \@mkboth\@gobbletwo
1825 \else
1826 \markright{\csname MakeMarkcase\endcsname{##1}}%
1827 \fi}%
1828 \or
1829 \endgroup
1830 \renewcommand*{\Clausemark}[1]{%
1831 \@mkboth{\csname MakeMarkcase\endcsname{##1}}%
1832 {\csname MakeMarkcase\endcsname{##1}}}%
1833 \else
1834 \endgroup
1835 \fi
1836 \FamilyKeyStateProcessed
1837 \else
1838 \endgroup
1839 \FamilyKeyStateUnknownValue
1840 \fi
1841 \KOMA@kav@xreplacevalue{contract.sty}{clausemark}{#1}%
1842 }
1843 \KOMA@kav@add{contract.sty}{clausemark}{false}
1844 \@ifundefined{KOMA@DeclareDeprecatedOption}{}{%
1845 \KOMA@DeclareDeprecatedOption[contract]{markright}{clausemark=forceright}%
1846 \KOMA@DeclareDeprecatedOption[contract]{markboth}{clausemark=forceboth}%
1847 }
1848 \KOMA@key{paragraphmark}{%
1849 \PackageWarningNoLine{contract}{%
1850 You've used obsolete option `paragraphmark'.\MessageBreak
1851 Usage of this option is deprecated.\MessageBreak
1852 You should simply replace `paragraphmark'\MessageBreak
1853 by `clausemark'%
1854 }%
1855 \KOMAExecuteOptions[.contract.sty]{clausemark=#1}%
1856 }
1857 %</options>
1858 % \end{macrocode}
1859 % \end{command}
1860 % \end{option}
1861 % \end{option}
1862 %
1863 % \begin{option}{ref}
1864 % \changes{scrjura-v0.5d}{2010/06/07}{new values \optvalue{nopar},
1865 % \optvalue{nosentence}, \optvalue{OnlyParagraph}}
1866 % \changes{scrjura-v0.7}{2013/11/04}{usage of renewed interface with
1867 % \cs{FamilyKeyState}}
1868 % \changes{scrjura-v0.9a}{2015/03/09}{internal value storage}
1869 % \changes{scrjura-v3.39}{2022/11/11}{initial dot in member argument of option
1870 % storage commands removed}
1871 % \begin{description}
1872 % \item[Todo:] Re-implementation either using a native key-value option
1873 % or a new \pkg{scrbase} family (easy).
1874 % \end{description}
1875 % \begin{option}{parcitename,sentencecitename}
1876 % \changes{scrjura-v0.5d}{2010/06/07}{deprecated}
1877 % \changes{scrjura-v3.39}{2022/11/16}{only with \KOMAScript~3}
1878 % The formatting of the references of paragraphs and sentences. There are a
1879 % long a short and a numeric form.
1880 % \begin{description}
1881 % \item[Todo:] Remove deprecated options, because they need an internal
1882 % \href{https://www.ctan.org/pkg/koma-script}{\KOMAScript} macro.
1883 % \end{description}
1884 % \begin{macro}{\parcite@format,\sentencecite@format}
1885 % Default is the long form. Corresponding values of the two helper macros are:
1886 % 0 = long, 1 = short, 2 = numerical, -1 = nothing.
1887 % \begin{macrocode}
1888 %<*options>
1889 \newcommand*{\parcite@format}{0}
1890 \newcommand*{\sentencecite@format}{0}
1891 % \end{macrocode}
1892 % \end{macro}
1893 % The options can be used to change the default.
1894 % \begin{macrocode}
1895 \KOMA@key{ref}{%
1896 \begingroup
1897 \KOMA@set@ncmdkey{ref}{@tempa}{%
1898 {parlong}{1},{longpar}{1},{ParL}{1},%
1899 {parshort}{2},{shortpar}{2},{ParS}{2},%
1900 {parnumeric}{3},{numericpar}{3},{ParN}{3},%
1901 {paroff}{4},{nopar}{4},%
1902 {sentencelong}{10},{longsentence}{10},{SentenceL}{10},%
1903 {sentenceshort}{20},{shortsentence}{20},{SentenceS}{20},%
1904 {sentencenumeric}{30},{numericsentence}{30},{SentenceN}{30},%
1905 {sentenceoff}{40},{nosentence}{40},%
1906 {long}{11},%
1907 {short}{22},%
1908 {numeric}{33},%
1909 {paragraphonly}{44},{onlyparagraph}{44},%
1910 {ParagraphOnly}{44},{OnlyParagraph}{44}%
1911 }{#1}%
1912 \ifx\FamilyKeyState\FamilyKeyStateProcessed
1913 \aftergroup\FamilyKeyStateProcessed
1914 \@tempcnta=\@tempa\relax
1915 \@tempcntb=\z@
1916 \@whilenum \@tempcnta>9 \do{%
1917 \advance\@tempcnta -10\relax
1918 \advance\@tempcntb \@ne\relax
1919 }%
1920 \ifcase \@tempcnta
1921 \or
1922 \aftergroup\def\aftergroup\parcite@format
1923 \aftergroup{\aftergroup0\aftergroup}%
1924 \or
1925 \aftergroup\def\aftergroup\parcite@format
1926 \aftergroup{\aftergroup1\aftergroup}%
1927 \or
1928 \aftergroup\def\aftergroup\parcite@format
1929 \aftergroup{\aftergroup2\aftergroup}%
1930 \or
1931 \aftergroup\def\aftergroup\parcite@format
1932 \aftergroup{\aftergroup-\aftergroup1\aftergroup}%
1933 \fi
1934 \ifcase \@tempcntb
1935 \or
1936 \aftergroup\def\aftergroup\sentencecite@format
1937 \aftergroup{\aftergroup0\aftergroup}%
1938 \or
1939 \aftergroup\def\aftergroup\sentencecite@format
1940 \aftergroup{\aftergroup1\aftergroup}%
1941 \or
1942 \aftergroup\def\aftergroup\sentencecite@format
1943 \aftergroup{\aftergroup2\aftergroup}%
1944 \or
1945 \aftergroup\def\aftergroup\sentencecite@format
1946 \aftergroup{\aftergroup-\aftergroup1\aftergroup}%
1947 \fi
1948 \else
1949 \aftergroup\FamilyKeyStateUnknownValue
1950 \fi
1951 \endgroup
1952 \ifx\FamilyKeyState\FamilyKeyStateProcessed
1953 \KOMA@kav@removekey{contract.sty}{ref}%
1954 \ifcase\parcite@format
1955 \KOMA@kav@add{contract.sty}{ref}{parlong}%
1956 \or
1957 \KOMA@kav@add{contract.sty}{ref}{parshort}%
1958 \or
1959 \KOMA@kav@add{contract.sty}{ref}{parnumeric}%
1960 \or
1961 \KOMA@kav@add{contract.sty}{ref}{paroff}%
1962 \fi
1963 \ifcase\sentencecite@format
1964 \KOMA@kav@add{contract.sty}{ref}{sentencelong}%
1965 \or
1966 \KOMA@kav@add{contract.sty}{ref}{sentenceshort}%
1967 \or
1968 \KOMA@kav@add{contract.sty}{ref}{sentencenumeric}%
1969 \or
1970 \KOMA@kav@add{contract.sty}{ref}{sentenceoff}%
1971 \fi
1972 \fi
1973 }
1974 \KOMA@kav@add{contract.sty}{ref}{parlong}%
1975 \KOMA@kav@add{contract.sty}{ref}{sentencelong}%
1976 \@ifundefined{KOMA@DeclareDeprecatedOption}{}{%
1977 \KOMA@DeclareDeprecatedOption[contract]{parcitename}{ref=parlong}
1978 \KOMA@DeclareDeprecatedOption[contract]{sentencecitename}{ref=sentencelong}
1979 }
1980 %</options>
1981 % \end{macrocode}
1982 % \end{option}
1983 % \end{option}
1984 %
1985 % Execute the options.
1986 % \begin{macrocode}
1987 %<*postoptions>
1988 \KOMAProcessOptions\relax
1989 %</postoptions>
1990 % \end{macrocode}
1991 %
1992 % \changes{v0.92}{2025/11/12}{deprecated \pkg{scrjura} commands removed}
1993 %
1994 % \section{Contracts, Clauses, Paragraphs and Sentences}
1995 %
1996 % \begin{macro}{\contract@env@type}
1997 % \changes{scrjura-v0.5d}{2010/04/28}{new}
1998 % \changes{scrjura-v0.7b}{2014/11/03}{\cs{jura@env@type} renamed}
1999 % \changes{v0.0.1}{2023-10-10}{\cs{scrjura@env@type} renamed}
2000 % This macro shows the currently active \pkg*{contract} environment.
2001 % \begin{macrocode}
2002 %<*body>
2003 \newcommand*{\contract@env@type}{}
2004 %</body>
2005 % \end{macrocode}
2006 % \end{macro}
2007 %
2008 %
2009 % \begin{command}{\ellipsispar}
2010 % \changes{scrjura-v0.7}{2013/05/02}{new}
2011 % \changes{scrjura-v0.7b}{2014/11/03}{\cs{thecontractAbsoluteClause} made more
2012 % flexible}
2013 % \changes{scrjura-v0.9g}{2016/03/25}{write to \file{aux}-file only \cs{if@filesw}}
2014 % \begin{command}{\parellipsis}
2015 % \changes{scrjura-v0.7}{2013/05/02}{new}
2016 % Count one or more paragraphs given by the optional argument but print
2017 % \cs{parellipsis} instead of a real paragraph. The default is either
2018 % \cs{dots} or \cs{textellipsis} if available.
2019 % \changes{scrjura-v0.7}{2013/05/02}{new}
2020 % \begin{macrocode}
2021 %<*body>
2022 \newcommand*{\ellipsispar}[1][1]{%
2023 \begingroup
2024 \KOMAoptions{parnumber=manual}\parellipsis\par
2025 \addtocounter{par}{#1}%
2026 \if@filesw
2027 \protected@write\@auxout{}{%
2028 \string\newmaxpar{\contract@env@type}%
2029 {\csname the\contract@env@type
2030 AbsoluteClause\endcsname}%
2031 {\thepar}%
2032 }%
2033 \fi
2034 \endgroup
2035 \addtocounter{par}{-1}\refstepcounter{par}%
2036 \ignorespaces
2037 }
2038 \newcommand*{\parellipsis}{%
2039 \scr@ifundefinedorrelax{textellipsis}{\dots}{\textellipsis}%
2040 }
2041 %</body>
2042 % \end{macrocode}
2043 % \end{command}
2044 % \end{command}
2045 %
2046 % \begin{environment}{contract}
2047 % \changes{scrjura-v0.5d}{2010/04/28}{missing error message added}
2048 % \changes{scrjura-v0.5d}{2010/04/28}{not self-redefining any more}
2049 % \changes{scrjura-v0.5d}{2010/04/28}{defining \cs{jura@env@type}}
2050 % \changes{scrjura-v3.36}{2022/01/25}{defining an environment (because of hooks)}
2051 % \begin{macro}{\if@contract@skiphyperref}
2052 % \changes{v0.0.1}{2023-10-10}{\cs{if@scrjura@skiphyperref} renamed}
2053 % \begin{counter}{contractClause}
2054 % \begin{command}{\thecontractClause}
2055 % \changes{scrjura-v0.9b}{2015/05/01}{must use counter \cnt{Clause} instead of
2056 % \cnt{contractClause}}
2057 % \begin{macro}{\contract@Clauseformat}
2058 % \begin{command}{\Clauseformat,\paragraphformat}
2059 % \changes{scrjura-v0.6b}{2013/04/16}{redefinition of \cs{paragraphformat}}
2060 % \begin{counter}{contractSubClause}
2061 % \changes{scrjura-v0.9b}{2015/05/01}{must use counter \cnt{SubClause} instead of
2062 % \cnt{contractSubClause}}
2063 % \begin{command}{\thecontractSubClause}
2064 % \begin{counter}{contractAbsoluteClause}
2065 % \changes{scrjura-v0.7}{2013/04/18}{new (internal) counter for all clauses to make
2066 % it possible to reset the users clause counter}
2067 % It is not allowed to nest the \env{contract} environments, but you can end
2068 % them and start them new. But this would not end the contract and start a new
2069 % contract but only delay it for some other code.
2070 % \begin{macrocode}
2071 %<*body>
2072 \newenvironment{contract}{%
2073 \ifx\contract@env@type\@empty
2074 \let\@doendpe\contract@doendpe
2075 \let\Clause\contract@paragraph
2076 \let\c@Clause\c@contractClause
2077 \edef\cl@Clause{\cl@Clause\cl@contractClause}%
2078 \let\SubClause\contract@subparagraph
2079 \let\c@SubClause\c@contractSubClause
2080 \edef\cl@SubClause{\cl@SubClause\cl@contractSubClause}%
2081 \let\Sentence\contract@sentence
2082 \renewcommand*{\contract@env@type}{contract}%
2083 \aliaskomafont{Clause}{contract.Clause}%
2084 \else
2085 \PackageError{contract}{nested `contract` detected}{%
2086 You may not use a `contract' environment inside\MessageBreak
2087 a `\contract@env@type' environment or after loading\MessageBreak
2088 package `contract' with option `\contract@env@type'!}%
2089 \fi
2090 }{}
2091 \let\if@contract@skiphyperref\iftrue
2092 \let\cl@Clause\@empty
2093 \let\cl@SubClause\@empty
2094 \newcounter{contractClause}
2095 \renewcommand*{\thecontractClause}{%
2096 {\contract@Clauseformat{\arabic{Clause}}}}
2097 \DeclareRobustCommand*{\contract@Clauseformat}[1]{\Clauseformat{#1}}
2098 \newcommand*{\Clauseformat}[1]{\S~#1}
2099 \newcounter{contractSubClause}
2100 \@addtoreset{SubClause}{Clause}
2101 \renewcommand*{\thecontractSubClause}{%
2102 {\theClause\alph{SubClause}}}
2103 \newcounter{contractAbsoluteClause}
2104 %</body>
2105 % \end{macrocode}
2106 % \end{counter}
2107 % \end{command}
2108 % \end{counter}
2109 % \end{command}
2110 % \end{macro}
2111 % \end{command}
2112 % \end{counter}
2113 % \end{macro}
2114 % \end{environment}
2115 %
2116 % \begin{command}{\DeclareNewJuraEnvironment}
2117 % \changes{scrjura-v0.9}{2014/11/12}{new}
2118 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifnextchar} replaced by
2119 % \cs{kernel@ifnextchar}}
2120 % Using \cs{@defjuraenvironment} to define a new juristic environment. This
2121 % can be done only in document preamble.
2122 % \begin{macrocode}
2123 %<*body>
2124 \newcommand*{\DeclareNewJuraEnvironment}[1]{%
2125 \@ifundefined{#1}{\expandafter\let\csname #1\expandafter\endcsname
2126 \csname end#1\endcsname}{}%
2127 \@ifundefined{#1}{\let\reserved@defjuraenvironment\@defjuraenvironment}{%
2128 \PackageError{contract}{ignorring declaration of `#1'}{%
2129 You've tried to declare jura environment `#1', but
2130 environment\MessageBreak
2131 `#1' or command
2132 \expandafter\string\csname #1\endcsname\space or
2133 \expandafter\string\csname end#1\endcsname\MessageBreak
2134 already exists.\MessageBreak
2135 Declaration will be ignored}%
2136 \long\def\reserved@defjuraenvironment##1[##2]##3##4{}%
2137 }%
2138 \kernel@ifnextchar [%]
2139 {\reserved@defjuraenvironment{#1}}{\reserved@defjuraenvironment{#1}[]}%
2140 }
2141 \@onlypreamble\DeclareNewJuraEnvironment
2142 % \end{macrocode}
2143 % \begin{macro}{\@defjuraenvironment}
2144 % \changes{scrjura-v0.9}{2014/11/04}{new}
2145 % \changes{scrjura-v3.25}{2017/12/08}{new command options \texttt{ClauseFont}}
2146 % \changes{scrjura-v3.25}{2017/12/08}{\cs{reserved@defjuraenvironment} set
2147 % back to \cs{relax}}
2148 % \changes{scrjura-v3.25}{2017/12/08}{using local instead of global command
2149 % options}
2150 % This command is used to define a new \pkg*{contract} environment like
2151 % \env{contract}. Several options are provided (see the user manual for
2152 % details).
2153 % \begin{macrocode}
2154 \DefineFamily{KOMAarg}
2155 \DefineFamilyMember{KOMAarg}
2156 \newcommand{\@defjuraenvironment}{}
2157 \long\def\@defjuraenvironment#1[#2]#3#4{%
2158 \let\reserved@defjuraenvironment\relax
2159 % \end{macrocode}
2160 % The counters:
2161 % \begin{macrocode}
2162 \newcounter{#1Clause}%
2163 \newcounter{#1AbsoluteClause}%
2164 \newcounter{#1SubClause}%
2165 \FamilyCSKey[.contract.sty]{KOMAarg}{Clause}{#1@Clause}%
2166 \FamilyCSKey[.contract.sty]{KOMAarg}{SubClause}{#1@SubClause}%
2167 \FamilyCSKey[.contract.sty]{KOMAarg}{Sentence}{#1@Sentence}%
2168 \DefineFamilyKey[.contract.sty]{KOMAarg}{ClauseNumberFormat}{%
2169 \expandafter\def\csname #1@Clauseformat \endcsname####1{##1{####1}}%
2170 \expandafter\edef\csname #1@Clauseformat\endcsname{%
2171 \noexpand\protect\expandafter\noexpand\csname #1@Clauseformat \endcsname
2172 }%
2173 \FamilyKeyStateProcessed
2174 }
2175 \DefineFamilyKey[.contract.sty]{KOMAarg}{ClauseFont}{%
2176 \IfExistskomafont{#1.Clause}{%
2177 \IfIsAliaskomafont{#1.Clause}{%
2178 \expandafter\let\csname scr@fnt@instead@#1.Clause\endcsname\relax
2179 \newkomafont{#1.Clause}{##1}%
2180 }{\setkomafont{#1.Clause}{##1}}%
2181 }{%
2182 \newkomafont{#1.Clause}{##1}%
2183 }%
2184 }
2185 \FamilyExecuteOptions[.contract.sty]{KOMAarg}{#2}%
2186 \RelaxFamilyKey[.contract.sty]{KOMAarg}{ClauseFont}%
2187 \RelaxFamilyKey[.contract.sty]{KOMAarg}{ClauseNumberFormat}%
2188 \RelaxFamilyKey[.contract.sty]{KOMAarg}{Sentence}%
2189 \RelaxFamilyKey[.contract.sty]{KOMAarg}{SubClause}%
2190 \RelaxFamilyKey[.contract.sty]{KOMAarg}{Clause}%
2191 \@ifundefined{#1@Clauseformat}{%
2192 \expandafter\DeclareRobustCommand\expandafter*%
2193 \csname #1@Clauseformat\endcsname[1]{\Clauseformat{##1}}%
2194 }{}%
2195 % \end{macrocode}
2196 % \changes{scrjura-v0.9c}{2015/05/13}{defining \cs{the\dots Clause}}
2197 % \changes{scrjura-v0.9f}{2016/02/24}{\cs{protect}\cs{@nameuse} instead of
2198 % \cs{csname}\dots\cs{endcsname}}
2199 % \changes{v0.92}{2026-04-23}{missing group added to \cs{the\dots Clause}}
2200 % \begin{macrocode}
2201 \expandafter\renewcommand\expandafter*\csname the#1Clause\endcsname{%
2202 {\protect\@nameuse{#1@Clauseformat}{\arabic{#1Clause}}}}%
2203 % \end{macrocode}
2204 % Environment:
2205 % \begin{macrocode}
2206 \newenvironment{#1}{%
2207 \par
2208 \ifx\contract@env@type\@empty
2209 \edef\contract@env@type{#1}%
2210 \let\@doendpe\contract@doendpe
2211 \expandafter\let\expandafter\c@Clause\csname c@#1Clause\endcsname
2212 \edef\cl@Clause{\cl@Clause\csname cl@#1Clause\endcsname}%
2213 \expandafter\let\expandafter\c@SubClause
2214 \csname c@#1SubClause\endcsname
2215 \edef\cl@SubClause{\cl@SubClause
2216 \csname cl@#1SubClause\endcsname}%
2217 \@ifundefined{#1@Clause}{%
2218 \let\Clause\contract@paragraph
2219 }{%
2220 \expandafter\let\expandafter\Clause
2221 \csname #1@Clause\endcsname
2222 }%
2223 \@ifundefined{#1@SubClause}{%
2224 \let\SubClause\contract@subparagraph
2225 }{%
2226 \expandafter\let\expandafter\SubClause
2227 \csname #1@SubClause\endcsname
2228 }%
2229 \@ifundefined{#1@Sentence}{%
2230 \let\Sentence\contract@sentence
2231 }{%
2232 \expandafter\let\expandafter\Sentence\csname #1@Sentence\endcsname
2233 }%
2234 \@ifundefined{\contract@env@type @everypar}{%
2235 \expandafter\let
2236 \csname \contract@env@type @everypar\endcsname
2237 \contract@everypar
2238 }{}%
2239 % \end{macrocode}
2240 % Font alias for \fnt{Clause}. If neither a font not an alias is defined for
2241 % the new environment \fnt{contract.Clause} is used.
2242 % \changes{scrjura-v3.25}{2017/12/08}{Font alias fixed}
2243 % \begin{macrocode}
2244 \IfExistskomafont{#1.Clause}{%
2245 \IfIsAliaskomafont{#1.Clause}{%
2246 \aliaskomafont{Clause}{\csname scr@fnt@instead@#1.Clause\endcsname}%
2247 }{%
2248 \aliaskomafont{Clause}{#1.Clause}%
2249 }%
2250 }{%
2251 \aliaskomafont{Clause}{contract.Clause}%
2252 }%
2253 #3%
2254 \else
2255 \PackageError{contract}{nested contract environments detected}{%
2256 You must not use a `#1' environment inside\MessageBreak
2257 a `\contract@env@type' environment or after loading\MessageBreak
2258 package `contract' with option `\contract@env@type'!}%
2259 \fi
2260 }{%
2261 #4%
2262 \par
2263 }%
2264 }
2265 %</body>
2266 % \end{macrocode}
2267 % \end{macro}%^^A \@dewjuraenvironment
2268 % \end{command}%^^A \DeclareNewJuraEnvironment
2269 %
2270 % \begin{macro}{\contract@paragraph}
2271 % This is the \cs{Clause} used by contracts. A contract consists (usually) of
2272 % several clauses. Each clause has optional elements managed by
2273 % \meta{key}=\meta{value} pairs handled by \pkg{scrkbase} and last but not
2274 % least by \pkg{keyval}.
2275 % \begin{option}{title,head,nohead}
2276 % \begin{option}{entry,noentry}
2277 % \changes{scrjura-v0.6}{2011/09/30}{deprecated}
2278 % \begin{option}{tocentry,notocentry}
2279 % \changes{scrjura-v0.6}{2011/09/30}{new}
2280 % Title, running head and toc entry of the clause. The title is the default
2281 % for running head and toc entry. But you can also use an empty value for
2282 % each of them or use the \texttt{no\dots} options to switch them off.
2283 % \begin{macrocode}
2284 %<*body>
2285 \define@key{contract}{title}{%
2286 \def\contract@title{#1}%
2287 \ifx\contract@entry\relax\def\contract@entry{\contract@title}\fi
2288 \ifx\contract@head\relax\def\contract@head{\contract@title}\fi
2289 }
2290 \define@key{contract}{entry}{%
2291 \PackageWarning{contract}{deprecated option `entry'.\MessageBreak
2292 You should use option `tocentry' instead of\MessageBreak
2293 option `entry'%
2294 }%
2295 \def\contract@entry{#1}}
2296 \define@key{contract}{tocentry}{\def\contract@entry{#1}}
2297 \define@key{contract}{noentry}[]{%
2298 \PackageWarning{contract}{deprecated option `noentry'.\MessageBreak
2299 You should use option `notocentry' instead of\MessageBreak
2300 option `noentry'%
2301 }%
2302 \let\contract@entry\relax}
2303 \define@key{contract}{notocentry}[]{\let\contract@entry\relax}
2304 \define@key{contract}{head}{\def\contract@head{#1}}
2305 \define@key{contract}{nohead}[]{\let\contract@head\relax}
2306 % \end{macrocode}
2307 % \end{option}
2308 % \end{option}
2309 % \end{option}
2310 % \begin{option}{number}
2311 % The number can be changed manually. But clauses without numbers are not
2312 % allowed. So if you use an empty value, the number is automatically set.
2313 % \begin{macrocode}
2314 \define@key{contract}{number}{\def\contract@number{#1}}
2315 % \end{macrocode}
2316 % \end{option}
2317 % \begin{macro}{\contract@preskip,\contract@postskip}
2318 % \begin{option}{preskip,postskip}
2319 % The options are used to specify the distance before and after the
2320 % clause. The preset value of these options are the global settings done by
2321 % |\setkeys{contract}{…}|.
2322 % \begin{macrocode}
2323 \newcommand*{\contract@preskip}{2\baselineskip}
2324 \newcommand*{\contract@postskip}{\baselineskip}
2325 \define@key{contract}{preskip}{\def\contract@preskip{#1}}
2326 \define@key{contract}{postskip}{\def\contract@postskip{#1}}
2327 % \end{macrocode}
2328 % \end{option}
2329 % \end{macro}
2330 % \begin{option}{dummy}
2331 % The option switches the boolean \cs{ifcontract@dummy}.
2332 % \begin{macro}{\ifcontract@dummy}
2333 % If the boolean is \cs{iftrue} the clause will not be printed. But note: you
2334 % cannot use this to remove the paragraphs or sentences of the clause. But you
2335 % can use this option to generate holes in the numbering without manually
2336 % manipulating the counters.
2337 % \begin{macrocode}
2338 \newif\ifcontract@dummy
2339 \define@key{contract}{dummy}[true]{\csname contract@dummy#1\endcsname}
2340 % \end{macrocode}
2341 % \end{macro}
2342 % \end{option}
2343 % \begin{fontelement}{contract.Clause}
2344 % \begin{macro}{\contract@paragraph@font}
2345 % \changes{scrjura-v3.25}{2017/12/08}{using element \fnt{Clause} instead of
2346 % \fnt{contract.Clause}}
2347 % Correctly this macro should be named \cs{contract@paragraph@format}. But it
2348 % is already used by some users for ugly tricks. So I will not rename it to
2349 % avoid problems for existing documents. Additionally it would be better to
2350 % use a new macro per environment. However the same reason not to change this.
2351 % \begin{macrocode}
2352 \newkomafont{contract.Clause}{\sffamily\bfseries\large}
2353 \newcommand*{\contract@paragraph@font}{\usekomafont{Clause}%
2354 \@hangfrom}
2355 % \end{macrocode}
2356 % \end{macro}
2357 % \end{fontelement}
2358 % \begin{counter}{@AbsClause}
2359 % \begin{macro}{\theH@AbsClause}
2360 % \changes{scrjura-v3.41}{2023/06/24}{Ulrike Fischer requested to use \cs{def} instead
2361 % of \cs{newcommand*}}
2362 % \begin{command}{\theHClause,\theHSubClause}
2363 % \changes{scrjura-v3.41}{2023/06/24}{Ulrike Fischer requested to use \cs{def} instead
2364 % of \cs{newcommand*}}
2365 % \begin{macrocode}
2366 % Here we have some not good tested code for \pkg{hyperref}.
2367 \newcounter{@AbsClause}
2368 \def\theH@AbsClause{P-\arabic{@AbsClause}}
2369 \def\theHClause{\theH@AbsClause}
2370 \def\theHSubClause{\theH@AbsClause}
2371 % \end{macrocode}
2372 % \end{command}
2373 % \end{macro}
2374 % \end{counter}
2375 % For the headings we use manual paragraph numbering, because we don't want
2376 % any paragraph numbering inside the heading. After initializing the options
2377 % they are processed.
2378 % \changes{scrjura-v0.7}{2013/04/18}{increase counter
2379 % \cnt{contractAbsoluteClause}}
2380 % \changes{scrjura-v0.7b}{2014/11/03}{more flexible
2381 % \cnt{\meta{environment}AbsoluteClause}}
2382 % \changes{v0.0.2}{2024/01/23}{the argument is optional}
2383 % \begin{macrocode}
2384 \NewDocumentCommand\contract@paragraph {o} {%
2385 \stepcounter{\contract@env@type AbsoluteClause}%
2386 \ManualPar\parnumbertrue
2387 \let\contract@title\relax
2388 \let\contract@entry\relax
2389 \let\contract@head\relax
2390 \let\contract@number\relax
2391 \contract@dummyfalse
2392 \IfValueT{#1}{\setkeys{contract}{#1}}%
2393 % \end{macrocode}
2394 % Unless this is a dummy clause, the headings will be initialized and vertical
2395 % skips will be done.
2396 % \changes{scrjura-v0.6a}{2012/10/08}{missing \cs{par} added}
2397 % \begin{macrocode}
2398 \ifcontract@dummy\else
2399 \par
2400 \@afterindentfalse
2401 \addvspace{\contract@preskip}%
2402 \fi
2403 % \end{macrocode}
2404 % If there isn't a manual number, we use the next number. If there is a manual
2405 % number, this number is printed and we take care that labels and
2406 % \pkg{hyperref} also use the manual number.
2407 % \changes{scrjura-v0.6b}{2013/04/16}{using \cs{contract@Clauseformat} for manual
2408 % numbers too}
2409 % \changes{scrjura-v0.9c}{2015/05/13}{\cs{thecontractClause} replaced by
2410 % environment-dependent macro}
2411 % \begin{macrocode}
2412 \ifx\contract@number\relax
2413 \let\p@Clause\@empty
2414 \expandafter\let\expandafter\theClause
2415 \csname the\contract@env@type Clause\endcsname
2416 \refstepcounter{Clause}%
2417 \else
2418 \begingroup
2419 \let\@elt\@stpelt
2420 \cl@Clause
2421 \endgroup
2422 % \end{macrocode}
2423 % \changes{scrjura-v0.9f}{2016/02/24}{\cs{protect}\cs{@nameuse} instead of
2424 % \cs{csname}\dots\cs{endcsname}}
2425 % \changes{scrjura-v3.41}{2023/06/24}{update of \cs{@currentcounter} added}
2426 % \begin{macrocode}
2427 \protected@edef\theClause{%
2428 \protect\@nameuse{\contract@env@type @Clauseformat}{\contract@number}%
2429 }%
2430 \protected@edef\@currentlabel{\theClause}%
2431 \def\@currentcounter{Clause}%
2432 \fi
2433 \stepcounter{@AbsClause}%
2434 \begingroup\expandafter\expandafter\expandafter\endgroup
2435 \expandafter\ifx\csname if@skiphyperref\endcsname\relax
2436 \else
2437 \expandafter\let\csname if@contract@skiphyperref\expandafter\endcsname
2438 \csname if@skiphyperref\endcsname
2439 \fi
2440 \if@contract@skiphyperref\else
2441 \hyper@refstepcounter{@AbsClause}%
2442 %<+trace> \typeout{absolute Number: \the@AbsClause^^JLabel: `\@currentHref'}%
2443 \fi
2444 % \end{macrocode}
2445 % For simplification we use the code of clauses for sub-clauses.
2446 % \begin{macrocode}
2447 \let\theSubClause\theClause
2448 % \end{macrocode}
2449 % Unless for dummy clauses, the heading is printed, the toc entry is done
2450 % and also the running head.
2451 % \changes{scrjura-v0.7}{2013/04/28}{distance behind the number is part of the number}
2452 % \changes{scrjura-v0.9i}{2017/02/23}{usage of \cs{ext@toc}}
2453 % \begin{macrocode}
2454 \ifcontract@dummy\else
2455 \begingroup
2456 \if@juratitlepagebreak\else\interlinepenalty\@M\fi
2457 \contract@paragraph@font{\theClause
2458 \ifx\contract@title\relax\else\enskip\fi}%
2459 \contract@title
2460 \ifx\contract@entry\relax\else
2461 \expandafter\addxcontentsline\expandafter{\ext@toc}%
2462 {cpar}[\theClause]\contract@entry
2463 \addxcontentsline{cpa}{cpar}[\theClause]\contract@entry
2464 \fi
2465 \ifx\contract@head\relax\else
2466 \expandafter\Clausemark\expandafter{%
2467 \expandafter\theSubClause\expandafter\enskip\contract@head}%
2468 \fi
2469 \par
2470 \endgroup\nobreak\vskip\contract@postskip
2471 % \end{macrocode}
2472 % Last but not least paragraph numbering is initialized.
2473 % \begin{macrocode}
2474 \contract@afterheading
2475 \fi
2476 }
2477 %</body>
2478 % \end{macrocode}
2479 % \end{macro}
2480 %
2481 % \begin{macro}{\contract@subparagraph}
2482 % \changes{scrjura-v0.6a}{2012/10/08}{missing \cs{par} added}
2483 % \changes{scrjura-v0.7}{2013/04/18}{increasing counter
2484 % \cnt{contractAbsoluteClause}}
2485 % \changes{scrjura-v0.7}{2013/04/28}{distance after number}
2486 % \changes{scrjura-v0.9i}{2017/02/23}{usage of \cs{ext@toc}}
2487 % \changes{scrjura-v3.41}{2023/06/24}{update of \cs{@currentcounter} added}
2488 % \changes{v0.0.2}{2024/01/23}{the argument is optional}
2489 % This is almost the same like \cs{contract@paragraph}.
2490 % \begin{macrocode}
2491 %<*body>
2492 \NewDocumentCommand \contract@subparagraph {o}{%
2493 \stepcounter{\contract@env@type AbsoluteClause}%
2494 \ManualPar\parnumbertrue
2495 \let\contract@title\relax
2496 \let\contract@entry\relax
2497 \let\contract@head\relax
2498 \let\contract@number\relax
2499 \contract@dummyfalse
2500 \IfValueT{#1}{\setkeys{contract}{#1}}%
2501 \ifcontract@dummy\else
2502 \par
2503 \@afterindentfalse
2504 \vskip\contract@preskip
2505 \fi
2506 \ifx\contract@number\relax
2507 \let\p@SubClause\@empty
2508 \let\theSubClause\thecontractSubClause
2509 \refstepcounter{SubClause}%
2510 \else
2511 \begingroup
2512 \let\@elt\@stpelt
2513 \cl@SubClause
2514 \endgroup
2515 \protected@edef\theSubClause{\theClause\contract@number}%
2516 \protected@edef\@currentlabel{\theSubClause}%
2517 \def\@currentcounter{SubClause}%
2518 \fi
2519 \stepcounter{@AbsClause}%
2520 \begingroup\expandafter\expandafter\expandafter\endgroup
2521 \expandafter\ifx\csname if@skiphyperref\endcsname\relax
2522 \else
2523 \expandafter\let\csname if@contract@skiphyperref\expandafter\endcsname
2524 \csname if@skiphyperref\endcsname
2525 \fi
2526 \if@contract@skiphyperref\else
2527 \hyper@refstepcounter{@AbsClause}%
2528 %<+trace> \typeout{absolute Number: \the@AbsClause^^JLabel: `\@currentHref'}%
2529 \fi
2530 \ifcontract@dummy\else
2531 \begingroup
2532 \if@juratitlepagebreak\else\interlinepenalty\@M\fi
2533 \contract@paragraph@font{\theSubClause
2534 \ifx\contract@title\relax\else\enskip\fi}%
2535 \contract@title
2536 \ifx\contract@entry\relax\else
2537 \expandafter\addxcontentsline\expandafter{\ext@toc}%
2538 {cpar}[\theSubClause]\contract@entry
2539 \addxcontentsline{cpa}{cpar}[\theSubClause]\contract@entry
2540 \fi
2541 \ifx\contract@head\relax\else
2542 \expandafter\Clausemark\expandafter{%
2543 \expandafter\theSubClause\expandafter\enskip\contract@head}%
2544 \fi
2545 \par
2546 \endgroup
2547 \nobreak\vskip\contract@postskip
2548 \contract@afterheading
2549 \fi
2550 }
2551 %</body>
2552 % \end{macrocode}
2553 % \end{macro}
2554 %
2555 % \begin{command}{\AutoPar,\ManualPar}
2556 % Switching between automatic or manual paragraph numbers for all
2557 % \pkg*{contract} environments.
2558 % \begin{macrocode}
2559 %<*body>
2560 \newcommand*{\AutoPar}{%
2561 \expandafter\let\expandafter\contract@used@everypar
2562 \csname \contract@env@type @everypar\endcsname
2563 }
2564 \newcommand*{\ManualPar}{%
2565 \let\contract@used@everypar\relax
2566 }
2567 %</body>
2568 % \end{macrocode}
2569 % \end{command}
2570 %
2571 % \begin{macro}{\contract@afterheading}
2572 % \changes{scrjura-v0.7b}{2014/11/03}{\cs{jura@afterheading} renamed}
2573 % \changes{scrjura-v0.7b}{2014/11/03}{no argument}
2574 % \changes{scrjura-v3.27}{2019/02/25}{\cs{CheckCommand} for \cs{@afterheading}}
2575 % \changes{v0.0.1}{2023-10-10}{\cs{scrjura@afterheading} renamed}
2576 % Similar to \cs{afterheading} but with automatic paragraph numbers.
2577 % \begin{description}
2578 % \item[ToDo:] Test if this can be done using \LaTeX{} hooks, depending on the
2579 % \LaTeX{} release.
2580 % \end{description}
2581 % \begin{macrocode}
2582 %<*body>
2583 \CheckCommand*{\@afterheading}{%
2584 \@nobreaktrue
2585 \everypar{%
2586 \if@nobreak
2587 \@nobreakfalse
2588 \clubpenalty \@M
2589 \if@afterindent \else
2590 {\setbox\z@\lastbox}%
2591 \fi
2592 \else
2593 \clubpenalty \@clubpenalty
2594 \everypar{}%
2595 \fi}%
2596 }
2597 \newcommand*{\contract@afterheading}{%
2598 \@nobreaktrue
2599 \everypar{%
2600 \if@nobreak
2601 \@nobreakfalse
2602 \clubpenalty \@M
2603 \if@afterindent \else
2604 {\setbox\z@\lastbox}%
2605 \fi
2606 \else
2607 \clubpenalty \@clubpenalty
2608 \everypar{%
2609 \contract@used@everypar
2610 }%
2611 \fi
2612 \contract@used@everypar
2613 }%
2614 \AutoPar
2615 }
2616 % \end{macrocode}
2617 % \begin{macro}{\contract@used@everypar}
2618 % \changes{scrjura-v0.7b}{2014/11/03}{\cs{jura@everypar} renamed}
2619 % \changes{v0.0.1}{2023-10-10}{\cs{scrjura@everypar} renamed}
2620 % The macro to be used at the very beginning of every paragraph to add the
2621 % number. To be used only inside \pkg*{contract} environments, so empty
2622 % outside.
2623 % \begin{macrocode}
2624 \newcommand*{\contract@used@everypar}{}
2625 % \end{macrocode}
2626 % \end{macro}
2627 % \begin{macro}{\@doendpe}
2628 % \LaTeX{} used this macro, to reset all paragraph actions at the end of
2629 % environments. To avoid unwanted switching-off of the paragraph number it
2630 % will be reinitialized.
2631 % \begin{macro}{\contract@doendpe}
2632 % \changes{v0.0.1}{2023-10-10}{\cs{scrjura@doendpe} renamed}
2633 % \begin{macro}{\IncludeInRelease}
2634 % \changes{scrjura-v0.9e}{2015/11/03}{used temporary}
2635 % \changes{scrjura-v3.28}{2019/11/18}{\cs{ifstr} renamed into \cs{Ifstr}}
2636 % \begin{macro}{\@gobble@IncludeInRelease}
2637 % \changes{scrjura-v0.9e}{2015/11/03}{used temporary}
2638 % \begin{macro}{\EndIncludeInRelease}
2639 % \changes{scrjura-v0.9e}{2015/11/03}{used temporary}
2640 % From \LaTeX{} 2015/01/01 a different definition of \cs{@doendpe} is used. So
2641 % we also have to use different versions depending on the release. We do so
2642 % with some tricks. Maybe this should be replaced by usage of
2643 % \cs{IfLTXAtLeastTF} from already loaded \pkg{scrbase}.
2644 % \begin{description}
2645 % \item[Todo:] Using \cs{everypar} is evil and should be replaced by using a
2646 % generic paragraph hook.
2647 % \end{description}
2648 % \begin{macrocode}
2649 \providecommand*{\IncludeInRelease}[3]{%
2650 \PackageInfo{contract}{temporary definition of \string\IncludeInRelease}%
2651 \Ifstr{#1}{0000/00/00}{%
2652 \let\IncludeInRelease\@undefined
2653 \def\EndIncludeInRelease{\let\EndIncludeInRelease\@undefined}%
2654 }{%
2655 \let\EndIncludeInRelease\relax
2656 \long\def\@gobble@IncludeInRelease##1\EndIncludeInRelease{%
2657 \let\@gobble@IncludeInRelease\@undefined
2658 }%
2659 \expandafter\@gobble@IncludeInRelease
2660 }%
2661 }
2662 \IncludeInRelease{2015/01/01}{\@doendpe}{clubpenalty fix}
2663 \CheckCommand*\@doendpe{\@endpetrue
2664 \def\par{\@restorepar
2665 \clubpenalty\@clubpenalty
2666 \everypar{}\par\@endpefalse}\everypar
2667 {{\setbox\z@\lastbox}%
2668 \everypar{}\@endpefalse}}
2669 \newcommand*{\contract@doendpe}{%
2670 \@endpetrue
2671 \def\par{%
2672 \@restorepar
2673 \clubpenalty\@clubpenalty
2674 \everypar{%
2675 \csname contract@used@everypar\endcsname
2676 }%
2677 \par\@endpefalse
2678 }%
2679 \everypar{%
2680 {\setbox\z@\lastbox}\everypar{%
2681 \csname contract@used@everypar\endcsname
2682 }%
2683 \@endpefalse
2684 }%
2685 }
2686 \EndIncludeInRelease
2687 \IncludeInRelease{0000/00/00}{\@doendpe}{clubpenalty fix}
2688 \CheckCommand*\@doendpe{\@endpetrue
2689 \def\par{\@restorepar\everypar{}\par\@endpefalse}\everypar
2690 {{\setbox\z@\lastbox}\everypar{}\@endpefalse}}
2691 \newcommand*{\contract@doendpe}{%
2692 \@endpetrue
2693 \def\par{%
2694 \@restorepar\everypar{%
2695 \csname contract@used@everypar\endcsname
2696 }%
2697 \par\@endpefalse
2698 }%
2699 \everypar{%
2700 {\setbox\z@\lastbox}\everypar{%
2701 \csname contract@used@everypar\endcsname
2702 }%
2703 \@endpefalse
2704 }%
2705 }
2706 \EndIncludeInRelease
2707 %</body>
2708 % \end{macrocode}
2709 % \end{macro}%^^A \EndIncludeInRelease
2710 % \end{macro}%^^A \@gobble@IncludeInRelease
2711 % \end{macro}%^^A \IncludeInRelease
2712 % \end{macro}%^^A \contract@doendpe
2713 % \end{macro}%^^A \@doendpe
2714 % \end{macro}%^^A \contract@used@everypar
2715 %
2716 % \section{Entry to Table of Contents}
2717 % \begin{macro}{\l@cpar}
2718 % Toc entry of contract clauses.
2719 % \changes{scrjura-v3.27}{2019/02/25}{usage of \pkg{tocbasic}}
2720 % This is done using \pkg{tocbasic}. The definition has to be part of the
2721 % initialization of the package, otherwise package options wouldn't be able to
2722 % change the setting.
2723 % \begin{macrocode}
2724 %<*init>
2725 \DeclareTOCStyleEntry[%
2726 indent=1.5em,
2727 numwidth=2em,
2728 level=\maxdimen
2729 ]{default}{cpar}
2730 %</init>
2731 % \end{macrocode}
2732 % \end{macro}
2733 %
2734 % \section{Numbering of Paragraphs and Sentences}
2735 %
2736 % \begin{macro}{\contract@separator}
2737 % \changes{scrjura-v0.7b}{2014/11/03}{\cs{jura@separator} renamed}
2738 % \changes{v0.0.1}{2023-10-10}{\cs{scrjura@separator} renamed}
2739 % Used to make it possible to remove white spaces at the beginning or end.
2740 % \begin{macrocode}
2741 %<*body>
2742 \DeclareRobustCommand*{\contract@separator}[1]{#1}
2743 %</body>
2744 % \end{macrocode}
2745 % \end{macro}
2746 %
2747 % \begin{macro}{\contract@usetype}
2748 % \changes{scrjura-v0.5d}{2010/04/28}{new}
2749 % \changes{scrjura-v0.7b}{2014/11/03}{\cs{jura@usetype} renamed}
2750 % \changes{v0.0.1}{2023-10-10}{\cs{scrjura@usetype} renamed}
2751 % By default it is robust but does only call \cs{contract@@usetype} with the
2752 % only argument.
2753 % \begin{macro}{\contract@@usetype}
2754 % \changes{scrjura-v0.5d}{2010/04/28}{new}
2755 % \changes{scrjura-v0.7b}{2014/11/03}{\cs{jura@@usetype} renamed}
2756 % \changes{v0.0.1}{2023-10-10}{\cs{scrjura@@usetype} renamed}
2757 % This second command is not robust and can easily be redefined. But by
2758 % default it also does nothing but eating the argument.
2759 % \begin{macrocode}
2760 %<*body>
2761 \DeclareRobustCommand*{\contract@usetype}[1]{\contract@@usetype{#1}}
2762 \newcommand*{\contract@@usetype}[1]{}
2763 %</body>
2764 % \end{macrocode}
2765 % \end{macro}
2766 % \end{macro}
2767 %
2768 % \begin{macro}{\contract@everypar}
2769 % The \cs{contract@everpar} used by contracts.
2770 % \begin{macro}{\ifparnumber,\parnumbertrue,\parnumberfalse}
2771 % \changes{scrjura-v0.6}{2011/09/29}{moved the definition into the definition of the
2772 % option}
2773 % \begin{counter}{par}
2774 % \begin{command}{\thepar,\theHpar}
2775 % \changes{scrjura-v3.41}{2023/06/24}{Ulrike Fischer requested to use \cs{def} instead
2776 % of \cs{newcommand*}}
2777 % \begin{command}{\parformat}
2778 % \changes{scrjura-v0.7}{2013/06/07}{new font element \fnt{parnumber}}
2779 % \begin{command}{\parformatseparation}
2780 % \changes{scrjura-v0.9f}{2016/02/06}{new}
2781 % \begin{macro}{\p@par}
2782 % \changes{scrjura-v0.5d}{2010/04/28}{added \cs{jura@usetype} with argument
2783 % \cs{jura@env@type}}
2784 % \begin{command}{\withoutparnumber}
2785 % \changes{scrjura-v3.25}{2017/12/19}{new}
2786 % The boolean defines if paragraph numbers have to be used. If they are
2787 % deactivated also manual paragraph numbers are deactivated and the paragraphs
2788 % are not counted. Otherwise the paragraphs are numbered using \cs{thepar}. It
2789 % is important to reset the paragraph counter with every clause and
2790 % sub-clause. And for labels the parent object the clause has to be used.
2791 % \begin{macrocode}
2792 %<*body>
2793 \newcounter{par}
2794 \renewcommand*{\thepar}{\arabic{par}}
2795 \def\theHpar{\theH@AbsClause-\Roman{par}}
2796 \newcommand*{\parformat}{(\thepar)}
2797 \newcommand*{\parformatseparation}{\nobreakspace}
2798 \newkomafont{parnumber}{}
2799 \renewcommand*\p@par{{\contract@usetype{\contract@env@type}\theSubClause\contract@separator{\nobreakspace}}}
2800 \@addtoreset{par}{Clause}
2801 \@addtoreset{par}{SubClause}
2802 \newcommand*{\withoutparnumber}{}
2803 %</body>
2804 % \end{macrocode}
2805 % \end{command}
2806 % \end{macro}
2807 % \end{command}
2808 % \end{command}
2809 % \end{command}
2810 % \end{counter}
2811 % \end{macro}
2812 % \changes{scrjura-v0.5c}{2010/04/26}{first argument of \cs{newmaxpar} and second
2813 % argument of \cs{getmaxpar} is \meta{contract} not \meta{contractpars}}
2814 % \changes{scrjura-v0.5c}{2010/04/26}{\cs{contract@Clauseformat} expands while writing
2815 % to its own argument}
2816 % \changes{scrjura-v0.7}{2013/04/18}{using counter \cnt{contractAbsoluteClause}}
2817 % \changes{scrjura-v0.7}{2013/05/23}{initializing sentence number for manually
2818 % numbered paragraphs to 0 instead of 1, because first action of
2819 % \cs{Sentence} is increasing the number}
2820 % \changes{scrjura-v0.7}{2013/05/23}{recognize paragraph number of \cs{thisparnumber}}
2821 % \changes{scrjura-v0.7}{2013/06/06}{if paragraph numbers are not completely numerical
2822 % always set the number}
2823 % \changes{scrjura-v0.7b}{2014/11/03}{more flexible replacement of
2824 % \cnt{contractAbsoluteClause}}
2825 % \changes{scrjura-v0.9f}{2016/02/06}{\cs{nobreakspace} replaced by
2826 % \cs{parformatseparation}}
2827 % \changes{scrjura-v0.9g}{2016/03/25}{writing to \file{aux}-file \cs{if@filesw}}
2828 % \begin{macrocode}
2829 %<*body>
2830 \newcommand*{\contract@everypar}{%
2831 \ifparnumber
2832 \ifx\contract@special@par\relax
2833 \ifx\contract@special@reset@par\relax\else
2834 \global\let\thepar\contract@special@reset@par
2835 \global\let\contract@special@reset@par\relax
2836 \fi
2837 \refstepcounter{par}%
2838 \refstepcounter{sentence}%
2839 \else
2840 \ifx\contract@special@reset@par\relax
2841 \global\let\contract@special@reset@par\thepar
2842 \fi
2843 \global\let\thepar\contract@special@par
2844 \global\let\contract@special@par\relax
2845 \setcounter{sentence}{0}\refstepcounter{sentence}%
2846 \fi
2847 \begingroup
2848 \if@filesw
2849 \protected@write\@auxout{%
2850 \expandafter\let\csname \contract@env@type @Clauseformat\endcsname
2851 \@firstofone
2852 }{%
2853 \string\newmaxpar{\contract@env@type}%
2854 {\csname the\contract@env@type
2855 AbsoluteClause\endcsname}%
2856 {\thepar}%
2857 }%
2858 \fi
2859 \getmaxpar\@tempa{\contract@env@type}%
2860 {\csname the\contract@env@type AbsoluteClause\endcsname}%
2861 %<+trace> \typeout{Stored max is \@tempa}%
2862 \def\reserved@a##1\@nnil{\def\@tempa{##1}}%
2863 \afterassignment\reserved@a\@tempcnta=0\@tempa\relax\@nnil
2864 \ifnum \@tempcnta>\@ne
2865 {\usekomafont{parnumber}{\parformat\parformatseparation}}%
2866 \else
2867 \def\reserved@a{\relax}%
2868 \ifx\@tempa\reserved@a
2869 \withoutparnumber
2870 \else
2871 {\usekomafont{parnumber}{\parformat\parformatseparation}}%
2872 \fi
2873 \fi
2874 \endgroup
2875 \else
2876 \begingroup\withoutparnumber\endgroup
2877 \setcounter{sentence}{-1}\refstepcounter{sentence}%
2878 \fi
2879 }
2880 %</body>
2881 % \end{macrocode}
2882 % \end{macro}
2883 %
2884 % \begin{command}{\thisparnumber}
2885 % \changes{scrjura-v0.7}{2013/05/23}{new}
2886 % \begin{macro}{\contract@special@par,\contract@special@reset@par}
2887 % \changes{scrjura-v0.7}{2013/05/23}{new}
2888 % \changes{v0.0.1}{2023-10-10}{\cs{scrjura@special@par} renamed}
2889 % \changes{v0.0.1}{2023-10-10}{\cs{scrjura@special@reset@par} renamed}
2890 % You can use this for manual paragraph numbering. But the number has to be
2891 % fully expandable!
2892 % \begin{macrocode}
2893 %<*body>
2894 \newcommand*{\thisparnumber}[1]{%
2895 \def\contract@special@par{#1}%
2896 }
2897 \newcommand*{\contract@special@par}{}
2898 \let\contract@special@par\relax
2899 \newcommand*{\contract@special@reset@par}{}
2900 \let\contract@special@reset@par\relax
2901 %</body>
2902 % \end{macrocode}
2903 % \end{macro}%^^A \contract@special@par
2904 % \end{command}%^^A\thisparnumber
2905 %
2906 %
2907 % \section{Referencing}
2908 %
2909 % \begin{command}{\refL}
2910 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
2911 % \begin{macro}{\ref@L}
2912 % Similar to \cs{ref} but always the long form.
2913 % \begin{macrocode}
2914 %<*body>
2915 \newcommand*{\refL}{\kernel@ifstar {\ref@L*}{\ref@L{}}}
2916 \newcommand*{\ref@L}[2]{%
2917 \begingroup
2918 \def\parcite@format{0}%
2919 \let\sentencecite@format\parcite@format
2920 \ref#1{#2}%
2921 \endgroup
2922 }
2923 % \end{macrocode}
2924 % \end{macro}
2925 % \end{command}
2926 %
2927 % \begin{command}{\refS}
2928 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
2929 % \begin{macro}{\ref@S}
2930 % Similar to \cs{ref} but always the short form.
2931 % \begin{macrocode}
2932 \newcommand*{\refS}{\kernel@ifstar {\ref@S*}{\ref@S{}}}
2933 \newcommand*{\ref@S}[2]{%
2934 \begingroup
2935 \def\parcite@format{1}%
2936 \let\sentencecite@format\parcite@format
2937 \ref#1{#2}%
2938 \endgroup
2939 }
2940 % \end{macrocode}
2941 % \end{macro}
2942 % \end{command}
2943 %
2944 % \begin{command}{\refN}
2945 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
2946 % \begin{macro}{\ref@N}
2947 % Similar to \cs{ref} but always the numerical form.
2948 % \begin{macrocode}
2949 \newcommand*{\refN}{\kernel@ifstar {\ref@N*}{\ref@N{}}}
2950 \newcommand*{\ref@N}[2]{%
2951 \begingroup
2952 \def\parcite@format{2}%
2953 \let\sentencecite@format\parcite@format
2954 \ref#1{#2}%
2955 \endgroup
2956 }
2957 % \end{macrocode}
2958 % \end{macro}
2959 % \end{command}
2960 %
2961 % \begin{command}{\refClause}
2962 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
2963 % \begin{macro}{\ref@Clause}
2964 % Reference only the clause of a clause, paragraph or sentence. For better
2965 % compatibility with \pkg{hyperref} there is also a star version if
2966 % \pkg{hyperref} is used. Without \pkg{hyperref} the star version is nonsense.
2967 % \begin{macrocode}
2968 \newcommand*{\refClause}{%
2969 \kernel@ifstar {\ref@Clause*}{\ref@Clause{}}
2970 }
2971 \newcommand*{\ref@Clause}[2]{%
2972 \expandafter\ifx\csname r@#2\endcsname\relax
2973 \ref#1{#2}%
2974 \else
2975 \begingroup
2976 % \end{macrocode}
2977 % Copy all parts of the reference but the first one to \cs{@tempb}.
2978 % \begin{macrocode}
2979 \expandafter\expandafter\expandafter\expandafter
2980 \expandafter\expandafter\expandafter\def
2981 \expandafter\expandafter\expandafter\expandafter
2982 \expandafter\expandafter\expandafter\@tempb
2983 \expandafter\expandafter\expandafter\expandafter
2984 \expandafter\expandafter\expandafter{%
2985 \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}%
2986 % \end{macrocode}
2987 % Copy the first part of the reference to \cs{@tempa}.
2988 % \begin{macrocode}
2989 \def\@tempc##1##2\@nil{##1}%
2990 \let\contract@separator\@gobble
2991 \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
2992 \csname r@#2\endcsname\noexpand\@nil}%
2993 % \end{macrocode}
2994 % Copy the first part of \cs{@tempa} to \cs{@tempb}.
2995 % \begin{macrocode}
2996 \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
2997 \@tempa\@nil}%
2998 \let\@@protect\protect
2999 \let\protect\noexpand
3000 \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}%
3001 \let\protect\@@protect
3002 \ref#1{#2}%
3003 \endgroup
3004 \fi
3005 }
3006 % \end{macrocode}
3007 % \end{macro}
3008 % \end{command}
3009 %
3010 % \begin{command}{\refClauseN}
3011 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
3012 % \begin{macro}{\ref@ClauseN}
3013 % Reference only the clause number of a clause, a paragraph or a sentence.
3014 % For improved compatibility with \pkg{hyperref} there is also a star version
3015 % if \pkg{hyperref} is used. Without \pkg{hyperref} the star version is
3016 % nonsense.
3017 % \begin{macrocode}
3018 \newcommand*{\refClauseN}{%
3019 \kernel@ifstar {\ref@ClauseN*}{\ref@ClauseN{}}
3020 }
3021 \newcommand*{\ref@ClauseN}[2]{%
3022 \begingroup
3023 \let\Clauseformat\relax
3024 \ref@Clause{#1}{#2}%
3025 \endgroup
3026 }
3027 % \end{macrocode}
3028 % \end{macro}
3029 % \end{command}
3030 %
3031 % \begin{command}{\refPar}
3032 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
3033 % \begin{macro}{\ref@Par}
3034 % References only the paragraph of a paragraph or sentence.
3035 % For improved compatibility with \pkg{hyperref} there is also a star version
3036 % if \pkg{hyperref} is used. Without \pkg{hyperref} the star version is
3037 % nonsense.
3038 % \begin{macrocode}
3039 \newcommand*{\refPar}{%
3040 \kernel@ifstar {\ref@Par*}{\ref@Par{}}
3041 }
3042 \newcommand*{\ref@Par}[2]{%
3043 \expandafter\ifx\csname r@#2\endcsname\relax
3044 \ref#1{#2}%
3045 \else
3046 \begingroup
3047 % \end{macrocode}
3048 % Copy all parts of the reference but the first one to \cs{@tempb}.
3049 % \begin{macrocode}
3050 \expandafter\expandafter\expandafter\expandafter
3051 \expandafter\expandafter\expandafter\def
3052 \expandafter\expandafter\expandafter\expandafter
3053 \expandafter\expandafter\expandafter\@tempb
3054 \expandafter\expandafter\expandafter\expandafter
3055 \expandafter\expandafter\expandafter{%
3056 \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}%
3057 % \end{macrocode}
3058 % Copy the first part of the reference to \cs{@tempa}.
3059 % \begin{macrocode}
3060 \def\@tempc##1##2\@nil{##1}%
3061 \let\contract@separator\@gobble
3062 \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
3063 \csname r@#2\endcsname\noexpand\@nil}%
3064 % \end{macrocode}
3065 % Copy the second part of \cs{@tempa} to \cs{@tempa} ablegen.
3066 % \begin{macrocode}
3067 \def\@tempc##1##2##3\@nil{##2}%
3068 \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
3069 \@tempa{%
3070 \protect\G@refundefinedtrue
3071 \nfss@text{\reset@font\bfseries ??}%
3072 \@latex@warning{Reference `#2' on page \thepage \space
3073 with undefined par number}%
3074 }\noexpand\@nil}%
3075 \let\@@protect\protect
3076 \let\protect\noexpand
3077 \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}%
3078 \let\protect\@@protect
3079 \ref#1{#2}%
3080 \endgroup
3081 \fi
3082 }
3083 % \end{macrocode}
3084 % \end{macro}
3085 % \end{command}
3086 %
3087 % \begin{command}{\refParL}
3088 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
3089 % \begin{macro}{\ref@ParX}
3090 % The same but long.
3091 % \begin{macrocode}
3092 \newcommand*{\refParL}{%
3093 \kernel@ifstar {\ref@ParX0*}{\ref@ParX0{}}
3094 }
3095 \newcommand*{\ref@ParX}[3]{%
3096 \begingroup
3097 \def\parcite@format{#1}%
3098 \let\sentencecite@format\parcite@format
3099 \ref@Par{#2}{#3}%
3100 \endgroup
3101 }
3102 % \end{macrocode}
3103 % \end{macro}
3104 % \end{command}
3105 %
3106 % \begin{command}{\refParS}
3107 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
3108 % The same but short.
3109 % \begin{macrocode}
3110 \newcommand*{\refParS}{%
3111 \kernel@ifstar {\ref@ParX1*}{\ref@ParX1{}}
3112 }
3113 % \end{macrocode}
3114 % \end{command}
3115 %
3116 % \begin{command}{\refParN}
3117 % \begin{macro}{\ref@ParN}
3118 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifnextchar} replaced by
3119 % \cs{kernel@ifnextchar}}
3120 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
3121 % \begin{macro}{\ref@@ParN}
3122 % The same but numerical.
3123 % \begin{macrocode}
3124 \newcommand*{\refParN}{%
3125 \kernel@ifstar {\ref@ParN2*}{\ref@ParN2{}}
3126 }
3127 \newcommand*{\ref@ParN}[2]{%
3128 \kernel@ifnextchar [%]
3129 {\ref@@ParN{#1}{#2}}%
3130 {\ref@ParX{#1}{#2}}%
3131 }
3132 \newcommand*{\ref@@ParN}{}
3133 \def\ref@@ParN#1#2[#3]#4{%
3134 \begingroup
3135 \renewcommand*{\parnumericformat}[1]{%
3136 \csname @#3\endcsname{\number ##1\relax}%
3137 }%
3138 \ref@ParX{#1}{#2}{#4}%
3139 \endgroup
3140 }
3141 % \end{macrocode}
3142 % \end{macro}
3143 % \end{macro}
3144 % \end{command}
3145 %
3146 % \begin{command}{\refSentence}
3147 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
3148 % \begin{macro}{\ref@Sentence}
3149 % Reference only the sentence of a sentence.
3150 % For improved compatibility with \pkg{hyperref} there is also a star version
3151 % if \pkg{hyperref} is used. Without \pkg{hyperref} the star version is
3152 % nonsense.
3153 % \begin{macrocode}
3154 \newcommand*{\refSentence}{%
3155 \kernel@ifstar {\ref@Sentence*}{\ref@Sentence{}}
3156 }
3157 \newcommand*{\ref@Sentence}[2]{%
3158 \expandafter\ifx\csname r@#2\endcsname\relax
3159 \ref#1{#2}%
3160 \else
3161 \begingroup
3162 % \end{macrocode}
3163 % Copy all parts of the reference to \cs{@tempb}.
3164 % \begin{macrocode}
3165 \expandafter\expandafter\expandafter\expandafter
3166 \expandafter\expandafter\expandafter\def
3167 \expandafter\expandafter\expandafter\expandafter
3168 \expandafter\expandafter\expandafter\@tempb
3169 \expandafter\expandafter\expandafter\expandafter
3170 \expandafter\expandafter\expandafter{%
3171 \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}%
3172 % \end{macrocode}
3173 % Copy the first part of the reference to \cs{@tempa}.
3174 % \begin{macrocode}
3175 \def\@tempc##1##2\@nil{##1}%
3176 \let\contract@separator\@gobble
3177 \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
3178 \csname r@#2\endcsname\noexpand\@nil}%
3179 % \end{macrocode}
3180 % Copy the third part of \cs{@tempa} to \cs{@tempa}.
3181 % \begin{macrocode}
3182 \def\@tempc##1##2##3##4\@nil{##3}%
3183 \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
3184 \@tempa{}{%
3185 \protect\G@refundefinedtrue
3186 \nfss@text{\reset@font\bfseries ??}%
3187 \@latex@warning{Reference `#2' on page \thepage \space
3188 with undefined sentence number}%
3189 }\noexpand\@nil}%
3190 \let\@@protect\protect
3191 \let\protect\noexpand
3192 \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}%
3193 \let\protect\@@protect
3194 \ref#1{#2}%
3195 \endgroup
3196 \fi
3197 }
3198 % \end{macrocode}
3199 % \end{macro}
3200 % \end{command}
3201 %
3202 % \begin{command}{\refSentenceL}
3203 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
3204 % \begin{macro}{\ref@SentenceX}
3205 % The same but long.
3206 % \begin{macrocode}
3207 \newcommand*{\refSentenceL}{%
3208 \kernel@ifstar {\ref@SentenceX0*}{\ref@SentenceX0{}}
3209 }
3210 \newcommand*{\ref@SentenceX}[3]{%
3211 \begingroup
3212 \def\parcite@format{#1}%
3213 \let\sentencecite@format\parcite@format
3214 \ref@Sentence{#2}{#3}%
3215 \endgroup
3216 }
3217 % \end{macrocode}
3218 % \end{macro}
3219 % \end{command}
3220 %
3221 % \begin{command}{\refSentenceS}
3222 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
3223 % The same but short.
3224 % \begin{macrocode}
3225 \newcommand*{\refSentenceS}{%
3226 \kernel@ifstar {\ref@SentenceX1*}{\ref@SentenceX1{}}
3227 }
3228 % \end{macrocode}
3229 % \end{command}
3230 %
3231 % \begin{command}{\refSentenceN}
3232 % \changes{scrjura-v0.9h}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}}
3233 % The same but numeric.
3234 % \begin{macrocode}
3235 \newcommand*{\refSentenceN}{%
3236 \kernel@ifstar {\ref@SentenceX2*}{\ref@SentenceX2{}}
3237 }
3238 %</body>
3239 % \end{macrocode}
3240 % \end{command}
3241 %
3242 % \begin{macro}{\contract@sentence}
3243 % \changes{scrjura-v0.7a}{2014/01/28}{using \cs{textsuperscript}}
3244 % \changes{scrjura-v0.7a}{2014/01/28}{\cs{nobreak}\cs{hskip}\cs{z@} added to allow
3245 % hyphenation of the first word after the sentence mark}
3246 % Numbering of sentences.
3247 % \begin{counter}{sentence}
3248 % \begin{command}{\thesentence,\theHsentence}
3249 % \changes{scrjura-v3.41}{2023/06/24}{Ulrike Fischer requested to use \cs{def} instead
3250 % of \cs{newcommand*}}
3251 % \begin{macro}{\p@sentence}
3252 % \changes{scrjura-v3.27}{2019/10/09}{adaption for \LaTeX{} 2019-10-01}
3253 % The counter is used for numbering the sentences. It is important to add the
3254 % paragraph as parent object to labels. The original method to make it
3255 % possible to use \cs{thesentence} as an argument of \cs{p@sentence} does not
3256 % work any longer using \LaTeX{} 2019-10-01 or newer. It would result in an
3257 % error message. So the code has to be adapted to the new definition of
3258 % \cs{refstepcounter} in \LaTeX{} 2019-10-01. From this version it uses
3259 % \cs{labelformat}. Don't ask me, what I think about the fact, that every new
3260 % versions of \LaTeX{} can break existing packages and package authors have to
3261 % find out such incompatibilities on their own.
3262 % \begin{macrocode}
3263 %<*body>
3264 \newcounter{sentence}[par]
3265 \renewcommand*{\thesentence}{\arabic{sentence}}
3266 \def\theHsentence{\theHpar-\arabic{sentence}}
3267 \scr@ifundefinedorrelax{labelformat}{%
3268 \renewcommand*{\p@sentence}{\expandafter\p@@sentence}
3269 \newcommand*{\p@@sentence}[1]{\p@par{{\par@cite{\thepar}}%
3270 \contract@separator{\nobreakspace}}{\sentence@cite{#1}}}%
3271 }{%
3272 \labelformat{sentence}{\p@par{{\par@cite{\thepar}}%
3273 \contract@separator{\nobreakspace}}{\sentence@cite{#1}}}%
3274 }
3275 \newcommand*{\contract@sentence}{%
3276 % \end{macrocode}
3277 % \changes{scrjura-v0.9e}{2015/11/04}{first start the paragraph then print the number}
3278 % \changes{scrjura-v3.26}{2018/07/20}{new font element \fnt{sentencenumber}}
3279 % \changes{scrjura-v3.26}{2018/07/20}{new formatting \cs{sentencenumberformat}}
3280 % For the numbering it is important not to increase the paragraph number at
3281 % the very beginning, because the paragraph already does so. To make this
3282 % work, the paragraph has to start before we print the number. But immediately
3283 % after a \env{minipage}, a list or a \cs{parbox} we should behave as not
3284 % being at the beginning of a paragraph.
3285 % \begin{macrocode}
3286 \ifvmode
3287 \if@endpe
3288 \refstepcounter{sentence}%
3289 \else
3290 \leavevmode
3291 \fi
3292 \else
3293 \refstepcounter{sentence}%
3294 \fi
3295 {\usekomafont{sentencenumber}{\sentencenumberformat}}%
3296 \nobreak\hskip\z@
3297 }
3298 % \end{macrocode}
3299 % \begin{fontelement}{sentencenumber}
3300 % \begin{command}{\sentencenumberformat}
3301 % \changes{scrjura-v3.26}{2018/07/20}{new}
3302 % Formatting an font can be changed using font element \fnt{sentencenumber}
3303 % and command \cs{sentencenumberformat}. The last has the preset
3304 % \cs{textsuperscript}.
3305 % \begin{macrocode}
3306 \newkomafont{sentencenumber}{}
3307 \newcommand*{\sentencenumberformat}{\textsuperscript{\thesentence}}
3308 %</body>
3309 % \end{macrocode}
3310 % \end{command}
3311 % \end{fontelement}
3312 % \end{macro}
3313 % \end{command}
3314 % \end{counter}
3315 % \end{macro}
3316 %
3317 % \begin{macro}{\par@cite}
3318 % \begin{command}{\parciteformat}
3319 % \changes{scrjura-v0.5d}{2010/04/28}{argument moved}
3320 % Reference style for paragraphs.
3321 % \begin{macrocode}
3322 %<*body>
3323 \DeclareRobustCommand*{\par@cite}[1]{\parciteformat{#1}}
3324 \newcommand*{\parciteformat}[1]{%
3325 \ifcase \parcite@format
3326 \expandafter\parlongformat
3327 \or
3328 \expandafter\parshortformat
3329 \or
3330 \expandafter\parnumericformat
3331 \else
3332 \unskip\expandafter\@gobble
3333 \fi
3334 {#1}%
3335 }
3336 % \end{macrocode}
3337 % \end{command}
3338 % \end{macro}
3339 %
3340 % \begin{macro}{\sentence@cite}
3341 % \begin{command}{\sentenceciteformat}
3342 % \changes{scrjura-v0.5d}{2010/04/28}{argument moved}
3343 % Reference style for sentences. Preset is \cs{@arabic}.
3344 % \begin{macrocode}
3345 \DeclareRobustCommand*{\sentence@cite}[1]{\sentenceciteformat{#1}}
3346 \newcommand*{\sentenceciteformat}[1]{%
3347 \ifcase \sentencecite@format
3348 \expandafter\sentencelongformat
3349 \or
3350 \expandafter\sentenceshortformat
3351 \or
3352 \expandafter\sentencenumericformat
3353 \else
3354 \unskip\expandafter\@gobble
3355 \fi
3356 {#1}%
3357 }
3358 % \end{macrocode}
3359 % \end{command}
3360 % \end{macro}
3361 %
3362 % \begin{command}{\parlongformat,\parshortformat,\parnumericformat,
3363 % \sentencelongformat,\sentenceshortformat,
3364 % \sentencenumericformat}
3365 % The six formattings.
3366 % \begin{macrocode}
3367 \newcommand*{\parlongformat}[1]{\parname~#1}
3368 \newcommand*{\parshortformat}[1]{\parshortname~#1}
3369 \newcommand*{\parnumericformat}[1]{\@Roman{\number #1\relax}}
3370 \newcommand*{\sentencelongformat}[1]{\sentencename~#1}
3371 \newcommand*{\sentenceshortformat}[1]{\sentenceshortname~#1}
3372 \newcommand*{\sentencenumericformat}[1]{\@arabic{\number #1\relax}.}
3373 %</body>
3374 % \end{macrocode}
3375 % \end{command}
3376 %
3377 % \section{Language Dependent Names}
3378 %
3379 % \begin{command}{\parname,\parshortname,\sentencename,\sentenceshortname}
3380 % \begin{macro}{\contract@lang@error}
3381 % \changes{scrjura-v0.7}{2013/09/19}{Usage of \cs{PackageError} instead of
3382 % \cs{PackageErrorNoLine}}
3383 % \changes{scrjura-v3.24}{2017/05/29}{adaption for language name bug in
3384 % \pkg{babel}~3.10}
3385 % \changes{v0.0.1}{2023-10-10}{\cs{scrjura@lang@error} renamed}
3386 % The names of paragraphs and sentences and their short versions. The English
3387 % names are donated by ``m.eik''.
3388 % \begin{macrocode}
3389 %<*body>
3390 \newcommand*{\parname}{Paragraph}
3391 \AtBeginDocument{%
3392 \providecaptionname{german,ngerman,austrian,naustrian}\parname{Absatz}%
3393 \providecaptionname{german,ngerman,austrian,naustrian}\parshortname{Abs.}%
3394 \providecaptionname{german,ngerman,austrian,naustrian}\sentencename{Satz}%
3395 \providecaptionname{german,ngerman,austrian,naustrian}\sentenceshortname{S.}%
3396 \providecaptionname{english,american,british,canadian,%
3397 USenglish,UKenglish,usenglish,ukenglish}\parname{paragraph}%
3398 \providecaptionname{english,american,british,canadian,%
3399 USenglish,UKenglish,usenglish,ukenglish}\parshortname{par.}%
3400 \providecaptionname{english,american,british,canadian,%
3401 USenglish,UKenglish,usenglish,ukenglish}\sentencename{sentence}%
3402 \providecaptionname{english,american,british,canadian,%
3403 USenglish,UKenglish,usenglish,ukenglish}\sentenceshortname{sent.}%
3404 }
3405 \providecommand*{\parname}{\contract@lang@error{\parname}}
3406 \providecommand*{\parshortname}{\contract@lang@error{\parshortname}}
3407 \providecommand*{\sentencename}{\contract@lang@error{\sentencename}}
3408 \providecommand*{\sentenceshortname}{\contract@lang@error{\sentenceshortname}}
3409 \newcommand*{\contract@lang@error}[1]{%
3410 \PackageError{contract}{%
3411 current language not supported%
3412 }{%
3413 Currently contract only supports languages `german', `ngerman',
3414 `austrian',\MessageBreak
3415 `naustrian', `english', `american', `british', `canadian',
3416 `USenglish',\MessageBreak
3417 `UKenglish', `usenglish`, and `ukenglish'.\MessageBreak
3418 It seems, that you are using another language (maybe `\languagename') or
3419 that\MessageBreak
3420 your language selection isn't compatible to package `babel'.\MessageBreak
3421 Because of this you have to define `\string#1' by yourself!\MessageBreak
3422 It would be nice if you'll send your definitions to the author.%
3423 }%
3424 \textbf{??}%
3425 }
3426 %</body>
3427 % \end{macrocode}
3428 % \end{macro}
3429 % \end{command}
3430 %
3431 % \section{Using Values from last \LaTeX{} Run}
3432 %
3433 % \begin{command}{\newmaxpar}
3434 % \changes{scrjura-v0.6b}{2013/04/16}{\cs{\#1@Clauseformat} expands to its argument}
3435 % \begin{command}{\getmaxpar}
3436 % \changes{scrjura-v0.6}{2011/09/30}{argument no 3 is expanded using
3437 % \cs{protected@edef}}
3438 % \changes{scrjura-v0.5c}{2010/04/26}{\cs{protected@edef} replaced by \cs{edef}}
3439 % \changes{scrjura-v0.5c}{2010/04/26}{\cs{\#2@Clauseformat} expands to its argument}
3440 % Two helper macros, to save a counter in a \file{aux}-file and get the value
3441 % back or another value of it is not in the \file{aux}-file.
3442 % \begin{macrocode}
3443 %<*body>
3444 \newcommand*{\newmaxpar}[3]{%
3445 \begingroup
3446 \expandafter\let\csname #1@Clauseformat\endcsname\@firstofone
3447 \protected@edef\@tempa{#2}\@onelevel@sanitize\@tempa
3448 \expandafter\xdef\csname max@#1@\@tempa\endcsname{#3}%
3449 \endgroup
3450 }
3451 \newcommand*{\getmaxpar}[3]{%
3452 \begingroup
3453 \expandafter\let\csname #2@Clauseformat\endcsname\@firstofone
3454 \protected@edef\@tempa{#3}%
3455 \@onelevel@sanitize\@tempa
3456 \expandafter\ifx \csname max@#2@\@tempa\endcsname\relax
3457 \edef\@tempa{\endgroup\edef\noexpand#1{\expandafter\the\value{par}}}%
3458 \else
3459 \edef\@tempa{\endgroup
3460 \edef\noexpand#1{\csname max@#2@\@tempa\endcsname}}%
3461 \fi
3462 \@tempa
3463 }
3464 % \end{macrocode}
3465 % \changes{scrjura-v0.7b}{2014/11/10}{added fallback code to \file{aux}-file}
3466 % \changes{scrjura-v0.9g}{2015/03/25}{write to \file{aux}-file \cs{if@filesw}}
3467 % Because some users remove \pkg*{contract} from their documents without
3468 % deleting the \file{aux}-file, we add a fallback definition of \cs{newmaxpar}
3469 % to the \file{aux}-file. This avoids error messages because of undefined
3470 % \cs{newmaxpar}.
3471 % \begin{macrocode}
3472 \AtBeginDocument{%
3473 \if@filesw
3474 \immediate\write\@auxout{%
3475 \string\providecommand*\string\newmaxpar[3]{}
3476 }%
3477 \fi
3478 }
3479 %</body>
3480 % \end{macrocode}
3481 % \end{command}
3482 % \end{command}
3483 %
3484 % \iffalse
3485 %</package>
3486 % \fi
3487 %
3488 % \Finale
3489 %
3490 \endinput
3491 % Local Variables:
3492 % mode: doctex
3493 % ispell-local-dictionary: "en_US"
3494 % eval: (flyspell-mode 1)
3495 % TeX-master: t
3496 % TeX-engine: luatex-dev
3497 % eval: (setcar (or (cl-member "Index" (setq-local TeX-command-list (copy-alist TeX-command-list)) :key #'car :test #'string-equal) (setq-local TeX-command-list (cons nil TeX-command-list))) '("Index" "mkindex %s" TeX-run-index nil t :help "makeindex for dtx"))
3498 % End:
3499 %
3500 % LocalWords: cautelar