How do I get the line break inside a pin node to work in TikZ?  \node[pin={\angle+0.5*\percent*3.6:hi\\there}] at (120:3) {};   I tried align=center but didn't work as a typical node.
122982
I just found the pin option to drawing, and it looks useful in some of the things I want to draw. How do I format it though? I've tried pin=[red]60:{Hey!} and I get the error Cannot parse this coordinate.  \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{shapes,arrows,positioning} \begin{document} \begin{tikzpicture}[node distance=2cm,&gt;=latex, every node/.style={     font=\sffamily\scriptsize     },       circtext/.style={draw,circle,minimum size=8pt,inner sep=2pt},     dot/.style={draw,circle,fill=black,minimum size=0.6mm,inner sep=0pt} ] { \node[rectangle, fill=green!10!white!90!black, minimum width=6cm, minimum height=3cm] at (2,0){}; \node[circtext, fill=yellow](A) at (0,0) {A}; \node[circtext, fill=yellow, right=of A](B){B}; \draw[-&gt;] (A) -- node[dot, pos=0.5, pin=[red]60:{Hey!}](C){}(B); } \end{tikzpicture} \end{document}     The default style looks like it's a gray thin arrow, and I want to change it to a black thin dotted line with no arrow.    update: I figured out how to add style to the pin node:  pin={[red]60:Hey!}]  But I can't figure out how to change the linestyle though.
58460
I was looking for a possibility to adjust the anchor of the text of a pin. Tikz does not allow this out of the box.   This question was already asked on the mailing list , Sept. 2009 without any reply till today or feature addition to pgf/tikz:  \documentclass[tikz]{standalone}  \begin{document}      \begin{tikzpicture}[          every pin/.style={anchor=west},          every pin edge/.style={anchor=west}]          \node [pin=60:test] at (0,1) {};          \node [pin={[anchor=west]60:test}] at (0,0) {};      \end{tikzpicture}  \end{document}   There is also a question with a suggested workaround here on  by defining an aligned pin style consisting of another node positioned at the end of the pin using \tikzlastnode:  \tikzset{     aligned pin/.style args={[#1,#2]#3:#4}{         pin={[inner sep=0pt,%               pin distance=#2,% new option, default = 3ex               label={[append after command={%                     node[inner sep=0pt,%                         xshift=-0.1cm,% modified, default = 0                         at=(\tikzlastnode.#3),%                         anchor=#1,%                     ]{#4}%                 }%             ]center:{}}%         ]#3:{}}%     } }   In this code, I have added a second unnamed option for pin distance within the square brackets.  MWE using the workaround showing the desired result:  \documentclass[tikz]{standalone}  \tikzset{     aligned pin/.style args={[#1,#2]#3:#4}{         pin={[inner sep=0pt,%             pin distance=#2,% new option, default = 3ex             label={[append after command={%                     node[%                         inner sep=0pt,%                         xshift=-0.1cm,% modified, default = 0                         at=(\tikzlastnode.#3),%                         anchor=#1,%                     ]{#4}%                 }%             ]center:{}}%         ]#3:{}}%     } } \begin{document} \tikz[pin distance=15mm, every pin/.style={fill=blue,text=white}] \node [circle,draw,     aligned pin={[west,3ex]0:X-Value},%     aligned pin={[west,3ex]45:Y-Value},%     aligned pin={[west,3ex]90:Z-Value}] {my circle}; \end{document}     I would like to add further options such as pin edge to adjust the style of the edge. Another addition would be xshift to finetune the position of the text (and yshift).  Is it possible to change the workaround to allow named options with default values if not specified?  Usage could look like this (without using necessarily all options):  node[aligned pin={[pin anchor=west,pin distance=1cm,pin edge={thick}]90:{txt}}]{};   If someone is interested in the implementation of the pin feature in tikz see  and do a textsearch for pin.  Update after answer by Qrrbrbirlbel:  To achieve almost the same result as my MWE use following code  % use preamble from Qrrbrbirlbel answer \begin{document}  \begin{tikzpicture}[every pin/.append style=draw, every pin edge/.style={thick}] \node[c] [ pin={[pin anchor=south west,pin edge pin anchor=south west,pin distance=6ex]90:Z-Value}, pin={[pin anchor=west,pin edge pin anchor=west,pin distance=6ex]45:Y-Value}, pin={[pin anchor=west,pin edge pin anchor=west,pin distance=6ex]0:X-Value} ] at (0,0) {}; \end{tikzpicture}  \end{document}     However, I would like to finetune the text positioning using inner sep=0 and a slight shift:  \newlength{\xshiftlength} \setlength{\xshiftlength}{0.5\widthof{Z}}   Following works:  \tikzset{   pin inner xsep/.style={tikz@pin@post/.append style={inner xsep=#1}} }   Apparently xshift cannot be added in the same way. It shifts more than only the text. How could a pin text xshift be added?
101536
I created a timeline with TikZ. The problem is, that there is a little gap between the ends of the braces that end at the same node.    And here is my code:   \begin{tikzpicture}[y=1cm, x=1cm, thick, font=\footnotesize]      % axis   \draw[line width=1.2pt, -&gt;, &gt;=latex'](0,0) -- coordinate (x axis) (10,0);         % time points \draw (3,-4pt) node(t_k){} --      (3,4pt) node[anchor=south] {$t_{k}$}; \draw (5,-4pt) node(t_k_opt) {} --      (5,4pt) node[anchor=south] {};       \draw (7,-4pt) node(t_k_opt_impl) {} --      (7,4pt) node[anchor=south] {$t_{k}+\triangle^{\text{opt}}+\triangle^{\text{impl}}$};   % curly braces \draw[decorate,decoration={brace,amplitude=3pt,mirror}]      (3,-2.5) node(t_k_unten){} --      (5,-2.5) node(t_k_opt_unten){};  \node at (4,-3){$\triangle^{\text{opt}}$}; \draw[decorate,decoration={brace,amplitude=3pt,mirror}]      (t_k_opt_unten) --      (7,-2.5) node(t_k_opt_impl_unten){};  \node at (6,-3){$\triangle^{\text{impl}}$};  % vertical dotted lines \draw[dotted] (t_k)--(t_k_unten); \draw[dotted] (t_k_opt)--(t_k_opt_unten); \draw[dotted] (t_k_opt_impl)--(t_k_opt_impl_unten);  \end{tikzpicture}   I'd be glad, if someone could help!
4406
I would like to have a long title in tikzposter and have tried to introduce a newline within the \title{} command using \\ and \newline but it does not start a new line. In the old tikzposter class I think that long titles were split among several lines by default. I will be glad to know about any workaround for displaying long titles on several lines in the new tikzposter class.
111489
I have trouble defining a node on a path. If the path is described using points and the in/outgoing angle, the node is always at the beginning. If the path is described with control points, it works flawlessly.  In the code below you see that one path correctly has a node about midway, whereas for the second path the node will be placed at the start of the path.  \documentclass[border=5pt]{standalone}  \usepackage[utf8]{inputenc} \usepackage{tikz} \usetikzlibrary{math,calc}  \usepackage{amsmath}  \begin{document} \begin{tikzpicture}     \draw (0,0) .. controls (1,2) and (4,3) .. (5,5)     node [pos=0.5] (mid1) {};     \draw[fill] (mid1) circle (1pt);      \draw (0,0) to[out=90, in=-180]  (5,5)     node [pos=0.5] (mid2) {};     \draw[fill] (mid2) circle (1pt); \end{tikzpicture} \end{document}   I have a path constructed as in the second example, how can a place a node at a specific relative position (2/3 in, say)?  I am also interested why tikz treads the two paths so differently and why "node [pos= ]" works in one of the cases, but not the other.
95450
Here is the minimum working example:  \documentclass{article} \usepackage{tikz} \usepackage{float} \usepackage{listings} \usepackage{color} \usepackage{textcomp} \usetikzlibrary{shapes,positioning} \begin{document} \centering \begin{tikzpicture}   \node[draw] (PersonLocation Graph) {     \begin{minipage}{.85\linewidth} \begin{lstlisting}[language=XML,escapechar=!]   &lt;collection name=PersonLocation BiMap&gt;   &lt;edge&gt;    &lt;ref&gt;//collection[name=Locations]/loc[name=XXYY]   ! \tikz \node[shape=circle,draw](srchead) {H};!   &lt;/ref&gt;   &lt;ref&gt;//collection[name=Persons]/person[id=4564]   ! \tikz \node[shape=circle,draw](deshead) {E};      %(srchead) edge[&lt;-&gt;, bend left] (deshead.south);    !     &lt;/ref&gt;    &lt;/edge&gt;   ...   ...   ...   &lt;/collection&gt; \end{lstlisting} \end{minipage}  }; \end{tikzpicture} \end{document}   I want to draw an edge from node H to E. I tried  using statement srchead) edge[&lt;->, bend left] (deshead.south); (commented out in the code). Thanks in advance for your input.
65190
Is there a way to put $\nLeftarrow$ instead of some arrows in TikZ? Specifically, how do I change it to "B does not imply A" in the following code.  \documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd}[arrows=Rightarrow]    A \arrow[out=30,in=150]{r}{}\arrow{d} &amp; B \arrow[out=210,in=330]{l}{}\arrow{d}  \\    E  \arrow{r}{} &amp; F \end{tikzcd} \end{document}   One very primite way is to do something similar to the following, where at the description part in the middle of the arrow, use \Big\backslash.  \documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzpicture} \matrix (m) [matrix of math nodes, row sep=3em, column sep=3em]              { A &amp; B \\           &amp; C \\ }; \path[-&gt;,font=\scriptsize] (m-1-1) edge node    {$\Big\backslash$} (m-1-2) edge node {$\Big\backslash$} (m-2-2);     \end{tikzpicture}  \end{document}   But then, how do I put a description in the middle of an arrow in the first code?
29311
How do I pass two parameters to a tikz style?  I would like to do something like this:  \begin{tikzpicture}[     transformer/.style={draw, cylinder, gray!80, rotate=90, minimum height=#1, minimum width=#2},   And then, I want to use this style in a node:  \node [transformer{2.3cm}{1cm}] () at (0,0.6) {};
61806
I need to draw a graph where some nodes have the same y-coordinate. I want the text within the nodes on the same y-coordinate to be baseline-aligned. However, the text seems to be aligned by the bottom lines, not the baseline.   Here's what I tried to do:  \documentclass[final,t]{beamer} \mode&lt;presentation&gt; \usepackage{tikz} \usepackage{pgfplots} \tikzstyle{gate2} = [circle,fill=white,draw=black,minimum size=1cm] \begin{document}     \begin{tikzpicture}         \node[gate2] (mu_0) at (0, 0) {$\mu_0$};         \node[gate2, baseline = (mu_0.base)] (Lambda_0) at (2,  0) {$\Lambda_0  $};     \end{tikzpicture} \end{document}   What I see is that the shapes are at the same y-coordinate (as expected), but mu is higher than Lambda. How do I specify that mu and Lambda should be on the baseline?
78071
I have the following drawn with TikZ    using the code  \documentclass{article} \usepackage{tikz} \usepackage{tkz-euclide} \usetkzobj{all} \begin{document} \begin{tikzpicture} \coordinate (O) at (0,0); \draw (O) circle (3); \coordinate[label = above left:$M$] (M) at (130:3); \coordinate[label = above:$N$] (N) at (80:3); \coordinate[label = below:$A$] (A) at (240:3); \coordinate[label =below right:$B$] (B) at (300:3); \draw (A) -- (M) -- (B); \draw (A) -- (N) -- (B); \tkzMarkAngle[draw = black, fill = white, opacity=1](A,M,B) \tkzLabelAngle[pos = 0.8](A,M,B){$x$} \tkzMarkAngle[pos = 0.2,draw = black, fill = white, opacity=1](A,N,B) \tkzLabelAngle [pos=0.8](A,N,B){$27 ^{\circ}$} \end{tikzpicture} \end{document}   Notice however, tht the 27 degrees does not fit in very nicely. How can I adapt the code to try and move the 27 a bit "lower" so that it fits in better, as well as the angle mark?  Also, how can I get two "double arrows" in the middle of lines AM and BN, to indicate that they are 'parallel'?
78744
I'm a recent convert to TikZ from xy-pic, and am still trying to get a hang for it. I see that one can add labels to the end of arrows and the like using \node. Is there a way to add an arbitrary piece of text at a given position in the text, regardless of whether there is a shape there, a line there, or nothing at all? Thanks very much for your insight.
64041
Can someone please explain me why the following code doesn't result in a fill?  And why, sometimes, I get such "very thin lines" artifact (that's visibile in my picture)?  \begin{tikzpicture} \node (A) at (0,0) {A}; \node (B) at (1,0) {B}; \node (C) at (1,1) {C}; \fill[red] (A) -- (B) -- (C) --cycle; \end{tikzpicture}   Here's what I get:
118159
I am trying to plot a graph using tikz, but I can't seem to be able to highlight the areas between the curves. The result should look something like this:    This is the code I have so far:     \begin{center} \begin{tikzpicture}[scale=0.8]  \draw[-&gt;] (0,-0.5) -- (0,4.5) node[anchor=east] {}; \draw[-&gt;] (-0.5,0) -- (9,0) node[anchor=north] {}; \draw   (1,-0.2) node[anchor=north] {$a$}         (8,-0.2) node[anchor=north] {$b$}                ; \filldraw[fill=black!10](1,0)--(1,2)--(8,2)--(8,0); \draw [](1,3) parabola bend (2.5,1.5)(4.2,2.4);  \draw [](4.2,2.4) parabola bend (5.5,3)(8,0);  \draw[] (1,0)--(1,3); \end{tikzpicture} \end{center}   The end result I would like to achieve is to have C and D higlighted in orange, while A and B in a dark grey. Don't worry about the axes labels or else, I mostly need help with the shading.  Thanks in advance!!
78480
Inside a TikZ node, one can force line breaks using \\ providing the align option of the node is set.  I would like to increase the line spacing inside a node. This can be done in the usual way with the optional parameter of \\, e.g. \\[1em]. Doing this for every line break is tedious though. Is there a way to increase the break globally, so that any \\ inside a node acts as \\[1em]?  EDIT: Almost there!  \documentclass{article}  \usepackage{tikz} \usetikzlibrary{shapes}  \begin{document}  \tikzset{   mynode/.style={     draw   , align=center   , execute at begin node=\setlength{\baselineskip}{2em}   } }  \begin{tikzpicture}   \node[mynode] {     this \\     is \\     \tikz \node[mynode] {a \\ break};   }; \end{tikzpicture}  \end{document}   This produces:    The remaining question is how to place a 2em break before the inner node.
46629
I need to draw this kind of simple sequency diagram, but I'm not very good with TikZ:    \begin{figure}[!ht] \begin{center} \begin{tikzpicture}[node distance=2cm,auto,&gt;=stealth']     \node[] (server) {server};     \node[left = of server] (client) {client};     \node[below of=server, node distance=5cm] (server_ground) {};     \node[below of=client, node distance=5cm] (client_ground) {};     %     \draw (client) -- (client_ground);     \draw (server) -- (server_ground);     \draw[-&gt;] ([yshift=-1cm]client.south) -- ([yshift=-1cm]server.south);     \draw[-&gt;] ([yshift=-1.5cm]server.south) -- ([yshift=-1.5cm]client.south); \end{tikzpicture}   I also want the lines to be straight and have text over them.
52064
When I draw a thick line from the corner of one box to the same corner of another, it doesn't attach properly. See the code and picture below:    \documentclass[a4paper, 11pt]{article}  \usepackage{tikz} \usetikzlibrary{shapes,arrows} \usetikzlibrary{positioning}    \begin{document} \begin{tikzpicture}   \node [draw, thick, minimum size=1cm] (a) {A};   \node [draw, thick, minimum size=3cm, right=2cm of a] (b) {B};    \draw [thick, dashed] (a.north west) -- (b.north west);   \draw [thick, dashed] (a.north east) -- (b.north east);   \draw [thick, dashed] (a.south west) -- (b.south west);   \draw [thick, dashed] (a.south east) -- (b.south east); \end{tikzpicture} \end{document}   How do I make the lines attach exactly to the corners and not slightly off as in this example?
18164
I am currently learning how to use TikZ/PGF to make some figures for a project report, and so I have a question:     Is there is a practical way of making a particular object into a node?   The object I have in mind is shown in the Figure below. I want the object to consist in the big circle, the two circular arcs, the label and anchors at north, south, east and west. The dotted lines are simply there to indicate that I am going to have paths going out of these points, which is why I need the anchors there.     I include the source, in the case that it is useful to anyone.  \begin{tikzpicture} \draw[help lines, gray, dotted] (-2,-2) grid (2,2);  \begin{scope}[shift={ (0,0) } ]     \begin{scope}[rotate=90]         \draw[thick] (-1,0) arc[start angle=-90, delta angle=90, %                               x radius=1, y radius=1] -- (0,1) %NW                      (0,-1) arc[start angle=180, delta angle=-90, %                                    x radius=1, y radius=1] -- (1,0); %SE         \draw[gray] (0,0) circle (1);     \end{scope} % Anchor replacements     \node(N1)       at (0,1)    {};     \node(S1)       at (0,-1)   {};     \node(E1)       at (1,0)    {};     \node(W1)       at (-1,0)   {}; % Label     \node(Crossing number) at (0,0) {1}; \end{scope}  \path[thick, gray, dotted] [ out=90,   in=270]     (N1.center) edge (0,2) [ out=180,  in=0]       (W1.center) edge (-2,0) [ out=270,  in=90]      (S1.center) edge (0,-2) [ out=360,  in=180]     (E1.center) edge (2,0); \end{tikzpicture}   PS. I have had a look at the Manual, but I could not find a description of how to do this.