-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnanchors.tex
154 lines (147 loc) · 3.62 KB
/
nanchors.tex
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
\makeatletter
\ifx\documentclass\@twoclasseserror
\def\x{}
\else
\def\x{\end{document}}
\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{tikz-timing}
\usepackage{booktabs}
\usetikztiminglibrary{advnodes,either}
\usepgflibrary{plotmarks}
%^^A \tikzset{timing/node/old center}
\makeatletter
\pagestyle{empty}
\begin{document}
\fi
\begingroup
%
\makeatletter
\let\mid\relax
%
\tikzset{timing/draw grid}%
\tikzset{timing/.cd,
lslope=.5,
dslope=.5,
zslope=.5,
}%
%
\tikzset{%
marker/.style={opacity=.8,fill opacity=.8},
low/.style={marker,draw=red},
mid/.style={marker,draw=yellow},
high/.style={marker,draw=green},
low2/.style={marker,draw=red!50!black},
high2/.style={marker,draw=green!50!black},
LOW/.style={marker,CAPITAL,draw=red},
MID/.style={marker,CAPITAL,draw=yellow},
HIGH/.style={marker,CAPITAL,draw=green},
CAPITAL/.style={marker,mark=x,mark size=2\pgflinewidth},
origin/.style={marker,mark=x,draw=gray},
center/.style={marker,mark=+,draw=black},
old center/.style={marker,mark=+,mark size=2\pgflinewidth,draw=blue},
new center/.style={marker,mark size=\pgflinewidth,mark=*,fill=blue,draw=blue},
}%
%
\newcommand\namark[2][]{%^^A
\draw[mark=o,mark size=3\pgflinewidth,#1] plot coordinates {(#2)}
}%
%
\def\NodeAnchors#1#2{%^^A
\Huge
{\raisebox{-.5ex}{\scalebox{1}{%^^A
\begin{tikzpicture}[timing/picture,line width=.5\pgflinewidth]
\let\pgf@sh@ma@A\@undefined
\timing [name=T] at (0,0) {#1 N(A) #2};
\useasboundingbox (T.south west) rectangle (T.north east);
%^^A
\pgf@sh@ma@A
\anchorpoints
\foreach \a in {LOW,MID,HIGH,old center,new center} {%^^A
\namark[gray,\a]{A.\a};%^^A
}%^^A
\foreach \a in {low,mid,high,low2,high2} {%^^A
\@ifundefined{\a}{}%^^A
{\namark[semithick,\a]{A.\a};}%^^A
}%^^A
\namark[old center,blue]{A.old center};%^^A
\end{tikzpicture}%^^A
}}}%^^A
\Huge\strut
}%
%
\iftrue
%^^A \def\bchars{,L,H,X,Z,M,D,U,D{A},E,E0L,E0H,ee,T,C,tt,cc}%^^A
%^^A \def\achars{,L,H,X,Z,M,D,U,D{A},E,0LE,0HE,ee,T,C,tt,cc}%^^A
\def\bchars{,L,H,X,D,E}%^^A
\def\achars{,L,H,X,D,D{A},E,0LE,0HE}%^^A
%
\def\DA{D{A}}%
\def\tablecontent{%^^A
\begin{tabular}{lrrrrrrrrrrrrrrrrrr}%
\toprule
\tikzpicture
\useasboundingbox (-1ex,-.5ex) rectangle (1ex,.5ex);
\node {%^^A
\scalebox{0.4}%^^A
{\rotatebox{-45}{$\frac{\mbox{\rotatebox{45}{to}}}%^^A
{\mbox{\rotatebox{45}{from}}}$}}%^^A
};%^^A
\endtikzpicture
}
%
\def\atc#1{%^^A
\begingroup
\edef\@tempa{#1}%^^A
\expandafter\g@addto@macro\expandafter\tablecontent
\expandafter{\@tempa}%^^A
\endgroup
}%^^A
%
\foreach \b in \bchars {%^^A
\atc{& \noexpand\multicolumn{1}{c}{\b}}%^^A
}%
%
\atc{\noexpand\\ \noexpand\midrule}%
%
\foreach \a in \achars {%^^A
\ifx\a\DA
\atc{D\noexpand\{A\noexpand\}}%^^A
\else
\atc{\a}%^^A
\fi
\foreach \b in \bchars {%^^A
\atc{& \noexpand\NodeAnchors{\a}{\b}}%^^A
%^^A \hbox to 5em{\llap{\a\b:} \NodeAnchors{\a}{\b}}%^^A
}%
\atc{\noexpand\\}%
}%
%
\atc{%^^A
\noexpand\bottomrule
\noexpand\end{tabular}%^^A
}%
%
\sffamily\centering
\tablecontent
%
\def\legend#1#2{%^^A
\namark[#1]{[shift={(0,.125ex)}]#2}; \node [right] at (#2) {\normalsize #1\strut}
}%
\Huge
\begin{tikzpicture}[timing/picture,line width=.5\pgflinewidth]
\node [left] at (-1,0) {\large Legend:};
\legend{low}{0,0};
\legend{mid}{3,0};
\legend{high}{6,0};
\legend{low2}{0,-.8};
\legend{high2}{6,-.8};
\legend{LOW}{0,-1.6};
\legend{MID}{3,-1.6};
\legend{HIGH}{6,-1.6};
\legend{new center}{0,-2.4};
\legend{old center}{6,-2.4};
\end{tikzpicture}%
%
\endgroup
\x