1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25\ifdefined\pgfdefined \endinput \fi
26\ifdefined\pgfcoredefined\endinput \fi
27
28
29
30\startmodule[tikz]
31
32\ifdefined\hoffset \else
33 \newdimen\hoffset
34 \newdimen\voffset
35\fi
36
37\ifdefined\pdflastxpos \else
38 \unprotect
39 \frozen\overloaded\protected\def\pdflastxpos{\numexpr\clf_lastxpos\relax}
40 \frozen\overloaded\protected\def\pdflastypos{\numexpr\clf_lastypos\relax}
41 \protect
42\fi
43
44\ifdefined\pdfstrcmp\else
45
46 \startluacode
47 interfaces.implement {
48 name = "pdfstrcmp",
49 arguments = "2 strings",
50 usage = "value",
51 public = true,
52 actions = function(a,b)
53 return
54 tokens.values.integer,
55 (a < b and -1) or (a > b and 1) or 0
56 end
57 }
58 \stopluacode
59
60\fi
61
62\newcatcodetable \tikzcatcodes
63
64\startcatcodetable \tikzcatcodes
65 \catcode\tabasciicode \spacecatcode
66 \catcode\endoflineasciicode \endoflinecatcode
67 \catcode\formfeedasciicode \endoflinecatcode
68 \catcode\spaceasciicode \spacecatcode
69 \catcode\endoffileasciicode \ignorecatcode
70 \catcode\circumflexasciicode \superscriptcatcode
71 \catcode\underscoreasciicode \subscriptcatcode
72 \catcode\ampersandasciicode \alignmentcatcode
73 \catcode\backslashasciicode \escapecatcode
74 \catcode\leftbraceasciicode \begingroupcatcode
75 \catcode\rightbraceasciicode \endgroupcatcode
76 \catcode\dollarasciicode \mathshiftcatcode
77 \catcode\hashasciicode \parametercatcode
78 \catcode\commentasciicode \commentcatcode
79 \catcode\atsignasciicode \lettercatcode
80 \catcode\exclamationmarkasciicode \othercatcode
81 \catcode\questionmarkasciicode \lettercatcode
82 \catcode\tildeasciicode \activecatcode
83 \catcode\barasciicode \othercatcode
84\stopcatcodetable
85
86\newinteger\tikzinputlevel
87
88\permanent\protected\def\starttikzinput
89 {\advance\tikzinputlevel\plusone
90 \ifcase\tikzinputlevel\or
91 \pushoverloadmode
92 \pushcatcodetable
93 \setcatcodetable\tikzcatcodes
94 \pushmacro\meaning
95 \let\meaning\meaningless
96 \autoparagraphmode\zerocount
97 \fi}
98
99\permanent\protected\def\stoptikzinput
100 {\autoparagraphmode\plusone
101 \ifcase\tikzinputlevel\or
102 \popcatcodetable
103 \popmacro\meaning
104 \popoverloadmode
105 \fi
106 \advance\tikzinputlevel\minusone}
107
108\permanent\protected\def\tikzinputfile#1
109 {\starttikzinput
110 \input{#1}\relax
111 \stoptikzinput}
112
113\permanent\protected\def\tikzerrormessage#1#2#3
114 {\writestatus{#1}{#2}}
115
116
117
118
119
120\overloadmode\zerocount
121
122\newtoks\everytikzpicture
123\newtoks\everyinsidetikzpicture
124
125
126
127
128
129\permanent\protected\def\starttikzsettings
130 {\pushoverloadmode
131 \pushcatcodetable
132 \setcatcodetable\tikzcatcodes
133 \pushmacro\meaning
134 \let\meaning\meaningless
135 \autoparagraphmode\zerocount}
136
137\permanent\protected\def\stoptikzsettings
138 {\autoparagraphmode\plusone
139 \popmacro\meaning
140 \popcatcodetable
141 \popoverloadmode}
142
143\permanent\tolerant\protected\def\starttikzpicture[#S#1]
144 {\dontleavehmode
145 \hcontainer\bgroup
146 \setcatcodetable\tikzcatcodes
147 \the\everytikzpicture
148 \autoparagraphmode\zerocount
149 \pushmacro\meaning
150 \let\meaning\meaningless
151
152 \ifdefined\PackageError\else \let\PackageError\tikzerrormessage \fi
153 \tikzpicture[#1]
154 \the\everyinsidetikzpicture}
155
156\permanent\protected\def\stoptikzpicture
157 {\endtikzpicture
158
159 \popmacro\meaning
160 \egroup}
161
162\let\pgfdefined \relax
163\let\pgfcoredefined\relax
164
165\tikzinputfile{pgfutilcommon.tex}
166\tikzinputfile{pgfutilcontext.def}
167\tikzinputfile{pgfrcs.code.tex}
168\tikzinputfile{pgfsys.code.tex}
169\tikzinputfile{pgfkeys.code.tex}
170\tikzinputfile{pgfsyssoftpath.code.tex}
171\tikzinputfile{pgfsysprotocol.code.tex}
172\tikzinputfile{pgfcore.code.tex}
173\tikzinputfile{pgffor.code.tex}
174\tikzinputfile{pgfmoduleplot.code.tex}
175\tikzinputfile{tikz.code.tex}
176
177\let\startpgfpicture \pgfpicture \let\stoppgfpicture \endpgfpicture
178\let\startpgfscope \pgfscope \let\stoppgfscope \endpgfscope
179\let\startpgflowlevelscope \pgflowlevelscope \let\stoppgflowlevelscope \endpgflowlevelscope
180\let\startpgfinterruptpath \pgfinterruptpath \let\stoppgfinterruptpath \endpgfinterruptpath
181\let\startpgfinterruptpicture \pgfinterruptpicture \let\stoppgfinterruptpicture \endpgfinterruptpicture
182\let\startpgfinterruptboundingbox\pgfinterruptboundinbox \let\stoppgfinterruptboudingbox\endpgfinterruptboundingbox
183
184\let\normalusepgfmodule \usepgfmodule
185\let\normalusepgflibrary \usepgflibrary
186\let\normalusetikzlibrary\usetikzlibrary
187
188\installnamespace{pgfmhack}
189\installnamespace{pgflhack}
190\installnamespace{tikzhack}
191
192\tolerant\protected\def\usepgfmodule[#1]#;#2
193 {\starttikzinput
194 \normalusepgfmodule[#1#2]
195 \stoptikzinput}
196
197\tolerant\protected\def\usepgflibrary[#1]#;#2
198 {\starttikzinput
199 \normalusepgflibrary[#1#2]
200 \stoptikzinput}
201
202\tolerant\protected\def\usetikzlibrary[#1]#;#2
203 {\starttikzinput
204 \normalusetikzlibrary[#1#2]
205 \stoptikzinput}
206
207\unprotect
208
209\protected\def\installsomethingtikzindeed#1#2#3#4
210 {\defcsname#1:b:#2\endcsname{#3}
211 \defcsname#1:a:#2\endcsname{#4}}
212
213\protected\def\usesomethingtikzindeed#1#2#3
214 {\ifcsname#1:l:#3\endcsname\else
215 \letcsname#1:l:#3\endcsname\relax
216 \begincsname#1:b:#3\endcsname
217 \starttikzinput
218 #2[#3]
219 \stoptikzinput
220 \begincsname#1:a:#3\endcsname
221 \fi}
222
223
224
225\protected\def\installtikzlibraryhacks{\installsomethingtikzindeed\????tikzhack}
226\protected\def\installpgfmodulehacks {\installsomethingtikzindeed\????pgfmhack}
227\protected\def\installpgflibraryhacks {\installsomethingtikzindeed\????pgflhack}
228
229\tolerant\protected\def\usepgfmodule [#1]#;#2{\usesomethingtikzindeed\????pgfmhack\normalusepgfmodule {#1#2}}
230\tolerant\protected\def\usepgflibrary [#1]#;#2{\usesomethingtikzindeed\????pgflhack\normalusepgflibrary {#1#2}}
231\tolerant\protected\def\usetikzlibrary[#1]#;#2{\usesomethingtikzindeed\????tikzhack\normalusetikzlibrary{#1#2}}
232
233\protect
234
235\usepgfmodule[shapes]
236\usepgfmodule[plot]
237\usepgfmodule[matrix]
238\usepgfmodule[decorations]
239
240\definefilesynonym [pgfplots] [tikzpgfplots]
241\definefilesynonym [pgfplotstable] [tikzpgfplotstable]
242
243
244
245\installtikzlibraryhacks{calendar}{}{\tikzinputfile{pgfcalendar.code.tex}}
246
247\stopmodule
248 |