summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/extract
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-19 03:00:38 +0000
committerNorbert Preining <norbert@preining.info>2019-09-19 03:00:38 +0000
commit344e74a832ad49360aa4e08c467ff783c1f02f66 (patch)
tree40f366f591a98147966bf890234761e337aaac61 /macros/latex/contrib/extract
parent841a985f019b145be416f24859bcd1e0833ddb76 (diff)
CTAN sync 201909190300
Diffstat (limited to 'macros/latex/contrib/extract')
-rw-r--r--macros/latex/contrib/extract/README4
-rw-r--r--macros/latex/contrib/extract/extract.dtx91
-rw-r--r--macros/latex/contrib/extract/extract.pdfbin229260 -> 231413 bytes
-rw-r--r--macros/latex/contrib/extract/extract.sty545
4 files changed, 612 insertions, 28 deletions
diff --git a/macros/latex/contrib/extract/README b/macros/latex/contrib/extract/README
index c54f79fc8a..581b965c20 100644
--- a/macros/latex/contrib/extract/README
+++ b/macros/latex/contrib/extract/README
@@ -1,5 +1,5 @@
-extract v1.9
-------------
+extract v1.9a
+-------------
This package can be used to (conditionally) extract specific
commands and environments from a source file and write them to a
diff --git a/macros/latex/contrib/extract/extract.dtx b/macros/latex/contrib/extract/extract.dtx
index 42aa96f4c5..801a983433 100644
--- a/macros/latex/contrib/extract/extract.dtx
+++ b/macros/latex/contrib/extract/extract.dtx
@@ -16,7 +16,7 @@
% extract.sty
%
%% ---------------------------------------
-%% Copyright (C) 2004-2005 Hendri Adriaens
+%% Copyright (C) 2004-2019 Hendri Adriaens
%% ---------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -109,7 +109,7 @@ of the package.
%
% \GetFileInfo{extract.sty}
%
-% \CheckSum{1011}
+% \CheckSum{1069}
%
% \DoNotIndex{\@backslashchar,\@bsphack,\@checkend,\@currenvir,
% \@currenvline,\@doendpe,\@eha,\@ehc,\@empty,\@endpefalse,\@esphack,
@@ -920,7 +920,7 @@ of the package.
%<*extract>
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{extract}
- [2019/09/17 v1.9 extract content from document (HA)]
+ [2019/09/18 v1.9a extract content from document (HA)]
\RequirePackage{verbatim}
\RequirePackage{xkeyval}
\newwrite\XTR@out
@@ -1086,47 +1086,50 @@ of the package.
% \end{macro}
% \begin{macro}{\begin}
% \marg{environment}\\
-% \changes{v1.9}{2019/09/17}{Changed definition to robust version}
+% \changes{v1.9a}{2019/09/18}{Added definitions for robust versions of \cs{begin} and \cs{end}}
% Modify the macro |\begin| to allow adding code to a level specific
% hook which can be executed after |\endgroup| in |\end|. See for
-% more info on this macro the \LaTeX\ source~\cite{LaTeXbase}.
-% \begin{macrocode}
-\@namedef{begin}#1{%
- \@ifundefined{#1}%
- {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}%
- {\def\reserved@a{\def\@currenvir{#1}%
- \edef\@currenvline{\on@line}%
- \csname #1\endcsname}}%
- \@ignorefalse
- \begingroup\@endpefalse
+% more info on this macro the \LaTeX\ source~\cite{LaTeXbase}. We first do this
+% for the new \LaTeX\ format, which defines robust versions of |\begin| and |\end|.
+% \begin{macrocode}
+\@ifl@t@r\fmtversion{2019/10/01}%
+{% new format
+ \@namedef{begin }#1{%
+ \@ifundefined{#1}%
+ {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}%
+ {\def\reserved@a{\def\@currenvir{#1}%
+ \edef\@currenvline{\on@line}%
+ \csname #1\endcsname}}%
+ \@ignorefalse
+ \begingroup\@endpefalse
% \end{macrocode}
% Advance depth level.
% \begin{macrocode}
- \global\advance\@envdepth\@ne
+ \global\advance\@envdepth\@ne
% \end{macrocode}
% Initialize the hook for this level.
% \begin{macrocode}
- \global\@namedef{@afterendenvhook@\romannumeral\@envdepth}{}%
- \reserved@a}
+ \global\@namedef{@afterendenvhook@\romannumeral\@envdepth}{}%
+ \reserved@a
+ }%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\end}
% \marg{environment}\\
-% \changes{v1.9}{2019/09/17}{Changed definition to robust version}
% Modify |\end| to execute the code collected in the hook.
% \begin{macrocode}
-\@namedef{end}#1{%
- \csname end#1\endcsname\@checkend{#1}%
- \expandafter\endgroup\if@endpe\@doendpe\fi
+ \@namedef{end }#1{%
+ \csname end#1\endcsname\@checkend{#1}%
+ \expandafter\endgroup\if@endpe\@doendpe\fi
% \end{macrocode}
% Copy current hook code to a temporary macro.
% \begin{macrocode}
- \expandafter\let\expandafter\reserved@a
- \csname @afterendenvhook@\romannumeral\@envdepth\endcsname
+ \expandafter\let\expandafter\reserved@a
+ \csname @afterendenvhook@\romannumeral\@envdepth\endcsname
% \end{macrocode}
% Decrease the depth.
% \begin{macrocode}
- \global\advance\@envdepth\m@ne
+ \global\advance\@envdepth\m@ne
% \end{macrocode}
% Execute the hook of the current environment. This is done after
% decreasing the depth as to avoid level mixing problems when the
@@ -1135,8 +1138,44 @@ of the package.
% defined since it is executed after the group and does not belong
% anymore to the environment in which the hook was defined.
% \begin{macrocode}
- \reserved@a\relax
- \if@ignore\@ignorefalse\ignorespaces\fi}
+ \reserved@a\relax
+ \if@ignore\@ignorefalse\ignorespaces\fi
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\begin}
+% \marg{environment}\\
+% This is the code for the old format of \LaTeX.
+% \begin{macrocode}
+}{% old format
+ \def\begin#1{%
+ \@ifundefined{#1}%
+ {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}%
+ {\def\reserved@a{\def\@currenvir{#1}%
+ \edef\@currenvline{\on@line}%
+ \csname #1\endcsname}}%
+ \@ignorefalse
+ \begingroup\@endpefalse
+ \global\advance\@envdepth\@ne
+ \global\@namedef{@afterendenvhook@\romannumeral\@envdepth}{}%
+ \reserved@a
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\end}
+% \marg{environment}
+% This is the code for the old format of \LaTeX.
+% \begin{macrocode}
+ \def\end#1{%
+ \csname end#1\endcsname\@checkend{#1}%
+ \expandafter\endgroup\if@endpe\@doendpe\fi
+ \expandafter\let\expandafter\reserved@a
+ \csname @afterendenvhook@\romannumeral\@envdepth\endcsname
+ \global\advance\@envdepth\m@ne
+ \reserved@a\relax
+ \if@ignore\@ignorefalse\ignorespaces\fi
+ }%
+}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\AfterEndEnv}
diff --git a/macros/latex/contrib/extract/extract.pdf b/macros/latex/contrib/extract/extract.pdf
index 1ed5ee687d..b980a38125 100644
--- a/macros/latex/contrib/extract/extract.pdf
+++ b/macros/latex/contrib/extract/extract.pdf
Binary files differ
diff --git a/macros/latex/contrib/extract/extract.sty b/macros/latex/contrib/extract/extract.sty
new file mode 100644
index 0000000000..2bf5f5d3a4
--- /dev/null
+++ b/macros/latex/contrib/extract/extract.sty
@@ -0,0 +1,545 @@
+%%
+%% This is file `extract.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% extract.dtx (with options: `extract')
+%%
+%% ---------------------------------------
+%% Copyright (C) 2004-2019 Hendri Adriaens
+%% ---------------------------------------
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3 or later is part of all distributions of LaTeX
+%% version 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer of this work is Hendri Adriaens.
+%%
+%% This work consists of the file extract.dtx and the derived files
+%% extract.sty, xtrex1.tex, xtrex2.tex, xtrex3.tex, xtrex4.tex,
+%% xtrex5.tex, xtrex6.tex and xtrex7.tex.
+%%
+%% The following files constitute the extract package and must be
+%% distributed as a whole: readme, extract.dtx, extract.pdf and
+%% extract.sty.
+%%
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+\ProvidesPackage{extract}
+ [2019/09/18 v1.9a extract content from document (HA)]
+\RequirePackage{verbatim}
+\RequirePackage{xkeyval}
+\newwrite\XTR@out
+\newwrite\XTR@tmp
+\newif\ifXTR@st
+\newif\ifXTR@skip
+\newif\ifXTR@extract
+\def\XTR@err#1{\PackageError{extract}{#1}\@ehc}
+\def\XTR@namelet#1#2{%
+ \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname
+}
+\define@boolkey[XTR]{extract.sty}[XTR@]{active}[true]{}
+\define@boolkey[XTR]{extract.sty}[XTR@]{header}[true]{}
+\define@boolkey[XTR]{extract.sty}[XTR@]{handles}[true]{}
+\define@boolkey[XTR]{extract.sty}[XTR@]{copydocumentclass}[true]{}
+\DeclareOptionX[XTR]{generate}{\lowercase{\def\XTR@file{#1}}}
+\DeclareOptionX[XTR]{extract-env}{%
+ \def\XTR@envs{#1}%
+ \XKV@for@n{#1}\XTR@tempa\XTR@tempb
+}
+\DeclareOptionX[XTR]{extract-cmd}{%
+ \def\XTR@cmdsargs{#1}%
+ \XKV@for@n{#1}\XTR@tempa\XTR@tempb
+}
+\DeclareOptionX[XTR]{extract-cmdline}{%
+ \def\XTR@cmdsline{#1}%
+ \XKV@for@n{#1}\XTR@tempa\XTR@tempb
+}
+\def\XTR@tempb{%
+ \DeclareOptionX[XTR]{\XTR@tempa-nrs}{%
+ \expandafter\XKV@sp@deflist\csname XTR@\XKV@tkey\endcsname{##1}%
+ \XTR@namelet{XTR@\XKV@tkey @cnt}{z@}%
+ }%
+ \DeclareOptionX[XTR]{\XTR@tempa-labels}{%
+ \expandafter\XKV@sp@deflist\csname XTR@\XKV@tkey\endcsname{##1}%
+ }%
+}
+\def\XTR@tempa{line}\XTR@tempb
+\def\XTR@tempa{extract}\XTR@tempb
+\def\XTR@tempa{extractskip}\XTR@tempb
+\DeclareOptionX*{\XTR@err{Unknown option `\CurrentOption'}}
+\ExecuteOptionsX[XTR]{header=true,handles=true,copydocumentclass=true}
+\ProcessOptionsX[XTR]
+\def\XTR@opentmp{\immediate\openout\XTR@tmp\jobname.xtr\relax}
+\def\XTR@writetmp{\immediate\write\XTR@tmp}
+\def\XTR@closetmp{\immediate\closeout\XTR@tmp}
+\def\XTR@writeout{\immediate\write\XTR@out}
+\ifXTR@active
+ \XKV@ifundefined{XTR@file}{
+ \XTR@activefalse
+ \XTR@err{no file to generate; extract deactivated}
+ }{}
+ \XTR@opentmp
+ \XTR@writetmp{%
+ \string\lowercase{\string\def\string\XTR@tempa{\jobname}}%
+ }
+ \XTR@closetmp
+ \input{\jobname.xtr}
+ \ifx\XTR@tempa\XTR@file
+ \XTR@activefalse
+ \XTR@err{attempt to overwrite source file; extract deactivated}
+ \fi
+\fi
+\newcount\@envdepth\@envdepth\z@
+\@ifl@t@r\fmtversion{2019/10/01}%
+{% new format
+ \@namedef{begin }#1{%
+ \@ifundefined{#1}%
+ {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}%
+ {\def\reserved@a{\def\@currenvir{#1}%
+ \edef\@currenvline{\on@line}%
+ \csname #1\endcsname}}%
+ \@ignorefalse
+ \begingroup\@endpefalse
+ \global\advance\@envdepth\@ne
+ \global\@namedef{@afterendenvhook@\romannumeral\@envdepth}{}%
+ \reserved@a
+ }%
+ \@namedef{end }#1{%
+ \csname end#1\endcsname\@checkend{#1}%
+ \expandafter\endgroup\if@endpe\@doendpe\fi
+ \expandafter\let\expandafter\reserved@a
+ \csname @afterendenvhook@\romannumeral\@envdepth\endcsname
+ \global\advance\@envdepth\m@ne
+ \reserved@a\relax
+ \if@ignore\@ignorefalse\ignorespaces\fi
+ }%
+}{% old format
+ \def\begin#1{%
+ \@ifundefined{#1}%
+ {\def\reserved@a{\@latex@error{Environment #1 undefined}\@eha}}%
+ {\def\reserved@a{\def\@currenvir{#1}%
+ \edef\@currenvline{\on@line}%
+ \csname #1\endcsname}}%
+ \@ignorefalse
+ \begingroup\@endpefalse
+ \global\advance\@envdepth\@ne
+ \global\@namedef{@afterendenvhook@\romannumeral\@envdepth}{}%
+ \reserved@a
+ }%
+ \def\end#1{%
+ \csname end#1\endcsname\@checkend{#1}%
+ \expandafter\endgroup\if@endpe\@doendpe\fi
+ \expandafter\let\expandafter\reserved@a
+ \csname @afterendenvhook@\romannumeral\@envdepth\endcsname
+ \global\advance\@envdepth\m@ne
+ \reserved@a\relax
+ \if@ignore\@ignorefalse\ignorespaces\fi
+ }%
+}
+\def\AfterEndEnv{%
+ \expandafter\g@addto@macro
+ \csname @afterendenvhook@\romannumeral\@envdepth\endcsname
+}
+\def\XTR@checkxtr#1#2{%
+ \@nameuse{XTR@#1false}%
+ \XTR@namelet{XTR@maketrue}{XTR@#1true}%
+ \XKV@ifundefined{XTR@#2-nrs}{%
+ \XKV@ifundefined{XTR@#2-labels}\XTR@maketrue{}%
+ }{%
+ \begingroup
+ \expandafter\count@\csname XTR@#2-nrs@cnt\endcsname
+ \advance\count@\@ne
+ \edef\XTR@resa{\expandafter\noexpand\expandafter\gdef\expandafter
+ \noexpand\csname XTR@#2-nrs@cnt\endcsname{\the\count@}}%
+ \expandafter\endgroup\XTR@resa
+ }%
+ \@nameuse{ifXTR@#1}\else
+ \XKV@ifundefined{XTR@#2-labels}{}{%
+ \ifx\XTR@currentlabel\relax\else
+ \@expandtwoargs\in@{,\XTR@currentlabel,}%
+ {,\csname XTR@#2-labels\endcsname,}%
+ \ifin@\XTR@maketrue\fi
+ \fi
+ }%
+ \fi
+ \@nameuse{ifXTR@#1}\else
+ \XKV@ifundefined{XTR@#2-nrs}{}{%
+ \expandafter\XTR@ch@ckxtr\csname XTR@#2-nrs\expandafter
+ \endcsname\csname XTR@#2-nrs@cnt\endcsname
+ }%
+ \fi
+ \global\let\XTR@currentlabel\relax
+}
+\def\XTR@ch@ckxtr#1#2{%
+ \XKV@for@o#1\XTR@resa{\expandafter\XTR@ch@ck@tr\XTR@resa--\@nil#2}%
+}
+\def\XTR@ch@ck@tr#1-#2-#3\@nil#4{%
+ \ifx\@empty#1\@empty
+ \ifnum#4>#2 \else\XTR@maketrue\fi
+ \else
+ \ifx\@empty#2\@empty
+ \ifx\@empty#3\@empty
+ \ifnum#4=#1 \XTR@maketrue\fi
+ \else
+ \ifnum#4<#1 \else\XTR@maketrue\fi
+ \fi
+ \else
+ \ifnum#4<#1 \else\ifnum#4>#2 \else\XTR@maketrue\fi\fi
+ \fi
+ \fi
+}
+\def\extractionlabel{\KV@@sp@def\XTR@currentlabel}
+\let\XTR@currentlabel\relax
+\def\extract{\XTR@stfalse\XTR@extract}
+\@namedef{extract*}{\XTR@sttrue\XTR@extract}
+\def\XTR@extract{%
+ \@bsphack
+ \let\do\@makeother\dospecials\catcode`\^^M\active
+ \@testopt\XTR@@xtract\@nil
+}
+\def\XTR@@xtract[#1]{%
+ \ifXTR@active
+ \def\XTR@tempa{#1}%
+ \ifx\XTR@tempa\@nnil\else
+ \KV@@sp@def\XTR@currentlabel{#1}%
+ \fi
+ \XTR@checkxtr{extract}{extract}%
+ \else
+ \XTR@extractfalse
+ \fi
+ \ifXTR@st\XTR@opentmp\fi
+ \let\verbatim@processline\XTR@processline@begin
+ \verbatim@start
+}
+\begingroup
+ \lccode`\!=`\\ \lccode`\(=`\{ \lccode`\)=`\}
+\lowercase{\endgroup
+\def\XTR@processline@begin{%
+ \@temptokena{}%
+ \edef\XTR@orig@line{\the\verbatim@line}%
+ \verbatim@line{}%
+ \expandafter\XTR@testbegin\XTR@orig@line!begin(extractskip)\@nil
+}
+\def\XTR@testbegin#1!begin(extractskip)#2\@nil{%
+ \@temptokena\expandafter{\the\@temptokena#1}%
+ \verbatim@line\expandafter{\the\verbatim@line#1}%
+ \def\XTR@tempa{#2}%
+ \ifx\XTR@tempa\@empty\XTR@processline@write\else\XKV@afterfi
+ \XTR@skiplabel#2[]\@nil
+ \XTR@checkxtr{skip}{extractskip}%
+ \let\verbatim@processline\XTR@processline@end
+ \ifx\XTR@tempa\@nnil\XKV@afterelsefi
+ \XTR@t@stbegin#2\@nil
+ \else\XKV@afterfi
+ \expandafter\XTR@t@stbegin\XTR@tempa\@nil
+ \fi
+ \fi
+}
+\def\XTR@skiplabel#1[#2]#3\@nil{%
+ \def\XTR@tempa{#1}%
+ \def\XTR@tempb{#2}%
+ \ifx\XTR@tempa\@empty
+ \ifx\XTR@tempb\@empty
+ \let\XTR@tempa\@nnil
+ \else
+ \KV@@sp@def\XTR@currentlabel{#2}%
+ \XTR@sk@plabel#3\@nil
+ \fi
+ \else
+ \let\XTR@tempa\@nnil
+ \fi
+}
+\def\XTR@sk@plabel#1[]\@nil{\def\XTR@tempa{#1}}
+\def\XTR@t@stbegin#1!begin(extractskip)\@nil{%
+ \XTR@testend#1!end(extractskip)\@nil
+}
+\def\XTR@processline@end{%
+ \@temptokena{}%
+ \edef\XTR@orig@line{\the\verbatim@line}%
+ \verbatim@line{}%
+ \expandafter\XTR@testend\XTR@orig@line!end(extractskip)\@nil
+}
+\def\XTR@testend#1!end(extractskip)#2\@nil{%
+ \@temptokena\expandafter{\the\@temptokena#1}%
+ \ifXTR@skip\else\verbatim@line\expandafter{\the\verbatim@line#1}\fi
+ \def\XTR@tempa{#2}%
+ \ifx\XTR@tempa\@empty\XTR@processline@write\else\XKV@afterfi
+ \let\verbatim@processline\XTR@processline@begin
+ \XTR@t@stend#2\@nil
+ \fi
+}
+\def\XTR@t@stend#1!end(extractskip)\@nil{%
+ \XTR@testbegin#1!begin(extractskip)\@nil
+}}
+\def\XTR@processline@write{%
+ \ifXTR@st\ifcat$\the\@temptokena$\else
+ \XTR@writetmp{\the\@temptokena}%
+ \fi\fi
+ \ifXTR@extract\ifcat$\the\verbatim@line$\else
+ \XTR@writeout{\the\verbatim@line}%
+ \fi\fi
+ \ifx\XTR@orig@line\@empty\XTR@writetmp{}\XTR@writeout{}\fi
+}
+\def\endextract{\XTR@stfalse\XTR@endextract}
+\@namedef{endextract*}{\XTR@sttrue\XTR@endextract}
+\def\XTR@endextract{%
+ \@esphack
+ \ifXTR@st
+ \XTR@closetmp
+ \AfterEndEnv{\input{\jobname.xtr}}%
+ \fi
+}
+\@namedef{extractskip}{\XTR@activefalse\@nameuse{extract*}}
+\XTR@namelet{endextractskip}{endextract*}
+\def\extractline{%
+ \XKV@ifstar{\XTR@sttrue\XTR@extractline}%
+ {\XTR@stfalse\XTR@extractline}%
+}
+\def\XTR@extractline{%
+ \begingroup
+ \let\do\@makeother\dospecials\catcode`\^^M\active
+ \@testopt\XTR@@xtractline\@nil
+}
+\begingroup
+ \catcode`\~=\active\lccode`\~=`\^^M
+\lowercase{\endgroup
+ \def\XTR@@xtractline[#1]#2~{%
+ \ifXTR@active
+ \def\XTR@tempa{#1}%
+ \ifx\XTR@tempa\@nnil\else
+ \KV@@sp@def\XTR@currentlabel{#1}%
+ \fi
+ \XTR@checkxtr{extract}{line}%
+ \else
+ \XTR@extractfalse
+ \fi
+ \ifXTR@extract\XTR@writeout{#2}\fi
+ \ifXTR@st\XTR@opentmp\XTR@writetmp{#2}\XTR@closetmp\fi
+ \endgroup
+ \ifXTR@st
+ \input{\jobname.xtr}%
+ \fi
+ }%
+}
+\ifXTR@active
+\immediate\openout\XTR@out\XTR@file\relax
+\ifXTR@header
+ \@tempcnta\time
+ \divide\@tempcnta 60
+ \edef\XTR@tempb{%
+ \the\year/\ifnum\the\month<10 0\fi\the\month/%
+ \ifnum\the\day<10 0\fi\the\day,\the\@tempcnta:%
+ }
+ \multiply\@tempcnta 60
+ \@tempcntb\time
+ \advance\@tempcntb-\@tempcnta
+ \ifnum\@tempcntb<10
+ \xdef\XTR@tempb{\XTR@tempb0\the\@tempcntb}
+ \else
+ \xdef\XTR@tempb{\XTR@tempb\the\@tempcntb}
+ \fi
+ \begingroup
+ \catcode`\%=12
+ \gdef\XTR@tempa{%%\space}
+ \endgroup
+ \XTR@writeout{\XTR@tempa}
+ \filename@parse\XTR@file
+ \ifx\filename@ext\relax\def\filename@ext{tex}\fi
+ \XTR@writeout{%
+ \XTR@tempa This is file, `\filename@base.\filename@ext',%
+ }
+ \XTR@writeout{%
+ \XTR@tempa generated with the extract package.^^J\XTR@tempa
+ }
+ \XTR@writeout{\XTR@tempa Generated on : \space\XTR@tempb}
+ \filename@parse\jobname
+ \ifx\filename@ext\relax\def\filename@ext{tex}\fi
+ \XTR@writeout{%
+ \XTR@tempa From source \space: \space\filename@base.\filename@ext
+ }
+ \XTR@writeout{%
+ \XTR@tempa Using options: \space\csname opt@extract.sty\endcsname
+ }
+ \XTR@writeout{\XTR@tempa}
+\fi
+\ifXTR@copydocumentclass
+ \def\XTR@tempa#1.cls\@nil{\def\XTR@tempa{#1}}
+ \expandafter\XTR@tempa\XKV@documentclass\@nil
+ \ifx\XKV@classoptionslist\@empty
+ \XTR@writeout{\string\documentclass{\XTR@tempa}}
+ \else
+ \@temptokena\expandafter{\XKV@classoptionslist}%
+ \XTR@writeout{\string\documentclass[\the\@temptokena]{\XTR@tempa}}
+ \fi
+\fi
+\AtBeginDocument{%
+ \ifXTR@handles
+ \XTR@writeout{}%
+ \XTR@writeout{\string\begin{document}}%
+ \fi
+ \XKV@ifundefined{XTR@envs}{}{%
+ \XKV@for@o\XTR@envs\XTR@tempa{%
+ \XKV@ifundefined\XTR@tempa{%
+ \XTR@err{%
+ environment `\XTR@tempa' not defined; extraction canceled%
+ }%
+ }{%
+ \XTR@namelet{XTR\XTR@tempa}{\XTR@tempa}%
+ \@namedef{\XTR@tempa\expandafter}\expandafter{\expandafter
+ \def\expandafter\XTR@tempa\expandafter{\XTR@tempa}%
+ \XTR@checkxtr{extract}\XTR@tempa
+ \ifXTR@extract
+ \XTR@writeout{}\XTR@opentmp
+ \@bsphack
+ \let\do\@makeother\dospecials\catcode`\^^M\active
+ \def\verbatim@processline{%
+ \let\verbatim@processline\XTR@processline@begin
+ \XTR@writeout{%
+ \string\begin{\XTR@tempa}\the\verbatim@line
+ }%
+ \XTR@writetmp{%
+ \string\begin{XTR\XTR@tempa}\the\verbatim@line
+ }%
+ }%
+ \XTR@sttrue\let\XTR@tempb\verbatim@
+ \else
+ \edef\XTR@tempb{\noexpand\begin{XTR\XTR@tempa}}%
+ \fi
+ \XTR@tempb
+ }%
+ \XTR@namelet{endXTR\XTR@tempa}{end\XTR@tempa}%
+ \@namedef{end\XTR@tempa\expandafter}\expandafter{\expandafter
+ \def\expandafter\XTR@tempa\expandafter{\XTR@tempa}%
+ \ifXTR@extract
+ \@esphack
+ \XTR@writeout{\string\end{\XTR@tempa}}%
+ \XTR@writetmp{\string\end{XTR\XTR@tempa}}%
+ \XTR@closetmp
+ \AfterEndEnv{\input{\jobname.xtr}}%
+ \else
+ \edef\XTR@tempa{\noexpand\end{XTR\XTR@tempa}}%
+ \expandafter\XTR@tempa
+ \fi
+ }%
+ }%
+ }%
+ }%
+ \XKV@ifundefined{XTR@cmdsargs}{}{%
+ \let\XTR@sect\@sect
+ \let\XTR@chapter\@chapter
+ \def\XTR@tempb{chapter}%
+ \XKV@for@o\XTR@cmdsargs\XTR@tempa{%
+ \XKV@ifundefined\XTR@tempa{%
+ \XTR@err{command `\@backslashchar\XTR@tempa' not defined;
+ extraction canceled%
+ }%
+ }{%
+ \@expandtwoargs\in@{,\XTR@tempa,}%
+ {,chapter,section,subsection,subsubsection,}%
+ \ifin@
+ \ifx\XTR@tempa\XTR@tempb
+ \def\@chapter[#1]#2{%
+ \XTR@checkxtr{extract}{chapter}%
+ \ifXTR@extract
+ \XTR@writeout{}%
+ \def\XTR@tempa{#1}%
+ \def\XTR@tempb{#2}%
+ \ifx\XTR@tempa\XTR@tempb
+ \@temptokena{{#2}}%
+ \else
+ \@temptokena{[#1]{#2}}%
+ \fi
+ \XTR@writeout{\string\chapter\the\@temptokena}%
+ \fi
+ \XTR@chapter[#1]{#2}%
+ }%
+ \else
+ \def\@sect#1#2#3#4#5#6[#7]#8{%
+ \@expandtwoargs\in@{,#1,}{,\XTR@cmdsargs,}%
+ \ifin@
+ \XTR@checkxtr{extract}{#1}%
+ \ifXTR@extract
+ \XTR@writeout{}%
+ \def\XTR@tempa{#7}%
+ \def\XTR@tempb{#8}%
+ \ifx\XTR@tempa\XTR@tempb
+ \@temptokena{{#8}}%
+ \else
+ \@temptokena{[#7]{#8}}%
+ \fi
+ \XTR@writeout{\expandafter
+ \string\csname#1\endcsname\the\@temptokena}%
+ \fi
+ \fi
+ \XTR@sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{#8}%
+ }%
+ \fi
+ \else
+ \XTR@err{unsupported command `\XTR@tempa';
+ try the `extract-cmdline option}%
+ \fi
+ }%
+ }%
+ }%
+ \XKV@ifundefined{XTR@cmdsline}{}{%
+ \XKV@for@o\XTR@cmdsline\XTR@tempa{%
+ \XKV@ifundefined\XTR@tempa{%
+ \XTR@err{command `\@backslashchar\XTR@tempa' not defined;
+ extraction canceled}%
+ }{%
+ \@expandtwoargs\in@{,\XTR@tempa,}%
+ {,chapter,section,subsection,subsubsection,}%
+ \ifin@
+ \XTR@err{%
+ use the `extract-cmd' option for command `\XTR@tempa'%
+ }%
+ \else
+ \XTR@namelet{XTR\XTR@tempa}{\XTR@tempa}%
+ \@namedef{\XTR@tempa\expandafter}\expandafter{\expandafter
+ \def\expandafter\XTR@tempa\expandafter{\XTR@tempa}%
+ \XTR@checkxtr{extract}\XTR@tempa
+ \begingroup
+ \let\do\@makeother\dospecials\catcode`\^^M\active
+ \XTR@extractcmdline
+ }%
+ \fi
+ }%
+ }%
+ \begingroup
+ \catcode`\~=\active\lccode`\~=`\^^M
+ \lowercase{\endgroup
+ \def\XTR@extractcmdline#1~{\verbatim@line{#1}\XTR@@xtractcmdline}%
+ }%
+ \def\XTR@@xtractcmdline{%
+ \XTR@writeout{}%
+ \XTR@writeout{\expandafter\string\csname\XTR@tempa
+ \endcsname\the\verbatim@line
+ }%
+ \XTR@opentmp
+ \XTR@writetmp{\expandafter\string\csname XTR\XTR@tempa
+ \endcsname\the\verbatim@line
+ }%
+ \XTR@closetmp
+ \endgroup
+ \input{\jobname.xtr}%
+ }%
+ }%
+}
+\AtEndDocument{%
+ \ifXTR@handles
+ \XTR@writeout{}%
+ \XTR@writeout{\string\end{document}}%
+ \fi
+ \immediate\closeout\XTR@out
+}
+\fi
+\endinput
+%%
+%% End of file `extract.sty'.