summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/langsci/langsci-tikz.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/langsci/langsci-tikz.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/langsci/langsci-tikz.sty25
1 files changed, 25 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/xelatex/langsci/langsci-tikz.sty b/Master/texmf-dist/tex/xelatex/langsci/langsci-tikz.sty
new file mode 100644
index 00000000000..96bcd052110
--- /dev/null
+++ b/Master/texmf-dist/tex/xelatex/langsci/langsci-tikz.sty
@@ -0,0 +1,25 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%% Experimental feature for pointing out moving things. %%%%
+%%%% Buggy? Write to: kopeckyf@hu-berlin.de %%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\usetikzlibrary{arrows,arrows.meta}
+\newcounter{lsConnectTempGroup}
+\NewDocumentCommand\ConnectTail{m O{\thelsConnectTempGroup}}{%read: mandatory arg #1, optional argument #2 with the current group counter as its default value.
+ \edef\lsConnectTempPosition{#2}%\edef expands the argument, which means reading the current value of the counter.
+ {\tikz[remember picture,
+ anchor=base, baseline,
+ inner xsep=0pt,
+ inner ysep=-.5ex]\node (ConnectTempTail\lsConnectTempPosition) {\strut{}#1};}%\strut for baseline
+}
+\NewDocumentCommand\ConnectHead{s O{1ex} m O{\thelsConnectTempGroup}}{%read: star #1, optional argument (distance of arrow from text= std. one x-height), mand. arg. (node text), optional argument #2, the group specifier
+ \edef\lsConnectTempPosition{#4}%
+ \stepcounter{lsConnectTempGroup}%We have a match, let's update the group counter
+ {\tikz[remember picture,
+ anchor=base, baseline,
+ inner xsep=0pt,
+ inner ysep=-.5ex] \node (ConnectTempHead\lsConnectTempPosition) {\strut{}#3};%
+ \tikz[remember picture] \draw[% we have a tail and a head, let's bring them together
+ \IfBooleanTF#1{{Triangle[]}-}{-{Triangle[]}},% Check if the starred version is used. The starred version is right->left, the normal version left->right
+ overlay] (ConnectTempTail\lsConnectTempPosition.south) -- ++(0,-#2) -| (ConnectTempHead\lsConnectTempPosition.south);
+ }%
+} \ No newline at end of file