diff options
author | Karl Berry <karl@freefriends.org> | 2010-10-24 23:46:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-10-24 23:46:12 +0000 |
commit | e5d25989ee337ac9399ae9e50bed87559488814f (patch) | |
tree | e08fa9fe408fbbd07d82226b3fd8a059c8d39d7b /Master/texmf-dist/tex/latex/gmutils/gmparts.sty | |
parent | 5d35798dc0ca224df75f912f020c70024e1a1169 (diff) |
gmutils (24oct10)
git-svn-id: svn://tug.org/texlive/trunk@20183 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/gmutils/gmparts.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/gmutils/gmparts.sty | 169 |
1 files changed, 169 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/gmutils/gmparts.sty b/Master/texmf-dist/tex/latex/gmutils/gmparts.sty new file mode 100644 index 00000000000..1133a9a23d5 --- /dev/null +++ b/Master/texmf-dist/tex/latex/gmutils/gmparts.sty @@ -0,0 +1,169 @@ +%% +%% \iffalse ^^A we skip the debug setting +\IfFileExists{\string~/bin/gen_and_xela}{\errorcontextlines=1000 }{} +%% \fi +%% ^^A $Id: TheUltimateMaster.gmd,v 0.250 2010/10/24 14:42:35 natror Exp natror $ +%% This is file “gmparts.sty” generated with the DocStrip utility. +%% +%% +%% The original source files were: +%% +%% gmutils/gmutils.gmd (with options: `parts') +%% +%% +%% Copyright © +%% by Grzegorz ‘Natror’ Murzynowski +%% natror (at) o2 (dot) pl +%% +%% This program is subject to the LaTeX Project Public License. +%% See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html +%% for the details of that license. +%% +%% LPPL status: "author-maintained". +%% +%% +%% +%% For the documentation please refer to the file(s) +%% gmutils.{gmd,pdf}. +%% +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{gmparts} + [2010/10/24 v0.993 modification of \string \include \space \string & in/excluding parts of main file (GM)] + + +%% +%% +%% ^^A\typeout{\unexpanded{#4}}%% + + +\RequirePackage{gmcommand} + +\def\gmu@getext#1.#2\@nil{%\UnDef + \def\gmu@filename{#1}%\UnDef + \def\gmu@fileext{#2}} + +\def\include#1{\relax + \ifnum\@auxout=\@partaux + \@latex@error{\string\include\space cannot be nested}\@eha + \else \@include#1 \fi} + +\def\@include#1 {% + \gmu@getext#1.\@nil + % \UnDef + \ifx\gmu@fileext\empty\def\gmu@fileext{tex}\fi + \clearpage + \if@filesw + \immediate\write\@mainaux{\string\@input{\gmu@filename.aux}}% + \fi + \@tempswatrue + \if@partsw + \@tempswafalse + \edef\reserved@b{#1}% + \@for\reserved@a:=\@partlist\do{% + \ifx\reserved@a\reserved@b\@tempswatrue\fi}% + \fi + \if@tempswa + \let\@auxout\@partaux + \if@filesw + \immediate\openout\@partaux \gmu@filename.aux + \immediate\write\@partaux{\relax}% + \fi + \@input@{\gmu@filename.\gmu@fileext}% + \inclasthook + \clearpage + \@writeckpt{\gmu@filename}% + \if@filesw + \immediate\closeout\@partaux + \fi + \else + \deadcycles\z@ + \@nameuse{cp@\gmu@filename}% + \fi + \let\@auxout\@mainaux} + +\newcommand\whenonly[3]{% + \def\gmu@whonly{#1,}% + \ifx\gmu@whonly\@partlist\afterfi{#2}\else\afterfi{#3}\fi} + +\def\inclasthook{\thispagestyle{closing}} + +\def\filepart#1{\relax + \ifnum\@auxout=\@partaux + \@latex@error{\string\filepart\space cannot be nested}\@eha + \else\afterfi{\@filepart#1 }\fi} + +\def\@filepart#1 {% + \clearpage + \edef\gmu@filepartname{#1}% we'll use it later + \if@filesw + \immediate\write\@mainaux{\string\@input{#1.aux}}% + \fi + \@tempswatrue + \if@partsw + \@tempswafalse + \@for\gmu@filepart@resa:=\@partlist\do{% + \ifx\gmu@filepart@resa\gmu@filepartname\@tempswatrue\fi}% + \fi + \if@tempswa + \let\@auxout\@partaux + \if@filesw + \immediate\openout\@partaux #1.aux + \immediate\write\@partaux{\relax}% + \fi + \@xa\@firstoftwo + % \label{spart:iftrue} + \else + \deadcycles\z@ + \@nameuse{cp@\gmu@filepartname}% + \let\@auxout\@mainaux + \@xa\@secondoftwo + \fi + {\iftrue}% + {\let\endfilepart\fi + \csname gm@skipped@#1\endcsname + \def\next{\Restore@MacroSt {endfilepart}% + \@ifnextchar\bgroup{\show\NextBgroup\@gobble}{}}% + \@xa\next\iffalse}% +} + +\DeclareCommand\endfilepart{b}{% Note the argument is not used really. Maybe later we'll + % use it for checking of proper matching. Or maybe not. + \inclasthook + \clearpage + \@writeckpt{\gmu@filepartname}% + \if@filesw + \immediate\closeout\@partaux + \fi + \fi% this |\fi| closes |\Iftrue| put by line \ref{spart:iftrue}. + \let\@auxout\@mainaux +} + +\Store@Macro\endfilepart + +\def\nofileparts{% + \let\filepart\@gobble + \DeclareCommand\endfilepart{b}{}% +} + + +\def\includecountfix{% + \def\@wckptelt##1{% + \immediate\write\@partaux{% + \providecounter{##1}% to + % provide the font counters defined + % in parts of the document. + \string\setcounter{##1}{\the\@nameuse{c@##1}}}}% +} + +\pdef\providecounter#1{% + \unless\ifcsname c@#1\endcsname\newcounter{#1}\fi} + +%%% (For my GNU Emacs:) +%%% Local Variables: +%%% mode: doctex +%%% coding: utf-8 +%%% End: +\endinput +%% +%% End of file `gmparts.sty'. |