summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2006-11-03 06:16:00 +0000
committerNorbert Preining <preining@logic.at>2006-11-03 06:16:00 +0000
commita6d4e22f961008636a3bfc36f89570e6fa0c85f6 (patch)
tree9d13f81b2a37ab6bdf3336066017d4cb5e701011 /Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
parente9b9a3f32d1a5b371fa2256f098ee4b158f6df1d (diff)
several updates (sorry Karl, it was a long train ride):
updates of packages: screenplay, bussproofs computational-complexity dvdcoll gnuplottex mathmode movie15 pgf pstricks-add pst-labo trfsigns (dvi->pdf move, COPYING file to doc) toptesi tocvsec2 thumb textfit (doc move) added to tpm-ctan-check: typogrid trsym trfsigns tracking toptesi toolbox todo tocvsec2 tocloft tocbibind titling titlefoot thumb textopo textfit teubner tensor git-svn-id: svn://tug.org/texlive/trunk@2382 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex119
1 files changed, 119 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
new file mode 100644
index 00000000000..e134db7a099
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
@@ -0,0 +1,119 @@
+% Copyright 2006 by Till Tantau
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+
+
+%
+% This file provides utitiliy commands that are used throughout pgf.
+%
+% For most commands, the definition of these commands is just given
+% below. We cannot use the LaTeX definition of these commands since
+% LaTeX may not be the current format and since LaTeX packages tend to
+% redefine these commands.
+%
+% For some commands the actual definition of the format (like latex or
+% context) is to be preferred over the generic definition below. In
+% this case, the definition of the format is installed when the file
+% pgfutil-XXXX.tex is read, where XXXX is the format name (latex,
+% plain, or context).
+
+
+
+\catcode`\@=11\relax
+
+
+% Simple stuff
+
+\long\def\pgfutil@ifundefined#1{%
+ \expandafter\ifx\csname#1\endcsname\relax
+ \expandafter\pgfutil@firstoftwo
+ \else
+ \expandafter\pgfutil@secondoftwo
+ \fi}
+\def\pgfutil@firstoftwo#1#2{#1}
+\def\pgfutil@secondoftwo#1#2{#2}
+\def\pgfutil@empty{}
+\def\pgfutil@gobble#1{}
+\def\pgfutil@gobbletwo#1#2{}
+\def\pgfutil@namedef#1{\expandafter\def\csname #1\endcsname}
+\long\def\pgfutil@g@addto@macro#1#2{%
+ \begingroup
+ \toks@\expandafter{#1#2}%
+ \xdef#1{\the\toks@}%
+ \endgroup}
+\newif\ifpgfutil@tempswa
+
+% pgfutil@ifnextchar
+
+\long\def\pgfutil@ifnextchar#1#2#3{%
+ \let\pgfutil@reserved@d=#1%
+ \def\pgfutil@reserved@a{#2}%
+ \def\pgfutil@reserved@b{#3}%
+ \futurelet\pgfutil@let@token\pgfutil@ifnch}
+\def\pgfutil@ifnch{%
+ \ifx\pgfutil@let@token\pgfutil@sptoken
+ \let\pgfutil@reserved@c\pgfutil@xifnch
+ \else
+ \ifx\pgfutil@let@token\pgfutil@reserved@d
+ \let\pgfutil@reserved@c\pgfutil@reserved@a
+ \else
+ \let\pgfutil@reserved@c\pgfutil@reserved@b
+ \fi
+ \fi
+ \pgfutil@reserved@c}
+\def\:{\global\let\pgfutil@sptoken= } \:
+\def\:{\pgfutil@xifnch} \expandafter\def\: {\futurelet\pgfutil@let@token\pgfutil@ifnch}
+
+
+% pgfutil@in@
+
+\newif\ifpgfutil@in@
+\def\pgfutil@in@#1#2{%
+ \def\pgfutil@in@@##1#1##2##3\pgfutil@in@@{%
+ \ifx\pgfutil@in@##2\pgfutil@in@false\else\pgfutil@in@true\fi}%
+ \pgfutil@in@@#2#1\pgfutil@in@\pgfutil@in@@}
+
+
+% pgfutil@for
+
+\def\pgfutil@nnil{\pgfutil@nil}
+\def\pgfutil@fornoop#1\@@#2#3{}
+\long\def\pgfutil@for#1:=#2\do#3{%
+ \expandafter\def\expandafter\pgfutil@fortmp\expandafter{#2}%
+ \ifx\pgfutil@fortmp\pgfutil@empty \else
+ \expandafter\pgfutil@forloop#2,\pgfutil@nil,\pgfutil@nil\@@#1{#3}\fi}
+\long\def\pgfutil@forloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\pgfutil@nnil \else
+ #5\def#4{#2}\ifx #4\pgfutil@nnil \else#5\pgfutil@iforloop #3\@@#4{#5}\fi\fi}
+\long\def\pgfutil@iforloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\pgfutil@nnil
+ \expandafter\pgfutil@fornoop \else
+ #4\relax\expandafter\pgfutil@iforloop\fi#2\@@#3{#4}}
+\def\pgfutil@tfor#1:={\pgfutil@tf@r#1 }
+\long\def\pgfutil@tf@r#1#2\do#3{\def\pgfutil@fortmp{#2}\ifx\pgfutil@fortmp\space\else
+ \pgfutil@tforloop#2\pgfutil@nil\pgfutil@nil\@@#1{#3}\fi}
+\long\def\pgfutil@tforloop#1#2\@@#3#4{\def#3{#1}\ifx #3\pgfutil@nnil
+ \expandafter\pgfutil@fornoop \else
+ #4\relax\expandafter\pgfutil@tforloop\fi#2\@@#3{#4}}
+
+
+% pgfutil@IfFileExists
+
+\chardef\pgfutil@inputcheck0
+\def\pgfutil@IfFileExists#1#2#3{%
+ \openin\pgfutil@inputcheck#1 %
+ \ifeof\pgfutil@inputcheck
+ #3\relax
+ \else
+ #2\relax
+ \fi
+ \closein\pgfutil@inputcheck}
+
+\def\pgfutil@InputIfFileExists#1#2#3{\pgfutil@IfFileExists{#1}{\input #1\relax#2}{#3}}%
+
+
+
+\endinput