~tex-sx/tex-sx/development

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
\documentclass{article}
\usepackage{tikzutils}
\usetikzlibrary{decorations.markings}

\begin{document}

\section{Marker}

This is some text\tikzmark{here} with a circle after ``text''.\tikz[overlay,remember picture] \fill (here) circle [radius=2pt];

\section{Non-recursive post- and preactions}

\begin{tikzpicture}
[every path/.style={nonrecursive-postaction={thin, red, draw,red}}]
    \draw[ultra thick] (0,0)--(1,0);    
    \draw[ultra thick] (0,0.3)--(1,0.3);    
\end{tikzpicture}
\begin{tikzpicture}
[every path/.style={nonrecursive-preaction={ultra thick, red, draw}}]
    \draw (0,0)--(1,0);    
\end{tikzpicture}

\section{Non-verbose arrows}

\begin{tikzpicture}
    \draw[quick arrow={at 0.5 tip >}] (0,0) -- (1,0);
    \draw[quick arrow=at 1 tip latex] (0,0.2) -- (1,0.2);
\end{tikzpicture}

\begin{tikzpicture}[
        very thick,
        every path/.style={quick arrow=at 0.5 tip >}]
    \draw (-4,0)--(4,0);
    \draw (4,0)--(4,2);
    \draw (4,2)--(-4,2);
    \draw (-4,2)--(-4,0);
\end{tikzpicture}


\section{Recover logical coordinates}

\begin{tikzpicture}[x=7cm,y=3cm]
    \coordinate (test) at (0.5,2);
    \xycoords\x\y{\pgfpointanchor{test}{center}}
    \node at (test) {(\pgfmathprintnumber{\x},\pgfmathprintnumber{\y})};
\end{tikzpicture}

\begin{tikzpicture}[x={(2cm,1cm)},y={(5cm,1cm)}]
    \coordinate (test) at (5,2);
    \xycoords\x\y{\pgfpointanchor{test}{center}}
    \node at (test) {(\pgfmathprintnumber{\x},\pgfmathprintnumber{\y})};
\end{tikzpicture}
\end{document}