1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
|
%%
%% This is file `scrwfile.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% scrwfile.dtx (with options: `package')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from scrwfile.sty.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file scrwfile.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%% From File: $Id: scrwfile.dtx 4018 2023-03-31 07:31:04Z kohm $
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{scrwfile}
[2023-03-31 v0.1.99 KOMA-Script package (write and clone files)]
\PackageWarningNoLine{scrwfile}{%
THIS IS AN EXPERIMENTAL PACKAGE!\MessageBreak
USAGE OF THIS PACKAGE IS ON YOUR OWN RISK!\MessageBreak
EVERYTHING MAY HAPPEN!\MessageBreak
EVERYTHING MAY CHANGE IN FUTURE!\MessageBreak
THERE IS NO SUPPORT, IF YOU USE THIS PACKAGE!\MessageBreak
Maybe, it would be better not to load this package%
}
\RequirePackage{scrbase}[2015/08/29]
\RequirePackage{scrlfile}[2010/09/30]
\RequirePackage{iftex}
\ifluatex
\PackageWarningNoLine{scrwfile}{LuaLaTeX detected.\MessageBreak
With LuaLaTeX you should never get an error message:\MessageBreak
\space\space`No room for a new \string\write'.\MessageBreak
So scrwfile could make much more harm than benefit\MessageBreak
and using it is not recommended}%
\fi
\newcommand*{\scrwfile@if@only}[1]{%
\begingroup
\scr@ifundefinedorrelax{scrwfile@only}{\@tempswatrue}{%
\@tempswafalse
\edef\reserved@b{#1}%
\@for\reserved@a:=\scrwfile@only\do
{\ifx\reserved@a\reserved@b\@tempswatrue\fi}%
}%
\if@tempswa
\scr@ifundefinedorrelax{scrwfile@never}{}{%
\edef\reserved@b{#1}%
\@for\reserved@a:=\scrwfile@never\do
{\ifx\reserved@a\reserved@b\@tempswafalse\fi}%
}%
\fi
\expandafter\endgroup
\if@tempswa
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
}
\newcommand*{\scrwfile@starttoc}[1]{%
\scrwfile@if@only{#1}{\scrwfile@@starttoc}{\scrwfile@saved@starttoc}{#1}%
}
\newcommand*{\scrwfile@@starttoc}[1]{%
\begingroup
\if@filesw
\xdef\scrwfile@writefilelist{\scrwfile@writefilelist,#1}%
\fi
\@fileswfalse
\scrwfile@saved@starttoc{#1}%
\endgroup
}
\newcommand*{\scrwfile@writefile}[1]{%
\scrwfile@if@only{#1}{\scrwfile@@writefile}{\scrwfile@saved@writefile}{#1}%
}
\newcommand{\scrwfile@@writefile}[2]{%
\ifnum\scrwfile@wrtout>0
\begingroup
\@temptokena{#2}%
\immediate\write\scrwfile@wrtout{%
\string\@writefile{#1}{\the\@temptokena}%
}%
\scrwfile@process@clones{#1}%
\endgroup
\fi
}
\chardef\scrwfile@wrtout\z@
\newcommand*{\scrwfile@writefilelist}{}
\newcommand*{\scrwfile@saved@writefile}{}
\BeforeClosingMainAux{%
\ifx\scrwfile@writefilelist\@empty\else
\let\scrwfile@saved@writefile\@writefile
\let\scrwfile@wrtout\@partaux
\immediate\openout\scrwfile@wrtout \jobname.wrt
\let\@writefile\scrwfile@writefile
\fi
}
\AfterReadingMainAux{%
\ifx\scrwfile@writefilelist\@empty\else
\immediate\closeout\scrwfile@wrtout
\chardef\scrwfile@wrtout\z@
\begingroup
\let\@writefile\scrwfile@saved@writefile
\@for\@currext:=\scrwfile@writefilelist\do{%
\begingroup
\ifx\@currext\@empty\else
\scr@ifundefinedorrelax{tf@\@currext}{%
\immediate\openout\@partaux \jobname.\@currext
\expandafter\let\csname tf@\@currext\endcsname\@partaux
\@input@{\jobname.wrt}%
\immediate\closeout\@partaux
}{}%
\fi
\endgroup
}%
\endgroup
\fi
}
\IfLTXAtLeastTF{2020/10/01}{%
\DeclareHookRule{enddocument/afteraux}%
{scrwfile}{before}{scrlayer-notecolumn}%
}{%
\@ifpackageloaded{scrlayer-notecolumn}{%
\PackageWarningNoLine{scrwfile}{%
Dangerous package order detected!\MessageBreak
As a general rule, you should load scrwfile as soon\MessageBreak
as possible, maybe even before `\string\documentclass'\MessageBreak
(using `\string\RequirePackage' instead of
`\string\usepackage').\MessageBreak
Following packages should be loaded after scrwfile:\MessageBreak
\space - scrlayer-notecolumn}%
}{}%
}
\newcommand*{\scrwfile@saved@starttoc}{}
\AtBeginDocument{%
\begingroup
\@ifpackageloaded{hyperref}{%
\scr@ifundefinedorrelax{Hy@AtBeginDocument}{%
\PackageInfo{scrwfile}{%
Using immediate redefinition of `\string\@starttoc'%
}%
\aftergroup\@firstofone
}{%
\ifx\Hy@AtBeginDocumentHook\@undefined
\PackageInfo{scrwfile}{%
Using immediate redefinition of `\string\@starttoc'%
}%
\aftergroup\@firstofone
\else
\@ifpackagelater{hyperref}{2022/02/22}{% newer than v7.00n
\PackageInfo{scrwfile}{%
Using immediate redefinition of `\string\@starttoc'%
}%
\aftergroup\@firstofone
}{%
\PackageWarning{scrwfile}{%
Outdated package `hyperref' detected.\MessageBreak
Using `\string\Hy@AtBeginDocument' for redefinition of
`\string\@starttoc'.\MessageBreak
We recommend to update `hyperref'
}%
\aftergroup\Hy@AtBeginDocument
}%
\fi
}%
}{%
\PackageInfo{scrwfile}{%
Using immediate redefinition of `\string\@starttoc'%
}%
\aftergroup\@firstofone
}%
\endgroup
{%
\PackageInfo{scrwfile}{%
Extending `\string\@starttoc`
}%
\let\scrwfile@saved@starttoc\@starttoc
\let\@starttoc\scrwfile@starttoc
}%
}
\newcommand*{\scrwfile@process@clones}[1]{%
\scr@ifundefinedorrelax{scrwfile@clone@#1}{}{%
\begingroup
\let\@@protect\protect\let\protect\@empty\afterassignment\restore@protect
\edef\reserved@b{\csname scrwfile@clone@#1\endcsname}%
\edef\reserved@c{,#1}%
\@for \reserved@a:=\reserved@b\do {%
\@tempswatrue
\@for \reserved@d:=\reserved@c\do {%
\ifx\reserved@d\reserved@a\@tempswafalse\fi
}%
\if@tempswa
\immediate\write\scrwfile@wrtout{%
\string\@writefile{\reserved@a}{\the\@temptokena}%
}%
\edef\reserved@c{\reserved@c,\reserved@a}%
\fi
}%
\endgroup
}%
}%
\newcommand*{\TOCclone}[3][]{%
\RequirePackage{tocbasic}%
\scr@ifundefinedorrelax{scrwfile@clone@#2}{%
\expandafter\protected@edef\csname scrwfile@clone@#2\endcsname{%
#3,\protect\csname scrwfile@clone@#3\endcsname
}%
}{%
\edef\reserved@b{\csname scrwfile@clone@#2\endcsname}%
\expandafter\protected@edef\csname scrwfile@clone@#2\endcsname{%
\csname scrwfile@clone@#2\endcsname,%
#3,%
\protect\csname scrwfile@clone@#3\endcsname
}%
}%
\scr@ifundefinedorrelax{scrwfile@clone@#3}{%
\expandafter\let\csname scrwfile@clone@#3\endcsname\@empty
}{}%
\Ifattoclist{#3}{%
\PackageWarning{scrwfile}{`#3' already under control of
tocbasic.\MessageBreak
Nevertheless features will be set%
}%
}{%
\addtotoclist[TOCclone]{#3}%
}%
\setuptoc{#3}{nobabel}%
\IfArgIsEmpty{#1}{%
}{%
\@namedef{listof#3name}{#1}%
\@namedef{listof#3}{\listoftoc{#3}}%
\Iftocfeature{#2}{leveldown}{\setuptoc{#3}{leveldown}}{}%
\Iftocfeature{#2}{numbered}{\setuptoc{#3}{numbered}}{}%
\Iftocfeature{#2}{onecolumn}{\setuptoc{#3}{leveldownonecolumn}}{}%
\Iftocfeature{#2}{totoc}{\setuptoc{#3}{totoc}}{}%
}%
}
\@onlypreamble\TOCClone
\endinput
%%
%% End of file `scrwfile.sty'.
|