How could I produce such an image in code?    I'd also like to draw vector arrows by the end of the lines, in order to see the order of the calculations. I saw a TikZ solution on other answer that didn't work for me. Not only the code gave me an error, it's not fully what I want (I want it to look like a parentheses matrix, and I'd also like to have a convenient macro to produce it with just some few inputs). Here's this partial solution (given by Andrew ) I'm talking about:  Here is a quick hack using a matrix of math nodes and :    Code   \documentclass[border=5mm,tikz]{standalone}  \usepackage{tikz}  \usetikzlibrary{matrix}  \begin{document}      \begin{tikzpicture}[auto]        \matrix (M)[matrix of math nodes,row sep=1cm,column sep=16mm]{         a &amp; b &amp; c &amp; a &amp; b\\ d &amp; e &amp; f &amp; d &amp; e\\ g &amp; h &amp; i &amp; g &amp; h\\&amp;&amp;[blue]adi&amp;[red]-bfg&amp;[blue]cdh\\         };         \draw[blue](M-1-1)--(M-2-2)--(M-3-3)--(M-4-3);         \draw[blue](M-1-2)--(M-2-3)--(M-3-4)--(M-4-4);         \draw[blue](M-1-3)--(M-2-4)--(M-3-5)--(M-4-5);      \end{tikzpicture}  \end{document}   Also, that little product he put just below the lines showing the multiplication results are pretty awesome. Any way to implement it with what I've asked?
50517
Is there a way to create a new command with 9 arguments ({a_{11}},{a_{12}},{a_{13}},{a_{21}},{a_{22}},{a_{23}},{a_{31}},{a_{32}},{a_{33}}) that has as output a matrix with the Sarrus Rule? For instance: to obtain     just use the command that we will call sarrus:  \sarrus{-k}{k-1}{1}{0}{k-1}{k}{2}{0}{1}.   If it is possible i want to use the command sarrus in math mode just like matrix for istance.
123322
I use \draw[|-|] () to (); to draw a few intervals.  I expect that each interval is rendered like |----| (see the 2nd and the 3rd intervals in the figure below).  However, the top and the bottom intervals below show only a half of their endpoint lines (i.e., |).  Why are these endpoint lines (|) not shown completely? How to show them?        \documentclass{standalone} \usepackage{tikz}  \begin{document} \begin{tikzpicture}   \draw[|-|, red] (0,0) to (1,0);   \draw[|-|, red, dashed] (0,1) to (1,1);   \draw[|-|, blue, dashed] (0,2) to (1,2);   \draw[|-|, blue] (0,3) to (1,3); \end{tikzpicture} \end{document}
33169
I'm looking to create something like this in Tikz environment. Any tips? help?
58979
\documentclass[border=10pt]{standalone} \usepackage{pstricks-add,amsmath,amssymb} \begin{document} \begin{pspicture}[showgrid,arrowinset=0](0,-1)(4,2) \begin{psmatrix}[colsep=.5cm,rowsep=1.2cm] &amp; [name=A]\,\,\,\,\,\,\,\,\,\,\,\,$M_{0,4} \times \mathbb{P}^1 $\\ [name=B]$B$ &amp; [name=C]\,\,\,\,\,\,$M_{0,4}$ \end{psmatrix} \pcline[nodesep=.3]{-&gt;}(B)(C)       \nbput{$\kappa$} \pcline[nodesep=.3]{-&gt;}(A)(C)       \nbput[labelsep=.1]{$\pi$} \naput{\foreach \i in {0.1,0.25,0.4,0.55}{%     \pcline{-&gt;}(\i,-.4)(\i,.45)} \nbput[labelsep=.1]{$\sigma_i$}} \end{pspicture} \end{document}     After see all the answers, done :)   \documentclass[border=10pt]{standalone} \usepackage{pstricks-add,amsmath,amssymb} \begin{document} \begin{psmatrix}[colsep=.5cm,rowsep=1.2cm] &amp; [name=A]\qquad $M_{0,4} \times \mathbb{P}^1 $\\ [name=B]$B$ &amp; [name=C] \quad $M_{0,4}$ \end{psmatrix} \psset{arrowinset=0} \pcline[nodesep=.3]{-&gt;}(B)(C)       \nbput{$\kappa$} \pcline[nodesep=.3]{-&gt;}(A)(C)       \nbput[labelsep=.1]{$\pi$} \naput{\foreach \i in {0.1,0.25,0.4,0.55}{%     \pcline{-&gt;}(\i,-.4)(\i,.45)} \nbput[labelsep=.1]{$\sigma_i$}} \end{document}
34315
I want to typeset things that     I'm already aware of   Q-circuit, which has nice custom macros for this purpose, but is based on the relatively slow and clunky XyPic TikZ, which I can use to manually set things up (that's how the picture I've hotlinked was drawn)   Are there any other alternatives I should know about?
31219
It's the first time I'm using Tikz on Latex. I have to draw this block diagram (this is a low resolution snip from a paper)   In Tikz I have done this:   That is very similar but I need some adjustments, like the u_i arrow and the node sum after the H(s) block.  Is there anybody that can help me with this?  my code:      \tikzstyle{block} = [draw, fill=white, rectangle,  minimum height=2em, minimum width=3em] \tikzstyle{sum} = [draw, fill=white, circle, radius=1mm, node distance=1.5cm] \tikzstyle{input} = [coordinate] \tikzstyle{output} = [coordinate] \tikzstyle{pinstyle} = [pin edge={to-,thin,black}]  \begin{tikzpicture}[auto, node distance=2cm,&gt;=latex'] \node [input, name=input] {}; \node [input, above of=input](input1) {}; \node [sum, right of=input] (sum) {}; \node [block, right of=sum] (controller) {$K(s)$}; \node [sum, right of=controller] (sum1) {}; \node [block, right of=sum1] (filterinv) {$H^{-1}(s)$}; \node [block, right of=filterinv] (system) {$G(s)$}; \node [output, right of=system] (output) {}; \node [output, above of=output] (output1) {}; \node [block, below of=filterinv] (filter) {$H(s)$}; \node [block, above of=controller] (delay) {$D(s)$}; \node [sum, below of=sum1] (sum2) {};  \draw [-&gt;] (filterinv) -- node[name=u] {$u_{i}$} (system); \draw [draw,-&gt;] (input) -- node {$s_{i-1}$} (sum); \draw [-&gt;] (sum) -- node {$e_{i}$} (controller); \draw [-&gt;] (system) -- node [name=q] {$q_{i}$}(output); \draw [-&gt;] (q) |- (filter); \draw [-&gt;] (filter) -- node {} (sum2); \draw [-&gt;] (controller) -- node {} (sum1); \draw [-&gt;] (sum1) -- node[name=xi] {$\xi_{i}$} (filterinv); \node [input, below of=sum1](input2) {}; \draw [draw,-&gt;] (input2) -- node {$r_{i}$} (sum2); \draw [-&gt;] (sum2) -| node[pos=0.99] {$-$}      node [near end] {$\tilde{s}_i$} (sum); \draw [-&gt;] (delay) -| node[] {}      node [near end] {} (sum1); \draw [draw,-&gt;] (input1) -- node[pos=0.15] {$u_{i-1}$} (delay); \draw [-&gt;] (u) |- node[pos=0.99] {$u_i$}      node [near end] {} (output1);  \end{tikzpicture}
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}
43216
I have the following tikz code  % compilation command: pdflatex --jobname=Diag-f1 Diag.tex \documentclass{book} \usepackage{tikz} \pgfrealjobname{Diag} \begin{document} \beginpgfgraphicnamed{Diag-f1} \begin{tikzpicture}[node distance=3em] \node(G)[rectangle,fill=red!5,draw=red,text width=5cm]{}; \node(H)[below of=G]{H}; \node(H1)[left of=H]{H1}; \node(H2)[right of=H]{H2}; \draw[-&gt;](G.south)-|(H1.north); \draw[-&gt;](G.south)--(H.north); \draw[-&gt;](G.south)-|(H2.north); \end{tikzpicture} \endpgfgraphicnamed \end{document}     but I am not happy with the two arrows going from G.south to H1.north and H2.north. Because of the -| command, there is a spurious horizontal line. How can I achieve the same result without this annoying horizontal line? \draw[-&gt;](G.south)--(H1.north); is not a solution. There are available tricks but I may have missed an obvious solution here.
92305
Asymptote does give 3D arrows when drawing three dimensional figures (they even have shade!). Could we fake it with TikZ? Here's an example, manually written, with just one arrow worked:  \documentclass{scrartcl} \usepackage{tikz} \usetikzlibrary{arrows.meta} \begin{document} \begin{tikzpicture}[-&gt;,scale=2]   \draw[&gt;={Triangle[width=3pt,length=5pt]}] (0,0,0) -- (1,0,0);   \draw[&gt;={Triangle[width=3pt,length=5pt]}] (0,0,0) -- (0,1,0);   \draw[&gt;={Circle[sep=-.9pt,width=3.08pt,length=2pt]Triangle[width=3pt,length=5pt]}] (0,0,0) -- (0,0,1); \end{tikzpicture} \end{document}     But that's (wrongly) manually calculated by trial and error (apart from the fact that it's not perfect, seeing how the other two axis —x and y— are oriented, it should have certain slant). It would be nice to have an interface like the other arrows  &gt;={3D[length=⟨real length⟩,width=⟨real width of the base⟩]}   Which would then calculate from those values (and, of course, also taking into account x=⟨x vect⟩,y=⟨y vect⟩,z=⟨z vect⟩)  Circle[sep=⟨value⟩,width=⟨value⟩,length=⟨value⟩,slant=⟨value⟩] Triangle[width=⟨value⟩,length=⟨value⟩] % And I'm not sure if `slant=⟨value⟩`                                        % is necessary in this Triangle case   Example  Using the code from the answer (thanks to Symbol1), for instance, this code (taking the idea from another question, link in the comments)  \begin{tikzpicture}[x={(0cm,1cm)},                     y={({cos(30)*1cm},{sin(30)*-1cm})},                     z={({cos(20)*1cm},{sin(20)*1cm})},                     thick,                     scale=3]   \pgfmathsetmacro{\ax}{.4}   \pgfmathsetmacro{\ay}{.6}   \pgfmathsetmacro{\az}{-.6}   \pgfmathsetmacro{\bx}{.4}   \pgfmathsetmacro{\by}{-.7}   \pgfmathsetmacro{\bz}{-.8}   \draw[densely dotted,thin] (\ax,\ay,\az) -- (\ax,0,\az);   \draw[densely dotted,thin] (\ax,\ay,\az) -- (0,\ay,\az);   \draw[densely dotted,thin] (\ax,0,0) -- (\ax,0,\az) -- (0,0,\az);   \draw[densely dotted,thin] (0,0,\az) -- (0,\ay,\az) -- (0,\ay,0);   \draw[densely dotted,thin] (\bx,\by,\bz) -- (\bx,0,\bz);   \draw[densely dotted,thin] (\bx,\by,\bz) -- (0,\by,\bz);   \draw[densely dotted,thin] (\bx,0,0) -- (\bx,0,\bz) -- (0,0,\bz);   \draw[densely dotted,thin] (0,0,\bz) -- (0,\by,\bz) -- (0,\by,0);   \draw[-{Cone3}] (0,0,0) -- (1,0,0) node[right] {$x$};   \draw[-{Cone3}] (0,0,0) -- (0,1,0) node[above right] {$y$};   \draw[-{Cone3}] (0,0,0) -- (0,0,1) node[below right] {$z$};   \draw[-{Cone3}] (0,0,0) -- (0,0,-1) node[above left] {$-z$};   \draw[thin] (0,0,0) -- (0,-.9,0);   \draw[-{Cone3}] (0,0,0) -- (\ax,\ay,\az) node[below left] {source};   \draw[-{Cone3}] (0,0,0) -- (\bx,\by,\bz) node[above right] {sim}; \end{tikzpicture}   gives this figure
43678
Building on the answer  by wrtlprnft, I have the following code     \documentclass[tikz,margin=1cm]{standalone}    \usetikzlibrary{decorations.markings}    \begin{document}    \begin{tikzpicture}         \tikzstyle{arrowed double line}=[             dashed, double distance between line centers=3pt,             postaction=decorate,             decoration={                 markings,                 mark=between positions 10pt and -10pt step 20pt with {                     \arrow[thin,yshift= 1.5pt,xshift=.8pt]{&gt;}                     \arrow[thin,yshift=-1.5pt,xshift=.8pt]{&lt;}                 },             },         ]         \draw[arrowed double line] (0,0) --  (1,2);     \end{tikzpicture} \end{document}   which produces this:    I am unhappy with the faint transverse lines between the dashes. I don't even know why tikz decides to draw them.  Is there a way to get rid of them?  Thanks in advance to all replies.  PS the same thing occurs at the caps of double solid lines
112545
I am searching for a way to have a figure drawn using LaTeX. I am aware of some packages TikZ and PSTricks that could accomplish this, and have been tinkering around with them recently but do not have enough skill set at the moment to accomplish this drawing. Is there a way someone can accomplish the drawing, preferably with TikZ but could be any package your most comfortable with in a reduced amount of coding (non-advanced) to where I could understand what is happening from the code to the picture. If this is not possible, then I will have to study the package more and work with it until I understand the method (code) to create the graphic. The drawing is below.  Note: This is a rough sketch. The optimal output would have smooth quadratic curves and all quantities are vectors.
108473
I want to reproduce the shape of the following diagram :   And the closest thing I could manage with the xy package was :  $$ \xymatrix{      &amp;B \ar[r]  &amp; H  \ar[r] &amp; B   \ar[rd]  \\     E'_{n+1} \ar[ru] \ar[r]   &amp;  &amp; E'_{n}    \ar[r] &amp;   E_n  \ar[r]  &amp;  E_{n+1} } $$   which gives    Is it possible to do so with this package?
83438
I'm trying to find the easiest way to draw a 3D cube (it's for my UML diagram) with TikZ. Could you please give an example?   Like this:
76565
I am writing a paper on numerical solutions for ODEs. For the representations of B-series I want to use binary tree-like symbols. I know how to produce them with TiKZ; however, just as in the given picture, i need to use them also within the text or a mathematical expression. As these trees can be represented by a bracket expression, e.g. in the given picture t=[[.,.], [[.]]], it should be possible to write a macro doing this. However, I failed so far - or is there an alternative approach?
61205
I do yet not know everything about coding with tikz but I am learning. I need to draw this system and I would really appreciate it if someone helped me make this.  Now I don't want the structure to be thick I need it to be simple and thin, the exact same structure of lines, arrows, dots and so on like this figure:
63680
I am interested in outputting  this graph in  latex using tikz:    So far I got this:    and my tikz code is   \begin{tikzpicture}     \node[shape=circle,draw=black] (A) at (0,0) {A};     \node[shape=circle,draw=black] (B) at (0,3) {B};     \node[shape=circle,draw=black] (C) at (2.5,4) {C};     \node[shape=circle,draw=black] (D) at (2.5,1) {D};     \node[shape=circle,draw=black] (E) at (2.5,-3) {E};     \node[shape=circle,draw=black] (F) at (5,3) {F} ;      \path [-&gt;] (A) edge node[left] {$5$} (B);     \path [-&gt;](B) edge node[left] {$3$} (C);     \path [-&gt;](A) edge node[left] {$4$} (D);     \path [-&gt;](D) edge node[left] {$3$} (C);     \path [-&gt;](A) edge node[right] {$3$} (E);     \path [-&gt;](D) edge node[left] {$3$} (E);     \path [-&gt;](D) edge node[top] {$3$} (F);     \path [-&gt;](C) edge node[top] {$5$} (F);     \path [-&gt;](E) edge node[right] {$8$} (F);    \end{tikzpicture}   I want to know how to draw the arc between nodes B and E and also thicker  arcs with their lengths in center. Any help is appreciated
51164
I'm trying to write the following matrices.    I used the following code (given by )  \documentclass{article} % Load TikZ \usepackage{tikz} \usetikzlibrary{matrix,decorations.pathreplacing,calc} % Set various styles for the matrices and braces. It might pay off to fiddle around     with the values a little bit  \pgfkeys{tikz/mymatrixenv/.style={decoration=brace,every left delimiter/.style=    {xshift=3pt},every right delimiter/.style={xshift=-3pt}}}  \pgfkeys{tikz/mymatrix/.style={matrix of math nodes,left delimiter=[,right delimiter=    {]},inner sep=2pt,column sep=1em,row sep=0.5em,nodes={inner sep=0pt}}}  \pgfkeys{tikz/mymatrixbrace/.style={decorate,thick}}  \newcommand\mymatrixbraceoffseth{0.5em}  \newcommand\mymatrixbraceoffsetv{0.2em}  % Now the commands to produce the braces. (I'll explain below how to use them.) \newcommand*\mymatrixbraceright[4][m]{ \draw[mymatrixbrace] ($(#1.north west)!(#1-#3-1.south west)!(#1.south west)-    (\mymatrixbraceoffseth,0)$)     -- node[left=2pt] {#4}      ($(#1.north west)!(#1-#2-1.north west)!(#1.south west)-(\mymatrixbraceoffseth,0)$); }  \newcommand*\mymatrixbraceleft[4][m]{  \draw[mymatrixbrace] ($(#1.north east)!(#1-#2-1.north east)!(#1.south east)+    (\mymatrixbraceoffseth,0)$)     -- node[right=2pt] {#4}       ($(#1.north east)!(#1-#3-1.south east)!(#1.south east)+    (\mymatrixbraceoffseth,0)$); } \newcommand*\mymatrixbracetop[4][m]{ \draw[mymatrixbrace] ($(#1.north west)!(#1-1-#2.north west)!(#1.north east)+(0,\mymatrixbraceoffsetv)$)     -- node[above=2pt] {#4}      ($(#1.north west)!(#1-1-#3.north east)!(#1.north east)+(0,\mymatrixbraceoffsetv)$); } \newcommand*\mymatrixbracebottom[4][m]{ \draw[mymatrixbrace] ($(#1.south west)!(#1-1-#3.south east)!(#1.south east)-(0,\mymatrixbraceoffsetv)$)     -- node[below=2pt] {#4}      ($(#1.south west)!(#1-1-#2.south west)!(#1.south east)-(0,\mymatrixbraceoffsetv)$); }  \usepackage{tikz} \usetikzlibrary{matrix,decorations.pathreplacing}  \begin{document}    \[  \begin{tikzpicture}[mymatrixenv]  \matrix[mymatrix] (m)  {     a &amp; b &amp; c &amp; d &amp; e &amp; f \\     g &amp; h &amp; i &amp; j &amp; k &amp; l\\     l &amp; m &amp; n &amp; o &amp; p &amp; o \\     \hline \\     q &amp; r &amp; s &amp; t &amp; u &amp; v \\     w &amp; x &amp; y &amp; z &amp; a &amp; b \\     c &amp; d &amp; e &amp; f &amp; g &amp; h \\   };   \mymatrixbraceright{1}{3}{$E_1$}   \mymatrixbraceright{5}{7}{$E_2$}   \mymatrixbracetop{1}{3}{$E_1$}   \mymatrixbracetop{4}{6}{$E_2$} \end{tikzpicture} \]  \end{document}     It's really nice but still it doesn't serve my purpose. Any help in this regard will be highly appreciated. Thanks