summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex')
-rw-r--r--graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex90
1 files changed, 90 insertions, 0 deletions
diff --git a/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex
new file mode 100644
index 0000000000..41ce3faaf5
--- /dev/null
+++ b/graphics/pgf/base/tex/generic/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex
@@ -0,0 +1,90 @@
+% Copyright 2018 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{tikzlibraryquotes.code.tex}
+
+\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/\expandafter\meaning\string"}{\tikz@quote@parser}%
+ \let\tikz@quotes@as\tikz@node@quotes@as%
+}%
+\def\tikz@enable@edge@quotes{%
+ \pgfkeyssetvalue{/handlers/first char syntax/\expandafter\meaning\string"}{\tikz@quote@parser}%
+ \let\tikz@quotes@as\tikz@edge@quotes@as%
+}%
+\def\tikz@enable@pic@quotes{%
+ \pgfkeyssetvalue{/handlers/first char syntax/\expandafter\meaning\string"}{\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/centered/.@cmd}\tikz@label@@centered
+ \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@@centered#1\pgfeov{\pgfkeysalso{label position=center,pin position=center}}%
+\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