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 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
|
% ======================================================================
% scrdocstrip.tex
% Copyright (c) Markus Kohm, 2013
%
% This file is part of the LaTeX2e KOMA-Script bundle.
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, version 1.3c of the license.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later and of this work.
%
% This work has the LPPL maintenance status "author-maintained".
%
% The Current Maintainer and author of this work is Markus Kohm.
%
% This work consists of all files listed in manifest.txt.
% ----------------------------------------------------------------------
% scrdocstrip.tex
% Copyright (c) Markus Kohm, 2013
%
% Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz,
% Version 1.3c, verteilt und/oder veraendert werden.
% Die neuste Version dieser Lizenz ist
% http://www.latex-project.org/lppl.txt
% und Version 1.3c ist Teil aller Verteilungen von LaTeX
% Version 2005/12/01 oder spaeter und dieses Werks.
%
% Dieses Werk hat den LPPL-Verwaltungs-Status "author-maintained"
% (allein durch den Autor verwaltet).
%
% Der Aktuelle Verwalter und Autor dieses Werkes ist Markus Kohm.
%
% Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien.
% ======================================================================
\expandafter\ifx\csname scrdocstripversion\endcsname\relax
\let\KOMAbatchfile\batchfile
\let\batchfile\undefined
\fi
\expandafter\ifx\csname ifbeta\endcsname\undefined
\expandafterlet\csname ifbeta\expandafter\csname iftrue\endcsname
\fi
\input docstrip.tex
\ifx\generate\undefined
\errhelp{| This installation requires docstrip version 2.3c or * later,^^J%
| but an old version of docstrip has been input.^^J%
| This error is fatal, because You have to update docstrip and maybe LaTeX
fist!}
\errmessage{| Fatal error: Old docstrip in input path}
\batchmode
\csname @@end\endcsname
\fi
\expandafter\ifx\csname scrdocstripversion\endcsname\relax
\else \expandafter\endinput
\fi
\Msg{| Using KOMA-Script's docstrip extensions.}
% Support for variables:
\def\KOMAdefVariable#1#2{%
\expandafter\def\csname KOMAvar@#1\endcsname{#2}%
}
\def\KOMAifVariable#1{%
\expandafter\ifx\csname KOMAvar@#1\endcsname\relax
\expandafter\@secondoftwo
\else
\expandafter\@firstoftwo
\fi
}
\def\KOMAuseVariable#1{%
\KOMAifVariable{#1}{%
\csname KOMAvar@#1\endcsname
}{%
variable #1\undefined
}%
}
\KOMAdefVariable{AUTHOR}{Markus Kohm}
\KOMAdefVariable{COPYRIGHT}{%
Copyright (c)
\KOMAifVariable{COPYRIGHTFROM}{\KOMAuseVariable{COPYRIGHTFROM}-}{}%
\KOMAifVariable{COPYRIGHTTILL}{\KOMAuseVariable{COPYRIGHTTILL}}{}
\KOMAuseVariable{AUTHOR}%
\KOMAifVariable{EMAIL}{ \KOMAuseVariable{EMAIL}}{}%
}
\KOMAdefVariable{COPYRIGHTCOMMENT}{%
\MetaPrefix\space\KOMAuseVariable{COPYRIGHT}%
}
% Provide validity test: All files listed in a file must exists.
% You should note, that some TeX distributions cannot find files without
% extension!
\def\defuppercase#1#2{%
\edef\reserved@a{\noexpand\def\noexpand#1{#2}}%
\expandafter\uppercase\expandafter{\reserved@a}%
}
\def\KOMAdocExtensions{HTML,PDF,TXT}
\let\KOMAdocFilesMissing\empty
\let\KOMAnoFilesMissing\empty
\let\KOMAFilesMissing\empty
\def\getlastextension#1.#2.#3\@nil{%
\ifx\relax#2\relax
\ifx\relax#3\relax
\else
#1%
\fi
\else
\getlastextension#2.#3..\@nil
\fi
}
\def\KOMAvalidityTest#1{%
\maybeMsg{^^J| Testing validity of distribution: }%
\begingroup
\def\readloop{%
\ifeof\inFile\else
\read\inFile to \input@testfile\relax
\ifx\input@testfile\empty
\maybeMsg{\space}%
\else
\openin\inputcheck \input@testfile\relax
\ifeof\inputcheck
\maybeMsg{-}%
\defuppercase\reserved@a{%
\expandafter\getlastextension\input@testfile..\@nil
}%
\ifx\reserved@a\empty
\@addto\KOMAnoFilesMissing{\noexpand\do{\input@testfile}}%
\let\reserved@a\empty
\else
\forlist\reserved@b:=\KOMAdocExtensions\do
\ifx\reserved@a\reserved@b
\@addto\KOMAdocFilesMissing{\noexpand\do{\input@testfile}}%
\let\reserved@a\empty
\Forlistfalse
\fi
\od
\fi
\ifx\reserved@a\empty\else
\@addto\KOMAFilesMissing{\noexpand\do{\input@testfile}}%
\fi
\else
\maybeMsg{+}%
\fi
\closein\inputcheck
\fi
\expandafter\readloop
\fi
}%
\endlinechar=256
\openin\inFile #1\relax
\ifeof\inFile
\global\@addto\KOMAFilesMissing{\noexpand\do{#1}}%
\else
\readloop
\closein\inFile
\fi
\ifx\KOMAFilesMissing\empty
\ifx\KOMAdocFilesMissing\empty
\ifx\KOMAnoFilesMissing\empty
\maybeMsg{\space OK.^^J}%
\fi
\fi
\else
\def\do##1{,^^J| \@spaces\@spaces\@spaces##1}%
\errhelp{| You should ask your distributor for a valid and legal
distribution.}%
\errmessage{^^J%
| Missing files: \expandafter\expandafter\expandafter\@gobble
\KOMAFilesMissing\KOMAdocFilesMissing\KOMAnoFilesMissing^^J%
| Distribution seems to be invalid.^^J%
| This error is fatal}%
\batchmode
\csname @@end\endcsname
\fi
\global\let\KOMAnoFilesMissing\KOMAnoFilesMissing
\global\let\KOMAdocFilesMissing\KOMAdocFilesMissing
\endgroup
}
\def\@gobbletwo#1#2{}
\expandafter\def\expandafter\ReportTotals\expandafter{\ReportTotals
\ifx\KOMAnoFilesMissing\empty\else
\Msg{%
+----------------------------------------------------------------------%
^^J%
| Following files without extension seem to be missing:}
\begingroup
\def\do##1{,^^J| \space\space##1}%
\Msg{\expandafter\expandafter\expandafter\@gobbletwo\KOMAnoFilesMissing}
\endgroup
\Msg{%
| PLEASE NOTE, THAT DISTRIBUTIONS WITHOUT THOSE FILES ARE NOT ALLOWED!^^J%
| But maybe those files are there and you're TeX distribution simply^^J%
| cannot open files without extension.^^J%
+----------------------------------------------------------------------}
\fi
\ifx\KOMAdocFilesMissing\empty\else
\Msg{%
+----------------------------------------------------------------------%
^^J%
| Following documentations files are missing:}
\begingroup
\def\do##1{,^^J| \space\space##1}%
\Msg{\expandafter\expandafter\expandafter\@gobbletwo\KOMAdocFilesMissing}
\endgroup
\Msg{%
| PLEASE NOTE, THAT DISTRIBUTIONS WITHOUT THOSE FILES ARE NOT ALLOWED!^^J%
| MAYBE YOU CAN GENERATE THOSE FILES FROM OTHER PARTS OF THE SOURCES.^^J%
+----------------------------------------------------------------------}
\fi
}
% Extend line scanner by:
% - %!VARIABLE : to write variable into files
% - %?VARIABLE=VALUE : to setup a new variable
\begingroup
\catcode`\%=12 \catcode`\*=14
\gdef\processLineX%#1{*
\ifcase\ifx%#10\else
\ifx<#11\else
\ifx!#12\else 3\fi\fi\fi\relax
\expandafter\putMetaComment\or
\expandafter\checkOption\or
\expandafter\KOMAexpandVariable\or
\expandafter\removeComment\fi
#1}
\gdef\KprocessLineX%#1{*
\ifcase\ifx%#10\else
\ifx<#11\else
\ifx!#12\else
\ifx?#13\else 4\fi\fi\fi\fi\relax
\expandafter\putMetaComment\or
\expandafter\checkOption\or
\expandafter\KOMAexpandVariable\or
\expandafter\KOMAsetVariable\or
\expandafter\removeComment\fi
#1}
\endgroup
\def\KOMAexpandVariable!#1\endLine{%
\advance\codeLinesPassed\@ne
\maybeMsg{x}%
\edef\inLine{\KOMAuseVariable{#1}}%
\let\do\putline@do
\activefiles
}
\def\KOMAsetVariable?#1=#2\endLine{%
\expandafter\gdef\csname KOMAvar@#1\endcsname{#2}%
}
% Extend heading
\def\ds@heading{%
\expandafter\ifx\csname ifbeta\expandafter\endcsname
\csname iftrue\endcsname
\use@Warning{\outFileName}{%
YOU SHOULD NOTE, THAT THIS IS NOT AN OFFICIAL RELEASE!^^J%
THIS VERSION IS INTENDED TO BE USED FOR TESTING ONLY!^^J%
USAGE FOR PURPOSES OTHER THAN INTENDED IS DANGEROUS!^^J%
DON'T EXPECT ANY SUPPORT FOR THIS VERSION!%
}%
\fi
\MetaPrefix ^^J%
\MetaPrefix\space This is file `\outFileName',^^J%
\MetaPrefix\space generated with the docstrip utility, extended by
scrdocstrip.^^J%
}
\def\commentWarning#1#2{%
\MetaPrefix\space
-------------------------------------------------------------------------^^J%
\@commentWarning#2^^J\@nil
\MetaPrefix\space
-------------------------------------------------------------------------^^J%
}
\def\@commentWarning#1^^J#2\@nil{%
\MetaPrefix\space #1^^J%
\ifx\relax#2\relax\else\@commentWarning#2\@nil\fi
}
\def\KNL{^\empty^J\perCent^^J}
\def\genericWarning#1#2{%
\string\immediate\string\write17{\KNL
+----------------------------------------------------------------------\KNL
| WARNING (`#1'):\KNL
+----------------------------------------------------------------------\KNL
\@genericWarning#2^^J\@nil
+----------------------------------------------------------------------\KNL
}^^J%
}
\def\@genericWarning#1^^J#2\@nil{%
| #1\KNL
\ifx\relax#2\relax\else\@genericWarning#2\@nil\fi
}
\def\useWarning#1{\let\use@Warning#1}
\useWarning\genericWarning
% Now, we need some code from docstrip to start old docstrip-processing
\ifx\undefined\KOMAbatchfile\else
\Defaultfalse
\let\batchfile\KOMAbatchfile
\def\process@first@batchfile{%
\processbatchFile
\ifnum\NumberOfFiles=\z@
\interactive
\fi
\endbatchfile
}
\fi
\chardef\scrdocstripversion 1\relax
\process@first@batchfile
\endinput
%
% end of file `scrdocstrip.tex'
|