summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex
blob: 4369b7e2dc2ff8be8df158447499606f16586511 (plain)
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
% Copyright 2011 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.

\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex,v 1.3 2013/08/28 15:24:27 tantau Exp $

\def\tikz@quote@parser#1{\tikz@quote@@parser#1\pgf@stop}
\def\tikz@quote@@parser"#1"{%
  \pgfutil@ifnextchar\bgroup{%
    \tikz@quote@@parser@group{#1}}{%
    \pgfutil@ifnextchar'{%
      \tikz@quote@@parser@apo{#1}}{%
      \tikz@quote@@parser@normal{#1}}}}
\def\tikz@quote@@parser@apo#1'{%
  \pgfutil@ifnextchar\bgroup{\tikz@quote@@parser@apo@group{#1}}{\tikz@quote@@parser@apo@normal{#1}}}
\def\tikz@quote@@parser@group#1#2#3\pgf@stop{%
  \expandafter\def\expandafter\tikz@temp\expandafter{\tikz@quotes@as{#1}{#2}}%
  \expandafter\pgfkeysalso\expandafter{\tikz@temp}%
}
\def\tikz@quote@@parser@normal#1#2\pgf@stop{%
  \expandafter\def\expandafter\tikz@temp\expandafter{\tikz@quotes@as{#1}{#2}}%
  \expandafter\pgfkeysalso\expandafter{\tikz@temp}%
}
\def\tikz@quote@@parser@apo@group#1#2#3\pgf@stop{%
  \expandafter\def\expandafter\tikz@temp\expandafter{\tikz@quotes@as{#1}{',#2}}%
  \expandafter\pgfkeysalso\expandafter{\tikz@temp}%
}
\def\tikz@quote@@parser@apo@normal#1#2\pgf@stop{%
  \expandafter\def\expandafter\tikz@temp\expandafter{\tikz@quotes@as{#1}{',#2}}%
  \expandafter\pgfkeysalso\expandafter{\tikz@temp}%
}

\pgfkeys{/handlers/first char syntax=true}

\def\tikz@enable@node@quotes{%
  \pgfkeyssetvalue{/handlers/first char syntax/the character "}{\tikz@quote@parser}%
  \let\tikz@quotes@as\tikz@node@quotes@as%
}
\def\tikz@enable@edge@quotes{%
  \pgfkeyssetvalue{/handlers/first char syntax/the character "}{\tikz@quote@parser}%
  \let\tikz@quotes@as\tikz@edge@quotes@as%
}
\def\tikz@enable@pic@quotes{%
  \pgfkeyssetvalue{/handlers/first char syntax/the character "}{\tikz@quote@parser}%
  \let\tikz@quotes@as\tikz@pic@quotes@as%
}

\tikzset{
  node quotes mean/.code={\def\tikz@node@quotes@as##1##2{#1}},
  edge quotes mean/.code={\def\tikz@edge@quotes@as##1##2{#1}},
  pic quotes mean/.code={\def\tikz@pic@quotes@as##1##2{#1}},
  quotes mean pin/.style={node quotes mean={
      pin={[direction shorthands,every pin quotes/.try,##2]##1}}},
  quotes mean label/.style={node quotes mean={
      label={[direction shorthands,every label quotes/.try,##2]##1}}},
  quotes mean label,
  edge quotes mean={edge node={node [every edge quotes,#2]{#1}}},
  pic quotes mean={pic text={#1},pic text options={every pic quotes/.try,#2}},
  every edge quotes/.style={auto},
  direction shorthands/.code={%
    \pgfkeyslet{/tikz/above/.@cmd}\tikz@label@@above
    \pgfkeyslet{/tikz/below/.@cmd}\tikz@label@@below
    \pgfkeyslet{/tikz/left/.@cmd}\tikz@label@@left
    \pgfkeyslet{/tikz/right/.@cmd}\tikz@label@@right
    \pgfkeyslet{/tikz/above left/.@cmd}\tikz@label@@above@left
    \pgfkeyslet{/tikz/above right/.@cmd}\tikz@label@@above@right
    \pgfkeyslet{/tikz/below left/.@cmd}\tikz@label@@below@left
    \pgfkeyslet{/tikz/below right/.@cmd}\tikz@label@@below@right
  }
}

\def\tikz@label@@above#1\pgfeov{\pgfkeysalso{label position=90,pin position=90}}
\def\tikz@label@@below#1\pgfeov{\pgfkeysalso{label position=-90,pin position=-90}}
\def\tikz@label@@left#1\pgfeov{\pgfkeysalso{label position=180,pin position=180}}
\def\tikz@label@@right#1\pgfeov{\pgfkeysalso{label position=0,pin position=0}}
\def\tikz@label@@above@left#1\pgfeov{\pgfkeysalso{label position=135,pin position=135}}
\def\tikz@label@@below@left#1\pgfeov{\pgfkeysalso{label position=-135,pin position=-135}}
\def\tikz@label@@above@right#1\pgfeov{\pgfkeysalso{label position=45,pin position=45}}
\def\tikz@label@@below@right#1\pgfeov{\pgfkeysalso{label position=-45,pin position=-45}}



\endinput