\usepackage{tikz} \newcommand\tikzmark[2]{% \tikz[remember picture,overlay,baseline=0pt]  \node[inner sep=0pt,outer sep=0pt, anchor=base] (#1){#2};% }  \newcommand\link[2]{% \begin{tikzpicture}[remember picture, overlay, &gt;=stealth, shorten &gt;= 10pt, shorten &lt;=10pt]   \draw[-&gt;] (#1.south east) to (#2.north west); \end{tikzpicture}% }   \begin{table}[htbp] \renewcommand{\arraystretch}{1} \setlength{\tabcolsep}{10pt} \centering \begin{tabular}{m{0.2in} | m{0.2in} m{0.2in} m{0.2in} m{0.2in} m{0.2in} m{0.2in} m{0.2in} m{0.2in} m{0.2in}}     \hline     &amp; A  &amp; B   &amp; C       &amp; B       &amp; B       &amp; B       &amp; D  &amp; C  &amp; E \\     \hline  C  &amp; 0   &amp; 0  &amp; \tikzmark{13}{\bf{1}}  &amp; 0       &amp; 0       &amp; 0       &amp; 0  &amp; 1  &amp; 0 \\   B  &amp; 0   &amp; 1  &amp; 0       &amp; \tikzmark{12}{\bf{2}}  &amp; \tikzmark{22}{\bf{1}}  &amp; 1       &amp; 0  &amp; 0  &amp; 0 \\   B  &amp; 0   &amp; 1  &amp; 0       &amp; 1       &amp; \tikzmark{11}{\bf{3}}  &amp; \tikzmark{21}{\bf{2}}  &amp; 0  &amp; 0  &amp; 0 \\   C  &amp; 0   &amp; 0  &amp; 1  &amp; 0  &amp; 0  &amp; 0  &amp; 0  &amp; 1  &amp; 0 \\   E  &amp; 0   &amp; 0  &amp; 0  &amp; 0  &amp; 0  &amp; 0  &amp; 0  &amp; 0  &amp; 1 \\    \hline \end{tabular}  \captionsetup{justification=centering}  \caption{All local alignment scoring matrix}  \label{table:all_local} \end{table}  \link{11}{12} \link{12}{13} \link{21}{22}
33689
How to draw such arrows in the table?
96095
I have a small problem with the TikZ \foreach loop whenever the list, over which we loop, is defined my a macro. The following code example will show my problem:  \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tikz}  \begin{document} Picture one:  \begin{tikzpicture} \foreach \x/\y in {1.0/2.0, 3.0/4.0} \node[draw] at (\x,\y) {\x--\y}; \end{tikzpicture}  Picture two:  \newcommand{\mymacro}{1.0/2.0, 3.0/4.0} \begin{tikzpicture} \foreach \x/\y in {\mymacro} \node[draw] at (\x,\y) {\x--\y}; \end{tikzpicture} \end{document}   The expected result is that both images should look the same. But in the second image, I only get one node - and both \x and \y are each time expanded to 1.0/2.0, 3.0/4.0. I hope someone can help.
115563
Why does this example only partially work?  \documentclass{minimal} \usepackage{etex} \usepackage{tikz} \usetikzlibrary{shapes,calc,arrows,trees,positioning,through,intersections,fadings} \begin{document}     \begin{tikzpicture}[scale=0.5] \coordinate (a) at (0,0); \coordinate (b) at (6,0); \coordinate (c) at (9,6); \node(A)[label=$A$] at (a) {$\bullet$}; \node(B)[label=50:$B$] at (b)  {$\bullet$}; \node(C)[label=$C$] at (c) {$\bullet$}; \draw[thick] (a)--(b)--(c)--cycle; %           \node(c1) at (a)[draw,circle through=(b)] {}; %           \coordinate(ac) at(intersection 1 of c1 and a--c); %            %           \node(c2) at (ac)[draw,circle through=(b)] {}; %           \node(c3) at (b)[draw,circle through=(ac)] {}; %           \coordinate(bta) at(intersection 1 of c2 and c3 ); %           \node(xx)[label=$C$] at (bta) {$\bullet$}; %       \coordinate(bisa) at(intersection 1 of a--bta and b--c); %       \draw (a)--(bisa); %%%%%%%%%%%%%%%%%%%%%%%%%%% work %%%%%%%%%%%%%%%%%%         \node(c4) at (b)[draw,circle through=(a)] {};             \coordinate(bc) at(intersection 1 of c4 and b--c);             \node(xx)[label=$prova$] at (bc) {$\bullet$};             \node(c5) at (bc)[draw,circle through=(a)] {};             \node(c6) at (a)[draw,circle through=(bc)] {};             \coordinate(btb) at(intersection 1 of c5 and c6 );         \node(xx)[label=$prova$] at (btb) {$\bullet$};         \coordinate(bisb) at(intersection 1 of b--btb and a--c);         \draw (b)--(bisb); %%%%%%%%%%%%%%%%%%%%%%%%%%% work %%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% it doesn't work%%%%%%%%%%%%%%%%%% \node(c7) at (c)[draw,circle through=(b)] {}; \coordinate(ac) at(intersection 2 of c7 and a--c); \node(xx)[label=$prova2$] at (ac) {$\bullet$}; %%%%%%%%%%%%%%%%%%%%%%%%%%% it doesn't work %%%%%%%%%%%%%%%%%%  \end{tikzpicture} \end{document}
74588
I want to plot this graph, but I don't know how to code the words in the nodes.     Here is my code:  \documentclass{article} \usepackage{amsmath} \usepackage{titletoc} \usepackage{tikz} \usetikzlibrary{trees,positioning,fit}  \begin{document}{\allowdisplaybreaks[4]}  \tikzstyle{bag} = [text width=2em, text centered] \tikzstyle{end} = []  \begin{center} \begin{tikzpicture}[sloped] \node (a) at ( 0,0) [bag] {$\ln r_0$}; \node (b1) at ( 3,1.5) [bag] {$\ln r_{10} + \sigma_1\sqrt{\Delta t_1}$}; \node (b2) at ( 3,-1.5) [bag] {$\ln r_{10}$}; \node (c1) at ( 6,3) [bag] {$\ln r_{20} + 2\sigma_2\sqrt{\Delta t_2}$}; \node (c2) at ( 6,1.5) [bag] {$\textrm{Mean} = \ln r_{20} + \dfrac{3}{2}\sigma_2\sqrt{\Delta t_2}$\\$\textrm{Mean Change} = \mu_{11}\Delta t_2 = \ln\dfrac{r_{20}}{r_{10}} + \dfrac{3}{2}\sigma_2\sqrt{\Delta t_2} - \sigma_1\sqrt{\Delta t_1}$}; \node (c3) at ( 6,0) [bag] {$\ln r_{20} + \sigma_2\sqrt{\Delta t_2}$}; \node (c4) at ( 6,-1.5) [bag] {$\textrm{Mean} = \ln r_{20} + \dfrac{3}{2}\sigma_2\sqrt{\Delta t_2}$\\$\textrm{Mean Change} = \mu_{11}\Delta t_2 = \ln\dfrac{r_{20}}{r_{10}} + \dfrac{3}{2}\sigma_2\sqrt{\Delta t_2} - \sigma_1\sqrt{\Delta t_1}$}; \node (c5) at ( 6,-3) [bag] {$\ln r_{20}$}; \draw [-&gt;] (a) to node [below] {} (b1); \draw [-&gt;] (a) to node [above] {} (b2); \draw [-&gt;] (b1) to node [below] {} (c1); \draw [-&gt;] (b1) to node [below] {} (c2); \draw [-&gt;] (b1) to node [below] {} (c3); \draw [-&gt;] (b2) to node [below] {} (c3); \draw [-&gt;] (b2) to node [below] {} (c4); \draw [-&gt;] (b2) to node [below] {} (c5); \end{tikzpicture} \end{center}  \end{document}       Update code use  \draw [-&gt;] (a) to node [below] {} (b1.south east); \draw [-&gt;] (a) to node [above] {} (b2.north east); \draw [-&gt;] (b1.south east) to node [below] {} (c1.west); \draw [-&gt;] (b1.south east) to node [below] {} (c2.west); \draw [-&gt;] (b1.south east) to node [below] {} (c3.west); \draw [-&gt;] (b2.north east) to node [below] {} (c3.west); \draw [-&gt;] (b2.north east) to node [below] {} (c4.west); \draw [-&gt;] (b2.north east) to node [below] {} (c5.west);
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.
96687
I want to draw a cuboid in another transparent cuboid with TikZ. Therefore I've created a \newcommand to draw a cuboid.  \documentclass[11pt, halfparskip]{scrartcl} \usepackage{ucs} \usepackage[utf8x]{inputenc} \usepackage{tikz}  \begin{document} \newcommand{\cuboid}[7]{     % bottom     \draw[#7] (#1, #2, #3) -- ++(#4, 0, 0) -- ++(0, 0, #6) -- ++(-#4, 0, 0) -- cycle;     % back     \draw[#7] (#1, #2, #3) -- ++(#4, 0, 0) -- ++(0, #5, 0) -- ++(-#4, 0, 0) -- cycle;     % left     \draw[#7] (#1, #2, #3) -- ++(0, 0, #6) -- ++(0, #5, 0) -- ++(0, 0, -#6) -- cycle;     % right     \draw[#7] (#1+#4, #2, #3) -- ++(0, 0, #6) -- ++(0, #5, 0) -- ++(0, 0, -#6) -- cycle;     % front     \draw[#7] (#1, #2, #3+#6) -- ++(#4, 0, 0) -- ++(0, #5, 0) -- ++(-#4, 0, 0) -- cycle;     % top     \draw[#7] (#1, #2+#5, #3) -- ++(#4, 0, 0) -- ++(0, 0, #6) -- ++(-#4, 0, 0) -- cycle; } \begin{tikzpicture}   \tikzstyle{bottomfill} = [thick, fill=lightgray, fill opacity=.5] \tikzstyle{camerafill} = [thick, fill=blue!20]  \cuboid{0}{0}{0}{4}{4}{4}{bottomfill} \cuboid{1}{1}{1}{1}{1}{1}{camerafill}  \draw[-&gt;, thick] (2, 1.5, 1.5) -- ++(4, 0, 0);  \end{tikzpicture} \end{document}   But the result looks strange (The inner cuboid seems to be outside the transparent cuboid; compare the cuboid and and the arrow of the second image)    The result looks right if I'm adding the planes in the right z-order (but that's exhausting)  \documentclass[11pt, halfparskip]{scrartcl} \usepackage{ucs} \usepackage[utf8x]{inputenc} \usepackage{tikz}  \begin{document} \begin{tikzpicture} \tikzstyle{bottomfill} = [thick, fill=lightgray, fill opacity=.5] \tikzstyle{camerafill} = [thick, fill=blue!20]  % 1 bottom \draw[bottomfill] (0, 0, 0) -- ++(4, 0, 0) -- ++(0, 0, 4) -- ++(-4, 0, 0) -- cycle; % 1 back \draw[bottomfill] (0, 0, 0) -- ++(4, 0, 0) -- ++(0, 4, 0) -- ++(-4, 0, 0) -- cycle; % 1 left \draw[bottomfill] (0, 0, 0) -- ++(0, 0, 4) -- ++(0, 4, 0) -- ++(0, 0, -4) -- cycle;  % 2 bottom \draw[camerafill] (1, 1, 1) -- ++(1, 0, 0) -- ++(0, 0, 1) -- ++(-1, 0, 0) -- cycle; % 2 back \draw[camerafill] (1, 1, 1) -- ++(1, 0, 0) -- ++(0, 1, 0) -- ++(-1, 0, 0) -- cycle; % 2 left \draw[camerafill] (1, 1, 1) -- ++(0, 0, 1) -- ++(0, 1, 0) -- ++(0, 0, -1) -- cycle; % 2 right \draw[camerafill] (1+1, 1, 1) -- ++(0, 0, 1) -- ++(0, 1, 0) -- ++(0, 0, -1) -- cycle; % 2 front \draw[camerafill] (1, 1, 1+1) -- ++(1, 0, 0) -- ++(0, 1, 0) -- ++(-1, 0, 0) -- cycle; % 2 top \draw[camerafill] (1, 1+1, 1) -- ++(1, 0, 0) -- ++(0, 0, 1) -- ++(-1, 0, 0) -- cycle;  \draw[thick] (2, 1.5, 1.5) -- ++(2, 0, 0);  % 1 right \draw[bottomfill] (0+4, 0, 0) -- ++(0, 0, 4) -- ++(0, 4, 0) -- ++(0, 0, -4) -- cycle; % 1 front \draw[bottomfill] (0, 0, 0+4) -- ++(4, 0, 0) -- ++(0, 4, 0) -- ++(-4, 0, 0) -- cycle; % 1 top \draw[bottomfill] (0, 0+4, 0) -- ++(4, 0, 0) -- ++(0, 0, 4) -- ++(-4, 0, 0) -- cycle;  \draw[-&gt;, thick] (4, 1.5, 1.5) -- ++(2, 0, 0); \end{tikzpicture} \end{document}   With the result    My question: is there a possibility in TikZ to draw an object in a transparent object with without adding the shapes in the right z-order?
108627
I am just starting to learn using Tikz and am a little lost within its seemingly infinite amount of options and possibilities.  What I am trying to do is visualize a few Matlab function interaction (which one calls which one, what is the in- and output). Since there are only about six subroutines, I place each one manually as a node. This is an example:  \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,positioning}  \begin{document}  \begin{tikzpicture}[auto] \node           [rounded rectangle,draw]        (node1)     {Node 1}; \coordinate [above=of node1]                                (input); \node           [rounded rectangle,draw]    at  (-10:6cm) (node2)       {Node 2}; \draw           [-&gt;,very thick]             ([xshift=0.1cm]  input.south)  --                  node {right}                ([xshift=0.1cm]  node1.north); \draw           [-&gt;,very thick]             ([xshift=-0.1cm] node1.north) --                  node {left}                 ([xshift=-0.1cm] input.south); \draw                                            (node1) -- (node2);  \end{tikzpicture}  \end{document}     Now I would like to apply these double in/out arrows I (probably pretty awkwardly) created using xshift to all node connections, so in this example also for the connection between Node 1 and Node 2. Ideally, the space between these two arrows would be the same, independant of their angle and they would nicely connect to the outer line of the nodes. Any idea how I could achieve this? Similar questions I have found only used rectangle and orthogonal lines.
1787
When I draw an edge between two nodes with anchors and globally set option [-&gt;], I get an additional arrow tip symbol at the beginning of the last edge in the path. For example in  \documentclass{article} \usepackage{tikz}  \begin{document} \begin{tikzpicture}     \node (A) at (0,0) {$A$};     \node (B) at (1,0) {$B$};      \draw[-&gt;] (A.north east) edge (B.north west);      \draw (A.south east) edge[-&gt;] (B.south west); \end{tikzpicture} \end{document}   the first \draw command produces incorrect output, while the second produces correct output:    Am I doing something wrong, or is this a bug in TikZ?
21033
I wish I knew how to draw the this commutative diagram with the TikZ package.    I would also like to know how to put subtitles in the diagram.
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?
21164
I want to create a table with arrows between some cells, for which I've used  and TkiZ. I have the following problems:  Text in cells aligned vertically to the center and at the same heigh (TikZ nodes are not inline with normal cells text in a same row). Inability to align to the center with \begin{center}•\end{center}. I don't know how to fix the size of the cells.  This is what I currently have: Code \documentclass{article} \usepackage{tabularx} \usepackage{tikz} \tikzset{every picture/.style={remember picture}} \begin{document} \begin{tabularx}{\textwidth}{r|c|c|c|c|l}     &amp;$D_1$&amp;$D_2$&amp;$D_3$&amp;$D_4$&amp;foo\\ \cline{1-6}     $O_1$&amp;\tikz[baseline]{\node (a11) {50};}&amp;\tikz[baseline]{\node (a12) {0};}&amp;&amp;&amp;50\\[2em] \cline{1-6}     $O_2$&amp;&amp;\tikz[baseline]{\node (a22) {60};}&amp;&amp;&amp;60\\[2em] \cline{1-6}     $O_3$&amp;&amp;\tikz[baseline]{\node (a32) {10};}&amp;\tikz[baseline]{\node (a33) {30};}&amp;\tikz[baseline]{\node (a34) {10};}&amp;50\\[2em] \cline{1-6}     $O_4$&amp;&amp;&amp;&amp;\tikz[baseline]{\node (a44) {50};}&amp;50\\[2em] \cline{1-6}     bar&amp;50&amp;70&amp;30&amp;60&amp;210\\ \end{tabularx} \begin{tikzpicture}[overlay]     \path[thick,-&gt;] (a11) edge (a12);     \path[thick,-&gt;] (a12) edge (a22);     \path[thick,-&gt;] (a22) edge (a32);     \path[thick,-&gt;] (a32) edge (a33);     \path[thick,-&gt;] (a33) edge (a34);     \path[thick,-&gt;] (a34) edge (a44); \end{tikzpicture} \end{document}   Besides, I get the following warnings:  Underfull \hbox (badness 10000) in alignment at lines 13--13 Overfull \hbox (15.0pt too wide) in paragraph at lines 13--22
59314
I've been trying to use relative coordinates to make my drawings more precise but it seems I don't know how the command \node works since I've been having this problem while connecting a circuit element to another:    I'm trying to eliminate the blank between the two wires.  This is the minimal code:  \documentclass{book} \usepackage[siunitx,RPvoltages]{circuitikz} %Circuit Schematics/Diagram \usetikzlibrary{arrows,shapes,calc,positioning} \begin{document}     \begin{circuitikz}             \path (0,0) coordinate (C);             % Comparatore             \path (C) + (0,-1) + (1,0) coordinate (com) node[above]{};             \path (com) + (1.5,-1) node[op amp] (comp) {};             % Collegamenti Comparatore             \node (G1) at ([shift=({-1.3cm,0cm})]comp.-) {};             \draw (G1) -- (comp.-);             \node (G2) at ([shift=({-1.3cm,0cm})]comp.+) {};             \draw (G2) -- (comp.+);             \draw (C) -- (G1); % Collegamento Rettificatore - Comparatore         \end{circuitikz} \end{document}   Thanks for any help!
74537
I have found a strange behavior in TikZ. When using the \draw ... to ... syntax and trying to place nodes along the line with the node[...]{...} syntax, the nodes do not turn up at the expected location.  \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}   \draw(0,0) to[out=60,in=120] (1,0) node[midway]{x}; \end{tikzpicture} \end{document}     How is this done properly?
101980
\begin{tikzpicture}[shorten &gt;=1pt,node distance=3cm,on grid,auto]   \node[state,initial]   (q_1,q_4)    {$q_1$,$q_4$};   \node[state]           (q_2,q_5) [right=of (q_1,q_4)] {$q_2$,$q_5$};   \node[state,accepting]           (q_3,q_6) [right=of (q_2,q_5)] {$q_3$,$q_6$};   \node[state]           (q_3,q_7) [right=of (q_3,q_6)] {$q_3$,$q_7$};   \node[state]           (q_2,q_4) [below=of (q_1,q_4)] {$q_2$,$q_4$};   \node[state,accepting]           (q_3,q_5) [below=of (q_2,q_4)] {$q_3$,$q_5$};   \node[state,accepting]           (q_3,q_4) [below=of (q_3,q_6)] {$q_3$,$q_4$};    \path[-&gt;] (q_1,q_4) edge        [bend right=30]    node[above][align=center] {a} (q_2,q_5)                       edge     node {b} (q_2,q_4)             (q_2,q_5) edge      [bend left=30]       node[below] {b} (q_1,q_4)                       edge  [bend right=30] node[above] {a} (q_3,q_6)             (q_3,q_6) edge  [bend right=30]    node[text width=1cm,align=center] {a} (q_3,q_7)                       edge  node [align=center] {b} (q_3,q_4)             (q_3,q_4) edge [bend left=30]node[below][align=left] {a} (q_3,q_5)                       edge [loop above] node[text width=1cm,align=center] {b} (q_3,q_4)             (q_3,q_5) edge node {a}(q_3,q_6)                        edge node {b} (q_3,q_4)             (q_2,q_4) edge [bend left=30] node[below] {b} (q_1,q_4)                       edge node {a} (q_3,q_5)             (q_3,q_7) edge [loop above] node[above][text width=1cm,align=center] {a,b} (q_3,q_7);                  \end{tikzpicture}\\
18322
I have the following image    that was created with this code:  \documentclass[varwidth=true, border=2pt]{standalone} \usepackage{tikz} \usepackage{tkz-euclide}  \begin{document} \usetkzobj{all} \begin{tikzpicture}     \tkzSetUpPoint[shape=circle,size=10,color=black,fill=black]     \tkzSetUpLine[line width=1]     \tkzDefPoints{0/0/A, 3/0/B', 2/2/C, 4/4/C'}     \tkzDefLine[parallel=through C](B',C') \tkzGetPoint{Phelper}     \tkzInterLL(A,B')(C,Phelper) \tkzGetPoint{B}     \tkzDrawLine[add=0 and 0.2](A,B')     \tkzDrawLine[add=0 and 0.2](A,C')     \tkzDrawSegment(B',C')      \node at ($(A)+(-0.1,-0.2)$)  {$A$};     \node at ($(B')+(0.2,-0.2)$)  {$B'$};     \node at ($(C')+(0,0.4)$)  {$C'$};     \node at ($(B)+(0.2,-0.2)$)  {$B$};     \node at ($(C)+(0.28,0.5)$)  {$C$};     \tkzDrawPolygon[ultra thick,color=blue,fill=blue!20](A,B',C')      \tkzDrawPolygon[line width=0.3pt,color=red,fill=red!20](A,B,C)      \tkzDrawPoints(A,B',C',B,C)     \tkzLabelSegment[below,red](A,B){$c$}     \tkzLabelSegment[left,red](A,C){$b$}     \tkzLabelSegment[right,red](B,C){$a$}     \tkzLabelSegment[below,blue,pos=0.8](A,B'){$c'$}     \tkzLabelSegment[left,blue,pos=0.8](A,C'){$b'$}     \tkzLabelSegment[right,blue](B',C'){$a'$} \end{tikzpicture} \end{document}   As you might notice, the space above C' is bigger than necessary. This is because of Phelper. I need Phelper for the construction, but it should not influence the image size in any way. I've tried to get Phelper closer to C, but that seems not to be possible.  How can I stop defined (but not visible) points from influencing image size?  Please note: I wrap code like this in a figure. So images like the one above are only a part of the whole document. So working with standalone does not solve my problem.
72387
TeX Code  \documentclass{standalone} \usepackage{tikz}  \begin{document}  \begin{tikzpicture}    \coordinate (A) at (0, 0);   \coordinate (B) at (2, 3);    \node[draw,minimum width=10mm] at (A) {};   \node[draw,minimum width=10mm] at (B) {}; \end{tikzpicture}  \end{document}   How such path can be drawn using Tikz?
100396
Background and desired functionality  Rectangles can be drawn with tikz in a number of ways, one way of doing so is to define a rectangle node as follows:  \node (rectangle) [draw, rectangle] {A rectangle}; % Strictly speaking, rectangle is not needed in the [] as nodes are rectangular by default   A useful feature of this is that, as a node, it has anchor points around it such as rectangle.north, rectangle.south west and so on.  Another way is to draw a rectangle path, like this:  \draw (0,0) rectangle (3,2);   I would like to be able to use this second path-based method* but also be able to have (some) named anchors on the path.  Approach from the time of asking  MWE:  The method I had for this is demonstrated by the following MWE (inspired by  and later improved by ):  \documentclass{report}  \usepackage{tikz}  \begin{document}  \begin{tikzpicture}      \draw         (0,0)             coordinate [xshift=-{0.5\pgflinewidth},yshift=-{0.5\pgflinewidth}] (rectangle south west)         rectangle             coordinate (rectangle center)         (3,2)             coordinate [xshift={0.5\pgflinewidth},yshift={0.5\pgflinewidth}] (rectangle north east)         edge [draw=none]             coordinate (rectangle north)         (rectangle north east -| rectangle south west)     ;  \end{tikzpicture}  \end{document}   Obviously this only defines anchors for center, north, north east, and south west, but it can be fairly easily extended to provide south, east, west, north west and south east (as demonstrated in ).  Caveat:  As pointed out by Andrew Stacey in , there was a slight discrepancy between the positioning of these pseudo-anchor coordinates and the anchors on a normal rectangular node. The edge-based solution above originally placed the pseudo-anchors exactly on the coordinates of the rectangle whereas on a rectangular node they would be placed at the outside edge of the lines of the rectangle. Although this was only likely to cause issues with thick line widths I have now added some x/yshifting to the above code to compensate.  The following image shows the difference in anchor positioning between standard node rectangles, the original edge-based solution (without x/yshifting) and the above (revised) edge-based solution (with x/yshifting). The line widths for the lower pictures are set to 0.5cm.    Node rectangle labelling code to illustrate the key to the colours (and for the generally curious):  % styling yoinked from Altermundus' answer \tikzset{dot/.style={circle,fill=#1,inner sep=0,minimum size=4pt}} \node [dot=red] at (rectangle.south west) {}; \node [dot=blue] at (rectangle.center) {}; \node [dot=purple] at (rectangle.north east) {}; \node [dot=green] at (rectangle.north) {}; \node [dot=orange] at (rectangle.north west) {}; \node [dot=yellow] at (rectangle.south) {}; \node [dot=brown] at (rectangle.south east) {}; \node [dot=black] at (rectangle.east) {}; \node [dot=pink] at (rectangle.west) {};   Back to the question  Is there a neater/better way to establish node-anchor-like points on a rectangle path* than the method given in the MWE above?  * = An equivalent drawing method that also allows specifying a rectangle by corner coordinates would be more than acceptable!