summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/childdoc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-12-30 22:12:08 +0000
committerKarl Berry <karl@freefriends.org>2018-12-30 22:12:08 +0000
commit0632da102dc59ec2ad6a0c69397fd7a3c4a03393 (patch)
treeb069979372d8a5ad481b361e764ccf1b0bf25bcd /Master/texmf-dist/tex/latex/childdoc
parent5a8b5044b55dfb4e76f990eb433c7e229906c162 (diff)
childdoc (30dec18)
git-svn-id: svn://tug.org/texlive/trunk@49543 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/childdoc')
-rw-r--r--Master/texmf-dist/tex/latex/childdoc/childdoc.def99
1 files changed, 70 insertions, 29 deletions
diff --git a/Master/texmf-dist/tex/latex/childdoc/childdoc.def b/Master/texmf-dist/tex/latex/childdoc/childdoc.def
index 5f416744a47..b5ad693673d 100644
--- a/Master/texmf-dist/tex/latex/childdoc/childdoc.def
+++ b/Master/texmf-dist/tex/latex/childdoc/childdoc.def
@@ -17,56 +17,97 @@
%% version 2005/12/01 or later.
%%
\ifdefined\childdocmain\endinput\fi
-\ProvidesFile{childdoc.def}[2018/01/17 v1.6 child document driver]
+\ProvidesFile{childdoc.def}[2018/12/30 v2.0 child document driver]
\newif\ifchilddoc
+\newif\ifchilddocmanual
\edef\childdocname{\scantokens\expandafter{\jobname\noexpand}}
+\let\childdocjob\childdocname
-\newcommand{\childdocmain}[1]
+\newcommand{\childdocdisable}
{
- \renewcommand{\childdocmain}[1]{\endinput}
+ \renewcommand{\childdocmain}[1]{\renewcommand{\childdocmain}[1]{\endinput}}
\renewcommand{\childdocof}[1]{}
+ \renewcommand{\childdocby}[2][]{}
\renewcommand{\childdocforward}[2][]{}
- \begingroup
- \def\childdoctmp{#1}
- \ifx\childdocname\childdoctmp
- \def\childdoctmp{\childdocfalse}
- \else
- \def\childdoctmp{\childdoctrue}
- \fi
- \expandafter
- \endgroup
- \childdoctmp
- \ifchilddoc
- \includeonly{\childdocname}
- \def\jobname{#1}
- \fi
+ \renewcommand{\childdocdisable}{}
}
-\newcommand{\childdoc}{\childdocmain}
+\newcommand{\childdocmain}[1]
+{
+ \childdocdisable\childdocmain{}
+ \if?#1?\else
+ \begingroup
+ \def\childdoctmp{#1}
+ \ifx\childdoctmp\childdocname
+ \def\childdoctmp{}
+ \else
+ \def\childdoctmp
+ {
+ \childdoctrue
+ \includeonly{\childdocname}
+ \def\childdocjob{#1}
+ \def\jobname{#1}
+ }
+ \fi
+ \expandafter
+ \endgroup
+ \childdoctmp
+ \fi
+}
\newcommand{\childdocof}[1]
{
+ \childdocdisable
+ \childdoctrue
+ \includeonly{\childdocname}
+ \def\jobname{#1}
+ \def\childdocjob{#1}
\input{#1}
}
+\newcommand{\childdocby}[2][]
+{
+ \childdocdisable
+ \childdoctrue
+ \childdocmanualtrue
+ \if?#1?\else
+ \def\jobname{#2}
+ \fi
+ \def\childdocjob{#2}
+ \input{#2}
+ \endinput
+}
+
\newcommand{\childdocforward}[2][]
{
- \def\jobname{#2}
- \def\childdocname{#2}
\begingroup
- \def\childdoctmp{#1}
- \def\childdocempty{}
- \ifx\childdoctmp\childdocempty
- \def\childdoctmp{\input{#2}}
+ \if?#1?
+ \def\childdoctmp
+ {
+ \def\childdocname{#2}
+ \def\childdocjob{#2}
+ \def\jobname{#2}
+ \input{#2}
+ \endinput
+ }
\else
- \def\childdoctmp{\input{#1}}
+ \def\childdoctmp
+ {
+ \childdocdisable
+ \def\childdocname{#2}
+ \childdoctrue
+ \includeonly{#2}
+ \def\childdocjob{#1}
+ \def\jobname{#1}
+ \input{#1}
+ \endinput
+ }
\fi
\expandafter
\endgroup
\childdoctmp
- \endinput
}
\newcommand{\childdocforwardprefix}[3][]
@@ -79,12 +120,12 @@
\childdoctmp
}
+\newcommand{\childdoc}{\childdocmain}
+
\newcommand{\childdocredirect}[2][]
{
\begingroup
- \def\childdoctmp{#1}
- \def\childdocempty{}
- \ifx\childdoctmp\childdocempty
+ \if?#1?
\def\childdoctmp{\childdocforward{#2}}
\else
\def\childdoctmp{\childdocforwardprefix{#1}{#2}}