diff options
author | Karl Berry <karl@freefriends.org> | 2007-03-13 23:47:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-03-13 23:47:26 +0000 |
commit | 9f788918f4e0a58fe14ab233810562a8bd517bc0 (patch) | |
tree | 20cad4419d00e637be5de205bf91ba434c0f949a /Master/texmf-dist/tex/latex/syntrace | |
parent | 7528bed5b6dc85d8d97044a2ad1ea49a55b96a90 (diff) |
syntrace update (13mar07)
git-svn-id: svn://tug.org/texlive/trunk@4031 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/syntrace')
-rw-r--r-- | Master/texmf-dist/tex/latex/syntrace/syntrace.sty | 64 |
1 files changed, 54 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/syntrace/syntrace.sty b/Master/texmf-dist/tex/latex/syntrace/syntrace.sty index 2a208c230c1..c8cb0946c34 100644 --- a/Master/texmf-dist/tex/latex/syntrace/syntrace.sty +++ b/Master/texmf-dist/tex/latex/syntrace/syntrace.sty @@ -24,9 +24,33 @@ %% This work consists of the file syntrace.ins and %% syntrace.dtx and the derived file syntrace.sty \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{syntrace}[2006/08/13 v1.0 Package for dealing with trace in synttree] +\ProvidesPackage{syntrace}[2006/08/17 v1.1 Package for dealing with trace in syntaxic tree] \RequirePackage{ifthen} -\RequirePackage{synttree} +\DeclareOption{synttree}{ +\AtEndOfPackage{% +\IfFileExists{synttree.sty}{% +\RequirePackage{synttree}\syntraceaddresetmacro{synttree}% +}{% +\PackageWarning{syntrace}{Unable to locate synttree package} +} +} +} +\DeclareOption{qtree}{ +\AtEndOfPackage{% +\IfFileExists{qtree.sty}{% +\RequirePackage{qtree}\syntraceaddresetmacro{Tree}% +}{% +\PackageWarning{syntrace}{Unable to locate qtree package} +} +} +} +\DeclareOption{i-start}{ +\AtEndOfPackage{% +\setcounter{syntrace@startvalue}{8} +} +} +\ExecuteOptions{synttree} +\ProcessOptions \newcounter{syntrace@startvalue} \setcounter{syntrace@startvalue}{0} \newcounter{syntrace@labelcounter} @@ -51,16 +75,36 @@ \newcommand*{\syntrace@reset}{% \setcounter{syntrace@labelcounter}{\arabic{syntrace@startvalue}}% } -\let\syntrace@syntree=\synttree -\def\synttree{\@ifstar% - \syntrace@syntree% - \syntree@star% +\newcommand*{\syntraceaddresetmacro}[1]{% + \expandafter\ifx% + \csname syntrace@old@#1\endcsname + \relax% + \PackageInfo{syntrace}{Adding auto-reset to #1}% + \expandafter\let\csname syntrace@old@#1\expandafter\endcsname% + \csname #1\endcsname% + \expandafter\def\csname#1\endcsname{\@ifstar{% + \csname syntrace@old@#1\endcsname% + }{% + \syntrace@reset% + \csname syntrace@old@#1\endcsname% + }% + }% + \else + \PackageWarning{syntrace}{#1 allready set as auto-reset}% + \fi } -\def\syntree@star{% - \syntrace@reset% - \syntrace@syntree% +\newcommand*{\syntraceremoveresetmacro}[1]{% + \expandafter\ifx% + \csname syntrace@old@#1\endcsname + \relax% + \PackageWarning{syntrace}{#1 is not set as auto-reset}% + \else + \PackageInfo{syntrace}{Removing auto-reset from #1}% + \expandafter\let\csname #1\expandafter\endcsname% + \csname syntrace@old@#1\endcsname% + \expandafter\let\csname syntrace@old@#1\expandafter\endcsname\relax% + \fi } - \endinput %% %% End of file `syntrace.sty'. |