From 63c103148bb73e4dbd2653907094f3943b90c82f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 28 Apr 2017 21:16:25 +0000 Subject: childdoc (28apr17) git-svn-id: svn://tug.org/texlive/trunk@44098 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/childdoc/childdoc.def | 61 +++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/childdoc/childdoc.def (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/childdoc/childdoc.def b/Master/texmf-dist/tex/latex/childdoc/childdoc.def new file mode 100644 index 00000000000..d7d0c9706bc --- /dev/null +++ b/Master/texmf-dist/tex/latex/childdoc/childdoc.def @@ -0,0 +1,61 @@ +%% +%% This is file `childdoc.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% childdoc.dtx (with options: `package') +%% +%% Copyright (C) 2017 Niklas Beisert +%% +%% 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 2005/12/01 or later. +%% +\ProvidesFile{childdoc.def}[2017/04/27 v1.0 child document driver] + +\ifdefined\childdoc\endinput\fi + +\newif\ifchilddoc + +\edef\childdocname{\scantokens\expandafter{\jobname\noexpand}} + +\newcommand{\childdoc}[1] +{ + \def\childdoc##1{\endinput} + { + \def\childdoctmp{#1} + \ifx\childdocname\childdoctmp\else + \global\childdoctrue + \fi + } + \ifchilddoc + \includeonly{\childdocname} + \def\jobname{#1} + \fi +} + +\newcommand{\childdocredirect}[2][] +{ + { + \def\childdoctmp{#1} + \def\childdocempty{} + \ifx\childdoctmp\childdocempty + \gdef\jobname{#2} + \else + \def\childdocextract #1##1~~~{\gdef\jobname{#2##1}} + \expandafter\childdocextract\childdocname~~~ + \fi + } + \let\childdocname\jobname + \input{\jobname} + \endinput +} + +\endinput +%% +%% End of file `childdoc.def'. -- cgit v1.2.3