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