Debian Codegraph @

texmf-dist/tex/latex/duotenzor/duotenzor.sty

raw
1
2 \ProvidesPackage{duotenzor}
3
4 %% Version 1.00
5 %%%%% This is the duotenzor package.
6
7 %%%%%% I have written this sef of definitions to enable me to draw diagrams for operational cicuits and duotensor calculations. It is built on top of
8 %%%%%% the Tikz drawing package.
9
10
11 \usepackage{tikz}
12
13 \usetikzlibrary{calc}
14 \usetikzlibrary{arrows}
15
16 \usepackage{xspace}
17
18 %% duotensor.sty
19 %% Copyright 2010 Lucien Hardy
20 %
21 % This work may be distributed and/or modified under the
22 % conditions of the LaTeX Project Public License, either version 1.3
23 % of this license or (at your option) any later version.
24 % The latest version of this license is in
25 % http://www.latex-project.org/lppl.txt
26 % and version 1.3 or later is part of all distributions of LaTeX
27 % version 2005/12/01 or later.
28 % This work consists of the files duotenzor.sty and duotenzormanual.pdf
29
30
31
32 % Notes
33 %
34 % Every absolute coordinate should have the coordinate (XYshift) added to it.
35 %
36 % Font is placed at (fontlocation), or if \otherside is invoked, at (fontlocationb)
37 %
38 % If an opbox is named A then it has a point on the bottom left called (bottoml A) for inputs and a point on the top left called (topl A) corresponding % to input 1 and output 1 respectively. Other inputs/outputs are spaced at 0.8 intervals using a bit of code.
39 % Similarly, a duoboxes named B has (leftt A) at left top and (rightt B) at right top.
40 %
41 % Op font is \operationalfont which is set, by default, to \mathsf
42 % Duotensor font is \duotensorfont which is set, by default, to normal math font.
43
44
45 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% fonts %%%%%%%%%%%%%%%%%%%%%%%%%%%
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
48
49
50 % Default font choices (for internal use)
51
52 \newcommand{\operationalfont}{\mathsf}
53
54 \newcommand{\duotensorfont}{ {} }
55
56 % These commands can be used to change the fonts used.
57
58 \newcommand{\setoperationalfont}[1]{\renewcommand{\operationalfont}{#1}}
59
60 \newcommand{\setduotensorfont}[1]{\renewcommand{\duotensorfont}{#1}}
61
62
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% environments %%%%%%%%%%%%%%%%%%%%%%%%%
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66
67
68 %%%%%%% diagram environment \begin{diagram}[scale] optional argument is scale. Default is 1=0.25cm
69
70
71 \newenvironment{diagram}[1][1]{\begin{tikzpicture}[scale=#1*0.25]
72 \path (0,0) coordinate (XYshift); }{\end{tikzpicture}}
73
74
75 %%%%%% diagram environment \begin{Diagram}[scale]{Xshift}{voffset} has a verticle offset and a horizontal shift
76
77
78 \newenvironment{Diagram}[3][1]{\begin{tikzpicture}
79 [scale=#1*0.25, baseline=-5-#3cm]
80 \path (0,0)+(#2*4/{#1},0) coordinate (XYshift);}{\end{tikzpicture}}
81
82 \newenvironment{move}[2][1]{\begin{scope}[scale=#1] \path (XYshift) coordinate (XYshiftoriginal);
83 \path (XYshift)+(#2) coordinate (XYshift);}{\path (XYshiftoriginal) coordinate (XYshift);\end{scope}}
84
85 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Grid %%%%%%%%%%%%%%%%%%%%%%%%%%
87 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
88
89 \newcommand{\constructiongrid}[3][1]{\draw[step=#1cm, very thin] ($(#2)+(XYshift)$) grid ($(#3)+(XYshift)$);}
90
91
92
93 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
94 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% boxes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
95 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
96
97 % \Opbox[hsize]{A}{x,y}
98 %
99 % plots operation A at (x,y) with symbol A in mathsf.
100 % optional argument is hsize = max {number of inputs, number ofoutputs} default is 3.
101 % Also defines coordinates bottomlA and bottomrA for reference for wires (for internal use).
102
103 \newcommand{\Opbox}[3][3]{\draw[thick] ($(#3)+(XYshift)$) node (#2) {\ensuremath{\operationalfont #2}} +(-0.4*#1-0.15, -1) rectangle + (0.4*#1+0.15, 1); \path ($(#3)+(XYshift)+ (-0.4*#1+0.4,-1)$) coordinate (bottoml #2); \path ($(#3)+(XYshift)+(-0.4*#1+0.4, +1)$) coordinate (topl #2);
104 \path (#2) coordinate (fontlocation);}
105
106
107 % \opbox[hsize]{A1}{x,y}
108 %
109 % plots operation A1 at (x,y) - box empty. otherwise same as \Opbox (in which name and symbol were conflated for convenience)
110
111
112 \newcommand{\opbox}[3][3]{\draw[thick] ($(#3)+(XYshift)$) node (#2) {{}} +(-0.4*#1-0.15, -1) rectangle + (+0.4*#1+0.15, 1);
113 \path ($(#3)+(XYshift)+ (-0.4*#1+0.4,-1)$) coordinate (bottoml #2); \path ($(#3) +(XYshift)+(-0.4*#1+0.4, +1)$) coordinate (topl #2);\path ($(#3)+(XYshift)$) coordinate (fontlocation);}
114
115
116 % \Duobox[vsize]{A}{x,y}
117 %
118 % plots rectangle at (x,y) with symbol A in regular math font.
119 % optional argument is max( number inputs, number outputs) default is 3.
120 % Also defines coordinates lefttA and righttA for reference links (for internal use}.
121
122
123 \newcommand{\Duobox}[3][3]{\draw[thick] ($(#3)+(XYshift)$) node (#2) {\ensuremath{\duotensorfont #2}} +(-1, -0.4*#1-0.15) rectangle + (1, +0.4*#1+0.15);
124 \path ($(#3)+(XYshift)+(-1, +0.4*#1-0.4)$) coordinate (leftt #2); \path ($(#3)+(XYshift)+(+1,+0.4*#1-0.4)$) coordinate (rightt #2); \path ($(#3)+(XYshift)$) coordinate (fontlocation);}
125
126 % \duobox[vsize]{A1}{x}{y}{A}
127 %
128 % Plots rectangle A1 at (x,y). Otherwise same as \Duobox
129
130
131 \newcommand{\duobox}[3][3]{\draw[thick] ($(#3)+(XYshift)$) node (#2) {{}} +(-1, -0.4*#1-0.15) rectangle + (1, +0.4*#1+0.15);
132 \path ($(#3)+(XYshift)+(-1, +0.4*#1-0.4)$) coordinate (leftt #2); \path ($(#3)+(XYshift)+ (+1,+0.4*#1-0.4)$) coordinate (rightt #2);\path ($(#3)+(XYshift)$) coordinate (fontlocation);}
133
134
135
136 % \Duoopbox{hsize}{vsize}{A}{x, y}
137 %
138 % Plots box A (in mathsf font) hsize by vsize at (x,y).
139 % Also efines bottomlA, toplA, lefttA, righttA for internal use.
140
141 \newcommand{\Opduobox}[4]{\draw[thick] ($(#4)+(XYshift)$) node (#3) {\ensuremath{\operationalfont #3}} +(-0.4*#1-0.15, -0.4*#2-0.15) rectangle + (+0.4*#1+0.15,+0.4*#2+0.15);
142 \path ($(#4)+(XYshift)+ (-0.4*#1+0.4,-0.4*#2-0.15)$) coordinate (bottoml #3);
143 \path ($(#4)+(XYshift)+(-0.4*#1+0.4,+0.4*#2+0.15)$) coordinate (topl #3);
144 \path ($(#4)+(XYshift)+ (-0.4*#1-0.15, +0.4*#2-0.4)$) coordinate (leftt #3);
145 \path ($(#4)+(XYshift)+(+0.4*#1+0.15,+0.4*#2-0.4)$) coordinate (rightt #3); \path ($(#4)+(XYshift)$) coordinate (fontlocation); }
146
147
148 % \Opduobox{hsize}{vsize}{A}{x,y}{A}
149 %
150 % plots box A1 with the symbol A (in mathsf font). Otherwise same as \opduobox
151
152
153 \newcommand{\opduobox}[4]{\draw[thick] ($(#4)+(XYshift)$) node (#3) {{}} +(-0.4*#1-0.15, -0.4*#2-0.15) rectangle + (+0.4*#1+0.15,+0.4*#2+0.15);
154 \path ($(#4)+ (XYshift)+ (-0.4*#1+0.4,-0.4*#2-0.15)$) coordinate (bottoml #3);
155 \path ($(#4)+(XYshift)+(-0.4*#1+0.4,+0.4*#2+0.15)$) coordinate (topl #3);
156 \path ($(#4)+ (XYshift)+(-0.4*#1-0.15, +0.4*#2-0.4)$) coordinate (leftt #3);
157 \path ($(#4)+ (XYshift)+(+0.4*#1+0.15,+0.4*#2-0.4)$) coordinate (rightt #3); \path ($(#4)+(XYshift)$) coordinate (fontlocation); }
158
159 % \bbinsert[size]{g}{x,y} also \wwinsert, \wbinsert, \bwinsert.
160
161 \newcommand{\bbinsert}[3][1]{
162 \draw[thin, -o] ($(#3)+(XYshift)$)+ (-1.5*#1*2,0) coordinate (leftt #2) -- + ( -0.9*#1*2, 0);
163 \draw[thin, *-*] ($(#3)+(XYshift)+(-0.9*#1*2 + 0.2 ,0)$) -- ($(#3)+(XYshift)+ (0.9*#1*2 -0.2,0)$);
164 \draw[thin, -o] ($(#3)+(XYshift)$)+ (1.5*#1*2,0) coordinate (rightt #2) -- + ( 0.9*#1*2, 0);
165 \path ($(#3)+(XYshift)+(0, 16pt)$) coordinate (fontlocation); \path ($(#3)+(XYshift)+(0, -16pt)$) coordinate (fontlocationb);
166 }
167
168 \newcommand{\wwinsert}[3][1]{
169 \draw[thin, -*] ($(#3)+(XYshift)$)+ (-1.5*#1*2,0) coordinate (leftt #2) -- + ( -0.9*#1*2, 0);
170 \draw[thin, o-o] ($(#3)+(XYshift)+(-0.9*#1*2 + 0.2 ,0)$) -- ($(#3)+(XYshift)+ (0.9*#1*2 -0.2,0)$);
171 \draw[thin, -*] ($(#3)+(XYshift)$)+ (1.5*#1*2,0) coordinate (rightt #2) -- + ( 0.9*#1*2, 0);
172 \path ($(#3)+(XYshift)+(0, 16pt)$) coordinate (fontlocation); \path ($(#3)+(XYshift)+(0, -16pt)$) coordinate (fontlocationb);
173 }
174
175 \newcommand{\bwinsert}[3][1]{
176 \draw[thin, -o] ($(#3)+(XYshift)$)+ (-1.5*#1*2,0) coordinate (leftt #2) -- + ( -0.9*#1*2, 0);
177 \draw[thin, *-o] ($(#3)+(XYshift)+(-0.9*#1*2 + 0.2 ,0)$) -- ($(#3)+(XYshift)+ (0.9*#1*2 -0.2,0)$);
178 \draw[thin, -*] ($(#3)+(XYshift)$)+ (1.5*#1*2,0) coordinate (rightt #2) -- + ( 0.9*#1*2, 0);
179 \path ($(#3)+(XYshift)+(0, 16pt)$) coordinate (fontlocation); \path ($(#3)+(XYshift)+(0, -16pt)$) coordinate (fontlocationb);
180 }
181
182 \newcommand{\wbinsert}[3][1]{
183 \draw[thin, -*] ($(#3)+(XYshift)$)+ (-1.5*#1*2,0) coordinate (leftt #2) -- + ( -0.9*#1*2, 0);
184 \draw[thin, o-*] ($(#3)+(XYshift)+(-0.9*#1*2 + 0.2 ,0)$) -- ($(#3)+(XYshift)+ (0.9*#1*2 -0.2,0)$);
185 \draw[thin, -o] ($(#3)+(XYshift)$)+ (1.5*#1*2,0) coordinate (rightt #2) -- + ( 0.9*#1*2, 0);
186 \path ($(#3)+(XYshift)+(0, 16pt)$) coordinate (fontlocation); \path ($(#3)+(XYshift)+(0, -16pt)$) coordinate (fontlocationb);
187 }
188
189 % \bbmetric[size]{g}{x,y}
190
191 \newcommand{\bbmetric}[3][1]{
192 \path ($(#3)+(XYshift)+(-0.9*#1*2 + 0.2 ,0)$) coordinate (leftt #2);
193 \draw[thin, *-*] ($(#3)+(XYshift)+(-0.9*#1*2 + 0.2 ,0)$) -- ($(#3)+(XYshift)+ (0.9*#1*2 -0.2,0)$);
194 \path ($(#3)+(XYshift)+ (0.9*#1*2 -0.2,0)$) coordinate (rightt #2);
195 \path ($(#3)+(XYshift)+(0, 16pt)$) coordinate (fontlocation); \path ($(#3)+(XYshift)+(0, -16pt)$) coordinate (fontlocationb);
196 }
197
198
199 \newcommand{\bwmetric}[3][1]{
200 \path ($(#3)+(XYshift)+(-0.9*#1*2 + 0.2 ,0)$) coordinate (leftt #2);
201 \draw[thin, *-o] ($(#3)+(XYshift)+(-0.9*#1*2 + 0.2 ,0)$) -- ($(#3)+(XYshift)+ (0.9*#1*2 -0.2,0)$);
202 \path ($(#3)+(XYshift)+ (0.9*#1*2 -0.2,0)$) coordinate (rightt #2);
203 \path ($(#3)+(XYshift)+(0, 16pt)$) coordinate (fontlocation); \path ($(#3)+(XYshift)+(0, -16pt)$) coordinate (fontlocationb);
204 }
205
206 \newcommand{\wbmetric}[3][1]{
207 \path ($(#3)+(XYshift)+(-0.9*#1*2 + 0.2 ,0)$) coordinate (leftt #2);
208 \draw[thin, o-*] ($(#3)+(XYshift)+(-0.9*#1*2 + 0.2 ,0)$) -- ($(#3)+(XYshift)+ (0.9*#1*2 -0.2,0)$);
209 \path ($(#3)+(XYshift)+ (0.9*#1*2 -0.2,0)$) coordinate (rightt #2);
210 \path ($(#3)+(XYshift)+(0, 16pt)$) coordinate (fontlocation); \path ($(#3)+(XYshift)+(0, -16pt)$) coordinate (fontlocationb);
211 }
212
213 \newcommand{\wwmetric}[3][1]{
214 \path ($(#3)+(XYshift)+(-0.9*#1*2 + 0.2 ,0)$) coordinate (leftt #2);
215 \draw[thin, o-o] ($(#3)+(XYshift)+(-0.9*#1*2 + 0.2 ,0)$) -- ($(#3)+(XYshift)+ (0.9*#1*2 -0.2,0)$);
216 \path ($(#3)+(XYshift)+ (0.9*#1*2 -0.2,0)$) coordinate (rightt #2);
217 \path ($(#3)+(XYshift)+(0, 16pt)$) coordinate (fontlocation); \path ($(#3)+(XYshift)+(0, -16pt)$) coordinate (fontlocationb);
218 }
219
220
221
222
223
224 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
225 %%%%%%%%%%%%%%%%%%%%%%%% connecting wires and links %%%%%%%%%%%%%%%%%%%%
226 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
227
228
229 % \wire[fine tune shape]{A}{B}{1}{3} default finetuneshape is 1. 0 should make wire straight.
230 %
231 % Plots wire from output 1 of A to input 3 of B. Option of puting "a" for wire type to left of wire
232
233
234 \newcommand{\wire}[5][1]{\path (topl #2)+(#4*0.8-0.8, 0) coordinate (bottom); \path (bottoml #3)+ (#5*0.8-0.8, 0) coordinate (top);
235 \path (bottom) +(0, #1*1) coordinate (bc); \path (top) + (0, -1*#1) coordinate (tc); \draw (bottom) .. controls (bc) and (tc) .. (top);
236 \coordinate (middle) at ($0.5*(bottom) + 0.5*(top)$);
237 \coordinate (fontlocation) at ($(middle)!14pt!90:(top)$);
238 \coordinate (fontlocationb) at ($(middle)!-14pt!90:(top)$); }
239
240
241 % \doublewire[finetuneshape]{A}{B}{1}{3} Also \thikwire \thinwire
242 %
243 % A double wire. Otherwise same as \wire
244
245 \newcommand{\doublewire}[5][1]{\path (topl #2)+(#4*0.8-0.8, 0) coordinate (bottom); \path (bottoml #3)+ (#5*0.8-0.8, 0) coordinate (top);
246 \path (bottom) +(0, #1*1) coordinate (bc); \path (top) + (0, -1*#1) coordinate (tc); \draw[thick, double distance=0.4pt] (bottom) .. controls (bc) and (tc) .. (top);
247 \coordinate (middle) at ($0.5*(bottom) + 0.5*(top)$);
248 \coordinate (fontlocation) at ($(middle)!16pt!90:(top)$);
249 \coordinate (fontlocationb) at ($(middle)!-16pt!90:(top)$); }
250
251 \newcommand{\thickwire}[5][1]{\path (topl #2)+(#4*0.8-0.8, 0) coordinate (bottom); \path (bottoml #3)+ (#5*0.8-0.8, 0) coordinate (top);
252 \path (bottom) +(0, #1*1) coordinate (bc); \path (top) + (0, -1*#1) coordinate (tc); \draw[thick] (bottom) .. controls (bc) and (tc) .. (top);
253 \coordinate (middle) at ($0.5*(bottom) + 0.5*(top)$);
254 \coordinate (fontlocation) at ($(middle)!15pt!90:(top)$);
255 \coordinate (fontlocationb) at ($(middle)!-15pt!90:(top)$); }
256
257 \newcommand{\thinwire}[5][1]{\path (topl #2)+(#4*0.8-0.8, 0) coordinate (bottom); \path (bottoml #3)+ (#5*0.8-0.8, 0) coordinate (top);
258 \path (bottom) +(0, #1*1) coordinate (bc); \path (top) + (0, -1*#1) coordinate (tc); \draw[very thin] (bottom) .. controls (bc) and (tc) .. (top);
259 \coordinate (middle) at ($0.5*(bottom) + 0.5*(top)$);
260 \coordinate (fontlocation) at ($(middle)!14pt!90:(top)$);
261 \coordinate (fontlocationb) at ($(middle)!-14pt!90:(top)$); }
262
263
264 % \link[fine tune shape]{A}{B}{2}{4}
265 %
266 % Draws link from output index 2 of A to input index 4 of B
267
268
269 \newcommand{\link}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
270 \path (left) +(1*#1, 0) coordinate (lc); \path (right) + (-1*#1, 0) coordinate (rc); \draw (left) .. controls (lc) and (rc) .. (right);
271 \coordinate (middle) at ($0.5*(left) + 0.5*(right)$);
272 \coordinate (fontlocation) at ($(middle)!19pt!90:(right)$);
273 \coordinate (fontlocationb) at ($(middle)!-18pt!90:(right)$); }
274
275
276 % \doubleink[finetuneshape]{A}{B}{2}{4}
277 %
278 % Double link. Otherwise same as \link
279
280 \newcommand{\doublelink}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
281 \path (left) +(1*#1, 0) coordinate (lc); \path (right) + (-1*#1, 0) coordinate (rc); \draw[thick, double distance=0.4pt] (left) .. controls (lc) and (rc) .. (right);
282 \coordinate (middle) at ($0.5*(left) + 0.5*(right)$);
283 \coordinate (fontlocation) at ($(middle)!23pt!90:(right)$);
284 \coordinate (fontlocationb) at ($(middle)!-22pt!90:(right)$); }
285
286 \newcommand{\thicklink}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
287 \path (left) +(1*#1, 0) coordinate (lc); \path (right) + (-1*#1, 0) coordinate (rc); \draw[thick] (left) .. controls (lc) and (rc) .. (right);
288 \coordinate (middle) at ($0.5*(left) + 0.5*(right)$);
289 \coordinate (fontlocation) at ($(middle)!20pt!90:(right)$);
290 \coordinate (fontlocationb) at ($(middle)!-19pt!90:(right)$); }
291
292 \newcommand{\thinlink}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
293 \path (left) +(1*#1, 0) coordinate (lc); \path (right) + (-1*#1, 0) coordinate (rc); \draw[very thin] (left) .. controls (lc) and (rc) .. (right);
294 \coordinate (middle) at ($0.5*(left) + 0.5*(right)$);
295 \coordinate (fontlocation) at ($(middle)!19pt!90:(right)$);
296 \coordinate (fontlocationb) at ($(middle)!-18pt!90:(right)$); }
297
298
299
300 \newcommand{\linkbw}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
301 \path (left) +(0.5*#1, 0) coordinate (lc);
302 \path (right) + (-0.5*#1, 0) coordinate (rc);
303 \path ($0.5*(left) + 0.5*(right)$) coordinate (middle);
304 \path ($0.501*(left) + 0.499*(right)$) coordinate (bmiddle);
305 \draw[-*] (left) .. controls (lc) .. ($(bmiddle)!-1.5pt!(middle)$) ;
306 \draw[-o] (right) .. controls (rc) .. ($(bmiddle)!1.5pt!(middle)$);
307 \coordinate (fontlocation) at ($(middle)!24pt!90:(right)$);
308 \coordinate (fontlocationb) at ($(middle)!-23pt!90:(right)$); }
309
310 \newcommand{\linkwb}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
311 \path (left) +(0.5*#1, 0) coordinate (lc);
312 \path (right) + (-0.5*#1, 0) coordinate (rc);
313 \path ($0.5*(left) + 0.5*(right)$) coordinate (middle);
314 \path ($0.501*(left) + 0.499*(right)$) coordinate (bmiddle);
315 \draw[-o] (left) .. controls (lc) .. ($(bmiddle)!-1.5pt!(middle)$) ;
316 \draw[-*] (right) .. controls (rc) .. ($(bmiddle)!1.5pt!(middle)$);
317 \coordinate (fontlocation) at ($(middle)!24pt!90:(right)$);
318 \coordinate (fontlocationb) at ($(middle)!-23pt!90:(right)$); }
319
320 \newcommand{\linkww}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
321 \path (left) +(0.5*#1, 0) coordinate (lc);
322 \path (right) + (-0.5*#1, 0) coordinate (rc);
323 \path ($0.5*(left) + 0.5*(right)$) coordinate (middle);
324 \path ($0.501*(left) + 0.499*(right)$) coordinate (bmiddle);
325 \draw[-o] (left) .. controls (lc) .. ($(bmiddle)!-1.5pt!(middle)$) ;
326 \draw[-o] (right) .. controls (rc) .. ($(bmiddle)!1.5pt!(middle)$);
327 \coordinate (fontlocation) at ($(middle)!24pt!90:(right)$);
328 \coordinate (fontlocationb) at ($(middle)!-23pt!90:(right)$); }
329
330 \newcommand{\linkbb}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
331 \path (left) +(0.5*#1, 0) coordinate (lc);
332 \path (right) + (-0.5*#1, 0) coordinate (rc);
333 \path ($0.5*(left) + 0.5*(right)$) coordinate (middle);
334 \path ($0.501*(left) + 0.499*(right)$) coordinate (bmiddle);
335 \draw[-*] (left) .. controls (lc) .. ($(bmiddle)!-1.5pt!(middle)$) ;
336 \draw[-*] (right) .. controls (rc) .. ($(bmiddle)!1.5pt!(middle)$);
337 \coordinate (fontlocation) at ($(middle)!24pt!90:(right)$);
338 \coordinate (fontlocationb) at ($(middle)!-23pt!90:(right)$); }
339
340
341 %%%%%% link with wbbw dots
342
343 \newcommand{\linkwbbw}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
344 \path (left) +(0.5*#1, 0) coordinate (lc);
345 \path (right) + (-0.5*#1, 0) coordinate (rc);
346 \path ($0.5*(left) + 0.5*(right)$) coordinate (middle);
347 \path ($0.501*(left) + 0.499*(right)$) coordinate (bmiddle);
348 \path ($0.501*(right) + 0.499*(left)$) coordinate (amiddle);
349 \draw[-o] (left) .. controls (lc) .. ($(bmiddle)!-1.5cm-1.5pt!(amiddle)$) ;
350 \draw[*-*] ($(bmiddle)!-1.5cm+1.5pt!(amiddle)$) -- ($(bmiddle)!1.5cm-1.5pt!(amiddle)$);
351 \draw[-o] (right) .. controls (rc) .. ($(bmiddle)!1.5cm+1.5pt!(amiddle)$);
352 \coordinate (fontlocation) at ($(middle)!24pt!90:(right)$);
353 \coordinate (fontlocationb) at ($(middle)!-23pt!90:(right)$); }
354
355 \newcommand{\linkbwwb}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
356 \path (left) +(0.5*#1, 0) coordinate (lc);
357 \path (right) + (-0.5*#1, 0) coordinate (rc);
358 \path ($0.5*(left) + 0.5*(right)$) coordinate (middle);
359 \path ($0.501*(left) + 0.499*(right)$) coordinate (bmiddle);
360 \path ($0.501*(right) + 0.499*(left)$) coordinate (amiddle);
361 \draw[-*] (left) .. controls (lc) .. ($(bmiddle)!-1.5cm-1.5pt!(amiddle)$) ;
362 \draw[o-o] ($(bmiddle)!-1.5cm+1.5pt!(amiddle)$) -- ($(bmiddle)!1.5cm-1.5pt!(amiddle)$);
363 \draw[-*] (right) .. controls (rc) .. ($(bmiddle)!1.5cm+1.5pt!(amiddle)$);
364 \coordinate (fontlocation) at ($(middle)!24pt!90:(right)$);
365 \coordinate (fontlocationb) at ($(middle)!-23pt!90:(right)$); }
366
367 \newcommand{\linkwbwb}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
368 \path (left) +(0.5*#1, 0) coordinate (lc);
369 \path (right) + (-0.5*#1, 0) coordinate (rc);
370 \path ($0.5*(left) + 0.5*(right)$) coordinate (middle);
371 \path ($0.501*(left) + 0.499*(right)$) coordinate (bmiddle);
372 \path ($0.501*(right) + 0.499*(left)$) coordinate (amiddle);
373 \draw[-o] (left) .. controls (lc) .. ($(bmiddle)!-1.5cm-1.5pt!(amiddle)$) ;
374 \draw[*-o] ($(bmiddle)!-1.5cm+1.5pt!(amiddle)$) -- ($(bmiddle)!1.5cm-1.5pt!(amiddle)$);
375 \draw[-*] (right) .. controls (rc) .. ($(bmiddle)!1.5cm+1.5pt!(amiddle)$);
376 \coordinate (fontlocation) at ($(middle)!24pt!90:(right)$);
377 \coordinate (fontlocationb) at ($(middle)!-23pt!90:(right)$); }
378
379 \newcommand{\linkbwbw}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
380 \path (left) +(0.5*#1, 0) coordinate (lc);
381 \path (right) + (-0.5*#1, 0) coordinate (rc);
382 \path ($0.5*(left) + 0.5*(right)$) coordinate (middle);
383 \path ($0.501*(left) + 0.499*(right)$) coordinate (bmiddle);
384 \path ($0.501*(right) + 0.499*(left)$) coordinate (amiddle);
385 \draw[-*] (left) .. controls (lc) .. ($(bmiddle)!-1.5cm-1.5pt!(amiddle)$) ;
386 \draw[o-*] ($(bmiddle)!-1.5cm+1.5pt!(amiddle)$) -- ($(bmiddle)!1.5cm-1.5pt!(amiddle)$);
387 \draw[-o] (right) .. controls (rc) .. ($(bmiddle)!1.5cm+1.5pt!(amiddle)$);
388 \coordinate (fontlocation) at ($(middle)!24pt!90:(right)$);
389 \coordinate (fontlocationb) at ($(middle)!-23pt!90:(right)$); }
390
391
392 %%%% links with a black or white dot on one end or both:
393
394
395 \newcommand{\blink}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
396 \path (left) +(1*#1, 0) coordinate (lc); \path (right) + (-1*#1, 0) coordinate (rc); \draw[*-] (left) .. controls (lc) and (rc) .. (right);
397 \coordinate (middle) at ($0.5*(left) + 0.5*(right)$);
398 \coordinate (fontlocation) at ($(middle)!19pt!90:(right)$);
399 \coordinate (fontlocationb) at ($(middle)!-18pt!90:(right)$); }
400
401 \newcommand{\wlink}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
402 \path (left) +(1*#1, 0) coordinate (lc); \path (right) + (-1*#1, 0) coordinate (rc); \draw[o-] (left) .. controls (lc) and (rc) .. (right);
403 \coordinate (middle) at ($0.5*(left) + 0.5*(right)$);
404 \coordinate (fontlocation) at ($(middle)!19pt!90:(right)$);
405 \coordinate (fontlocationb) at ($(middle)!-18pt!90:(right)$); }
406
407 \newcommand{\linkb}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
408 \path (left) +(1*#1, 0) coordinate (lc); \path (right) + (-1*#1, 0) coordinate (rc); \draw[-*] (left) .. controls (lc) and (rc) .. (right);
409 \coordinate (middle) at ($0.5*(left) + 0.5*(right)$);
410 \coordinate (fontlocation) at ($(middle)!19pt!90:(right)$);
411 \coordinate (fontlocationb) at ($(middle)!-18pt!90:(right)$); }
412
413 \newcommand{\linkw}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
414 \path (left) +(1*#1, 0) coordinate (lc); \path (right) + (-1*#1, 0) coordinate (rc); \draw[-o] (left) .. controls (lc) and (rc) .. (right);
415 \coordinate (middle) at ($0.5*(left) + 0.5*(right)$);
416 \coordinate (fontlocation) at ($(middle)!19pt!90:(right)$);
417 \coordinate (fontlocationb) at ($(middle)!-18pt!90:(right)$); }
418
419 \newcommand{\blinkb}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
420 \path (left) +(1*#1, 0) coordinate (lc); \path (right) + (-1*#1, 0) coordinate (rc); \draw[*-*] (left) .. controls (lc) and (rc) .. (right);
421 \coordinate (middle) at ($0.5*(left) + 0.5*(right)$);
422 \coordinate (fontlocation) at ($(middle)!19pt!90:(right)$);
423 \coordinate (fontlocationb) at ($(middle)!-18pt!90:(right)$); }
424
425 \newcommand{\blinkw}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
426 \path (left) +(1*#1, 0) coordinate (lc); \path (right) + (-1*#1, 0) coordinate (rc); \draw[*-o] (left) .. controls (lc) and (rc) .. (right);
427 \coordinate (middle) at ($0.5*(left) + 0.5*(right)$);
428 \coordinate (fontlocation) at ($(middle)!19pt!90:(right)$);
429 \coordinate (fontlocationb) at ($(middle)!-18pt!90:(right)$); }
430
431 \newcommand{\wlinkb}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
432 \path (left) +(1*#1, 0) coordinate (lc); \path (right) + (-1*#1, 0) coordinate (rc); \draw[o-*] (left) .. controls (lc) and (rc) .. (right);
433 \coordinate (middle) at ($0.5*(left) + 0.5*(right)$);
434 \coordinate (fontlocation) at ($(middle)!19pt!90:(right)$);
435 \coordinate (fontlocationb) at ($(middle)!-18pt!90:(right)$); }
436
437 \newcommand{\wlinkw}[5][1]{\path (rightt #2)+(0, 0.8-#4*0.8) coordinate (left); \path (leftt #3) + (0, 0.8-#5*0.8) coordinate (right);
438 \path (left) +(1*#1, 0) coordinate (lc); \path (right) + (-1*#1, 0) coordinate (rc); \draw[o-o] (left) .. controls (lc) and (rc) .. (right);
439 \coordinate (middle) at ($0.5*(left) + 0.5*(right)$);
440 \coordinate (fontlocation) at ($(middle)!19pt!90:(right)$);
441 \coordinate (fontlocationb) at ($(middle)!-18pt!90:(right)$); }
442
443
444
445 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
446 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% inputs and outputs %%%%%%%%%%%%%%%%%%%%%%
447 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
448
449 %\outwire[bendyness]{A}{2} Also \inwire[bendyness]{A}{3}
450 %
451 % Draws an output wire from output 2 of operation A. Option of adding a (in san serif) just after wire.
452
453
454 \newcommand{\outwire}[3][0]{\path (topl #2)+(#3*0.8-0.8, 0) coordinate (bottom);
455 \path (bottom)+(#1*0.1, 1.5) coordinate (top);
456 \path (bottom) +(0, 0.5) coordinate (bc);
457 \draw (bottom) .. controls (bc) .. (top);
458 \path[draw] (top) + (#1*0.06, 40pt) node (fontlocation) {{}}; }
459
460
461 \newcommand{\inwire}[3][0]{\path (bottoml #2)+ (#3*0.8-0.8, 0) coordinate (top);
462 \path (top)+ (#1*0.1, -1.5) coordinate (bottom);
463 \path (top) +(0, -0.5) coordinate (tc);
464 \draw (top) .. controls (tc) .. (bottom);
465 \path[draw] (bottom) + (#1*0.06, 0pt) node (fontlocation) {{}}; }
466
467 \newcommand{\closedoutwire}[3][0]{\path (topl #2)+(#3*0.8-0.8, 0) coordinate (bottom);
468 \path (bottom)+(#1*0.1, 1.5) coordinate (top);
469 \path (bottom) +(0, 0.5) coordinate (bc);
470 \draw (bottom) .. controls (bc) .. (top);
471 \path[draw,ultra thick] ($(top)!0.4cm!90:(bc)$) -- ($(top)!-0.4cm!90:(bc)$);
472 \path[draw] (top) + (#1*0.06, 40pt) node (fontlocation) {{}}; }
473
474
475 \newcommand{\closedinwire}[3][0]{\path (bottoml #2)+ (#3*0.8-0.8, 0) coordinate (top);
476 \path (top)+ (#1*0.1, -1.5) coordinate (bottom);
477 \path (top) +(0, -0.5) coordinate (tc);
478 \draw (top) .. controls (tc) .. (bottom);
479 \path[draw,ultra thick] ($(bottom)!0.4cm!90:(tc)$) -- ($(bottom)!-0.4cm!90:(tc)$);
480 \path[draw] (bottom) + (#1*0.06, 0pt) node (fontlocation) {{}}; }
481
482
483
484 %\outblack[bend]{A}{2} Also \outwhite, \inblack, \inwhite
485 %
486 % Draws an output wire with black dot from output 2 of A. Option bends wire down by bend.
487
488
489
490
491
492 \newcommand{\outblack}[3][0]{\path (rightt #2)+(0, -#3*0.8 + 0.8) coordinate (start);
493 \path (start) + (1.5, -#1*0.1) coordinate (end);
494 \path (start) + (0.5, 0) coordinate (sc);
495 \draw[ -* ] (start) .. controls (sc) .. (end);
496 \path (end) + (25pt, -#1*0.06) node (fontlocation) {{}} ; }
497
498 \newcommand{\outwhite}[3][0]{\path (rightt #2)+(0, -#3*0.8 + 0.8) coordinate (start);
499 \path (start) + (1.5, -#1*0.1) coordinate (end);
500 \path (start) + (0.5, 0) coordinate (sc);
501 \draw[ -o ] (start) .. controls (sc) .. (end);
502 \path (end) + (25pt, -#1*0.06) node (fontlocation) {{}} ; }
503
504 \newcommand{\inblack}[3][0]{\path (leftt #2)+(0, -#3*0.8 + 0.8) coordinate (start);
505 \path (start) + (-1.5, -#1*0.1) coordinate (end);
506 \path (start) + (-0.5, 0) coordinate (sc);
507 \draw[ -* ] (start) .. controls (sc) .. (end);
508 \path (end) + (-5pt, -#1*0.06) node (fontlocation) {{}} ; }
509
510 \newcommand{\inwhite}[3][0]{\path (leftt #2)+(0, -#3*0.8 + 0.8) coordinate (start);
511 \path (start) + (-1.5, -#1*0.1) coordinate (end);
512 \path (start) + (-0.5, 0) coordinate (sc);
513 \draw[ -o ] (start) .. controls (sc) .. (end);
514 \path (end) + (-5pt, -#1*0.06) node (fontlocation) {{}} ; }
515
516
517
518
519
520 %%%% \linkedprep[size]{A}{3}{X}{absolute x}{rel y}, also \linkedeffect
521
522
523
524 \newcommand{\linkedprep}[6][1]{\path (rightt #2)+(0, -#3*0.8 + 0.8) coordinate (start);
525 \path ($(start)-(XYshift)$) coordinate (startraw);
526 \path ($(0,0)!(startraw)!(0,1)$) coordinate (startycoord);
527 \path[draw] (start) -- ($(startycoord)+(#5-#1*0.433012702, 0)+(XYshift)$) coordinate (end);
528 \path[draw,thick] ($(end)+(30:#1*0.5)$) +(150:#1) -- +(30:#1)-- +(-90:#1) -- cycle;
529 \path ($0.5*(start)+0.5*(end)+(0,16pt)$) coordinate (fontlocation);
530 \path ($0.5*(start)+0.5*(end)-(0,16pt)$) coordinate (fontlocationb);
531 \path ($(end)+(30:#1*0.5)+(90:#1*0.5)$) coordinate (topl #4);
532 }
533
534
535 \newcommand{\linkedeffect}[6][1]{\path (leftt #2)+(0, -#3*0.8 + 0.8) coordinate (start);
536 \path ($(start)-(XYshift)$) coordinate (startraw);
537 \path ($(0,0)!(startraw)!(0,1)$) coordinate (startycoord);
538 \path[draw] (start) -- ($(startycoord)+(#5+#1*0.433012702, 0)+(XYshift)$) coordinate (end);
539 \path[draw,thick] ($(end)+(-150:#1*0.5)$) +(90:#1) -- +(-30:#1)-- +(210:#1) -- cycle;
540 \path ($0.5*(start)+0.5*(end)+(0,16pt)$) coordinate (fontlocation);
541 \path ($0.5*(start)+0.5*(end)-(0,16pt)$) coordinate (fontlocationb);
542 \path ($(end)+(-150:#1*0.5)+(-90:#1*0.5)$) coordinate (bottoml #4);
543 }
544
545
546
547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
548 %%%%%%%%%%%%%%%%%%%%%%%%%% type placement %%%%%%%%%%%%%%%%%%%%
549 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
550
551 %%% \opsymbol[20pt, 10pt]{a_1} Also \duosymbol for regular font. Also \Opsymbol and \Duosymbol which justify font (good on inputs and outputs)
552 %
553 %
554 %places a_2 in sans serif font at the (fontlocation) coordinate of the previous command (a guess as to what a good location is) but allows for fine %tuning (it can be moved by optional argument - in this case 20pt up and 10pt right
555
556
557 \newcommand{\opsymbol}[2][0,0]{ \path ($0.0352777778*(#1)+(fontlocation)$) node {\ensuremath{\operationalfont{#2}}};}
558
559 \newcommand{\duosymbol}[2][0,0]{\path ($0.0352777778*(#1)+(fontlocation)$) node {\ensuremath{\duotensorfont{#2}}};}
560
561 \newcommand{\otherside}{\coordinate (fontlocation) at (fontlocationb);}
562
563 \newcommand{\Opsymbol}[2][0,0]{ \path ($0.0352777778*(#1)+(fontlocation)$) node [text height = 1.7em,text depth=.25ex] {\ensuremath{\operationalfont{#2}}};}
564
565 \newcommand{\Duosymbol}[2][0,0]{\path ($0.0352777778*(#1)+(fontlocation)$) node [text width = 1em]
566 {\ensuremath{\duotensorfont{#2}}};}
567
568 %% \putlatex[finetune]{Latex in here} puts it at the (fontlocation) of previous command.
569
570 \newcommand{\putlatex}[2][0,0]{ \path ($0.0352777778*(#1)+(fontlocation)$) node {#2};}
571
572 %% \placelatex[finetune]{x,y}{Latex in here}
573
574 \newcommand{\placelatex}[3][0,0]{ \path ($(XYshift)+(#2)+0.0352777778*(#1)$) node {#3};}
575
576
577
578 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
579 %%%%%%%%%%%%%%%%%%%%%%%%%%%% Fiducials and terminals %%%%%%%%%
580 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
581
582
583 %%%%% \fidprep[size]{X1}{x,y} Also \fideffect (but with bottoml X1)
584 %
585 % Draws triangle for fiducial prep labeled by X1 and placed at (x,y) Has topl X1, leftt X1, rightt X1 defined for internal use.
586
587
588 \newcommand{\fidprep}[3][1]{\path[draw, thick] ($(#3)+(XYshift)$) coordinate (fontlocation) +(150:#1) -- +(30:#1)-- +(-90:#1) -- cycle + (90:#1*0.5) coordinate (topl #2) +(-30:#1*0.5) coordinate (rightt #2) + (210: #1*0.5) coordinate (leftt #2) ;}
589
590
591 \newcommand{\fideffect}[3][1]{\path[draw, thick] ($(#3)+(XYshift)$) coordinate (fontlocation) +(90:#1) -- +(-30:#1)-- +(210:#1) -- cycle + (-90:#1*0.5) coordinate (bottoml #2) +(30:#1*0.5) coordinate (rightt #2) + (150: #1*0.5) coordinate (leftt #2) ;}
592
593
594
595
596 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
597 %%%%%%%%%%%%%%%%% Foliation lines %%%%%%%%%%%%%%%%%
598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
599
600
601 \newenvironment{foliation}[2]{\path (#1,0)++ (XYshift) coordinate (foliateleft); \path (#1,1) ++ (XYshift) coordinate (leftup);
602 \path (#2,0)++ (XYshift) coordinate (foliateright); \path (#2,1)++ (XYshift) coordinate (rightup);}{}
603
604
605
606 \newcommand{\startfoliate}[4]{\path[draw, dashed]
607 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0) + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) +(-1,0)$) coordinate (start)
608 ..
609 controls
610 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0) + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0)+(-1,0)$)
611 ..
612 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0) + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0)$) ..
613 controls ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0) + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0)+(1,0)$) and}
614
615
616 \newcommand{\continuefoliate}[4]{
617 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0) + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0)+(-1,0)$)
618 ..
619 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0) + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0)$)
620 ..
621 controls
622 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0) + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0)+(1,0)$) and}
623
624
625 \newcommand{\finishfoliate}[4]{($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0) + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0)+(-1,0)$)
626 ..
627 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0) + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0)$)
628 ..
629 controls
630 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0) + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0)+(1,0)$)
631 ..
632 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0) + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) + (1,0)$) coordinate (end);
633 \path[draw, dashed] (start) ++ (-13pt, 0) -- ($(foliateleft)!(start)!(leftup)$) coordinate (start);
634 \path[draw, dashed] (end)++ (13pt, 0) -- ($(foliateright)!(end)!(rightup)$) coordinate (end);
635 \path ($(start)+ (-21pt,0)$) coordinate (fontlocation); \path ($(end) + (21pt,0)$) coordinate (fontlocationb);}
636
637
638 \newcommand{\Startfoliate}[5]{\path[draw, dashed]
639 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0)- #5*(topl #1) - #5*(#3*0.8-0.8, 0)
640 + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) + #5*(bottoml #2)+ #5*(#4*0.8-0.8, 0) +(-1,0)$)
641 coordinate (start)
642 ..
643 controls
644 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0)- #5*(topl #1) - #5*(#3*0.8-0.8, 0)
645 + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) + #5*(bottoml #2)+ #5*(#4*0.8-0.8, 0)+(-1,0)$)
646 ..
647 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0)- #5*(topl #1) - #5*(#3*0.8-0.8, 0)
648 + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) + #5*(bottoml #2)+ #5*(#4*0.8-0.8, 0)$)
649 ..
650 controls ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0)- #5*(topl #1) - #5*(#3*0.8-0.8, 0)
651 + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) + #5*(bottoml #2)+ #5*(#4*0.8-0.8, 0)+(1,0)$) and}
652
653
654 \newcommand{\Continuefoliate}[5]{
655 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0)- #5*(topl #1) - #5*(#3*0.8-0.8, 0)
656 + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) + #5*(bottoml #2)+ #5*(#4*0.8-0.8, 0)+(-1,0)$)
657 ..
658 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0)- #5*(topl #1) - #5*(#3*0.8-0.8, 0)
659 + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) + #5*(bottoml #2)+ #5*(#4*0.8-0.8, 0)$)
660 ..
661 controls
662 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0)- #5*(topl #1) - #5*(#3*0.8-0.8, 0)
663 + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) + #5*(bottoml #2)+ #5*(#4*0.8-0.8, 0)+(1,0)$) and}
664
665
666 \newcommand{\Finishfoliate}[5]{($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0)- #5*(topl #1) - #5*(#3*0.8-0.8, 0)
667 + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) + #5*(bottoml #2)+ #5*(#4*0.8-0.8, 0)+(-1,0)$)
668 ..
669 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0)- #5*(topl #1) - #5*(#3*0.8-0.8, 0)
670 + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) + #5*(bottoml #2)+ #5*(#4*0.8-0.8, 0)$)
671 ..
672 controls
673 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0)- #5*(topl #1) - #5*(#3*0.8-0.8, 0)
674 + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) + #5*(bottoml #2)+ #5*(#4*0.8-0.8, 0)+(1,0)$)
675 ..
676 ($0.5*(topl #1)+ 0.5*(#3*0.8-0.8, 0)- #5*(topl #1) - #5*(#3*0.8-0.8, 0)
677 + 0.5*(bottoml #2)+ 0.5*(#4*0.8-0.8, 0) + #5*(bottoml #2)+ #5*(#4*0.8-0.8, 0) + (1,0)$) coordinate (end) ;
678 \path[draw, dashed] (start) ++ (-13pt, 0)-- ($(foliateleft)!(start)!(leftup)$) coordinate (start);
679 \path[draw, dashed] (end)++ (13pt, 0) -- ($(foliateright)!(end)!(rightup)$) coordinate (end);
680 \path ($(start)+ (-21pt,0)$) coordinate (fontlocation); \path ($(end) + (21pt,0)$) coordinate (fontlocationb);}
681
682
683
684
685
686 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
687 %%%%%%%%%%%%%%%%%%%%%%%%% Abstract symbols %%%%%%%%%%%%%%%
688 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
689
690 %% \thispoint[dx,dy]{A}{x,y}
691
692 \newcommand{\thispoint}[3][0,0]{\path ($(XYshift)+0.03528*(#1) +(#3)$) coordinate (#2) coordinate (leftt #2) coordinate (rightt #2)
693 coordinate (topl #2) coordinate (bottoml #2) coordinate (fontlocation) coordinate (fontlocationb);}
694
695
696 %% \boundingbox{coord1}{coord2} defines bounding box for diagram.
697
698
699 \newcommand{\boundingbox}[2]{\useasboundingbox ($(#2)+(XYshift)$) rectangle ($(#2)+(XYshift)$);}
700
701
702
703 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
704 %%%%%%%%%% In text symbols %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
706
707 %
708 % \ultrathickdash
709
710 \newcommand{\ultrathickdash}{\tikz[baseline=-3pt]\path[draw, ultra thick] (0,0) -- (2mm,0);\xspace}
711
712 % \bbdots also \bwdots, \wbdots, \wwdots, \nbdots, \nwdots, \bndots, \wndots, \bbleftjump, \bbrightjump, \bwleftjump, etc.
713
714 \newcommand{\bbdots}{\tikz[baseline=-3pt]\path[draw, *-*] (0,0) -- (6mm,0);\xspace}
715
716 \newcommand{\bwdots}{\tikz[baseline=-3pt]\path[draw, *-o] (0,0) -- (6mm,0);\xspace}
717
718 \newcommand{\wbdots}{\tikz[baseline=-3pt]\path[draw, o-*] (0,0) -- (6mm,0);\xspace}
719
720 \newcommand{\wwdots}{\tikz[baseline=-3pt]\path[draw, o-o] (0,0) -- (6mm,0);\xspace}
721
722 \newcommand{\nbdots}{\tikz[baseline=-3pt]\path[draw, -*] (0,0) -- (6mm,0);\xspace}
723
724 \newcommand{\nwdots}{\tikz[baseline=-3pt]\path[draw, -o] (0,0) -- (6mm,0);\xspace}
725
726 \newcommand{\bndots}{\tikz[baseline=-3pt]\path[draw, *-] (0,0) -- (6mm,0);\xspace}
727
728 \newcommand{\wndots}{\tikz[baseline=-3pt]\path[draw, o-] (0,0) -- (6mm,0);\xspace}
729
730 \newcommand{\nndots}{\tikz[baseline=-3pt]\path[draw, -] (0,0) -- (6mm,0);\xspace}
731
732 \newcommand{\nndotslong}{\tikz[baseline=-3pt]\path[draw, -] (0,0) -- (9mm,0);\xspace}
733
734 \newcommand{\bbleftjump}{\tikz[scale=0.18, xscale=1, rotate=90, baseline=-3pt]\path[draw, *-*] (-1,-0.8) -- (-1,0) .. controls (-1,0.555) and (-0.555,1) .. (0,1) .. controls (0.555,1) and (1,0.555) .. (1,0) -- (1,-0.8); \xspace}
735
736 \newcommand{\bwleftjump}{\tikz[scale=0.18, xscale=1, rotate=90, baseline=-3pt]\path[draw, o-*] (-1,-0.8) -- (-1,0) .. controls (-1,0.555) and (-0.555,1) .. (0,1) .. controls (0.555,1) and (1,0.555) .. (1,0) -- (1,-0.8); \xspace}
737
738 \newcommand{\wbleftjump}{\tikz[scale=0.18, xscale=1, rotate=90, baseline=-3pt]\path[draw, *-o] (-1,-0.8) -- (-1,0) .. controls (-1,0.555) and (-0.555,1) .. (0,1) .. controls (0.555,1) and (1,0.555) .. (1,0) -- (1,-0.8); \xspace}
739
740 \newcommand{\wwleftjump}{\tikz[scale=0.18, xscale=1, rotate=90, baseline=-3pt]\path[draw, o-o] (-1,-0.8) -- (-1,0) .. controls (-1,0.555) and (-0.555,1) .. (0,1) .. controls (0.555,1) and (1,0.555) .. (1,0) -- (1,-0.8); \xspace}
741
742 \newcommand{\bbrightjump}{\tikz[scale=0.18, xscale=-1, rotate=90, baseline=-3pt]\path[draw, *-*] (-1,-0.8) -- (-1,0) .. controls (-1,0.555) and (-0.555,1) .. (0,1) .. controls (0.555,1) and (1,0.555) .. (1,0) -- (1,-0.8); \xspace}
743
744 \newcommand{\bwrightjump}{\tikz[scale=0.18, xscale=-1, rotate=90, baseline=-3pt]\path[draw, o-*] (-1,-0.8) -- (-1,0) .. controls (-1,0.555) and (-0.555,1) .. (0,1) .. controls (0.555,1) and (1,0.555) .. (1,0) -- (1,-0.8); \xspace}
745
746 \newcommand{\wbrightjump}{\tikz[scale=0.18, xscale=-1, rotate=90, baseline=-3pt]\path[draw, *-o] (-1,-0.8) -- (-1,0) .. controls (-1,0.555) and (-0.555,1) .. (0,1) .. controls (0.555,1) and (1,0.555) .. (1,0) -- (1,-0.8); \xspace}
747
748 \newcommand{\wwrightjump}{\tikz[scale=0.18, xscale=-1, rotate=90, baseline=-3pt]\path[draw, o-o] (-1,-0.8) -- (-1,0) .. controls (-1,0.555) and (-0.555,1) .. (0,1) .. controls (0.555,1) and (1,0.555) .. (1,0) -- (1,-0.8); \xspace}
749
750
751
752
753
754
755
756
757
758