I am drawing an arrow with text above it  \documentclass[tikz]{standalone}  \usetikzlibrary{decorations.text} \begin{document} \begin{tikzpicture} \draw[&lt;-, thick, postaction={decorate, decoration={text along path,text align=center, raise=.7em, text={Process}}}]         (0, 0) to [bend left=60] (5, 0); \end{tikzpicture} \end{document}   The result cuts off the top of the text of the label.    How can I fix the bounding box of the tikzpicture so that it adjusts itself the text of the label? Can I get the decorations to extend the bounding box, the way arrows.meta does for arrows?    I would like the bounding box of the tikzpicture to adjust automatically to the contents of the picture, rather than have to fine tune a fixed value.   If I put the text in its own node, it doesn't get cut off, but then it doesn't follow the path of the arrow.   Of course, I can not raise the text, but then it is too close to the arrow.     The accepted answer  has nothing to do with my problem, since the arrows.meta package doesn't change the bounding box for decorations. The other answers to that question suggest adding margins, but I do not want to have to fine tune the margin parameter (and then have to change it again, if I move the arrow decoration).
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}
83733
I simplified this example from , however what I am looking is an "L" shaped arrow that curves when it gets to the same height as A which can be seen in the below figure. The red curve is the one that I want.    Here is the code that I have right now for the black arrow.  \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}   \node[anchor=east] at (0,0) (text) {A};   \node[anchor=west] at (5,5) (description) {B};   \draw (description) edge[out=180,in=0,-&gt;] (text); \end{tikzpicture} \end{document}
5165
It seems that the commands \xrightarrow, etc. in mathtools package don't allow me to put text above or below two arrows (\rightrightarrows). Is there any way to do this with extensible arrows? A crude way would be  \overset{b}{\underset{a}{\rightrightarrows}}   but the arrows are not extensible. For that matter, it also doesn't support \twoheadrightarrow, etc.
64539
The output from the following script \documentclass{article} \usepackage{tikz} \usepackage{graphicx} \begin{document} \begin{tikzpicture}   \node(title)[text width = 0.25\textwidth, text height = 3 cm, draw]{title};   \end{tikzpicture} \end{document}  is  How can I vertically align the text in the node? Specifying the text depth as in \node(title)[text width = 0.25\textwidth, text height = 1cm, text depth = 1 cm, draw]{     title line 1\\     title line 2\\     title line 3};  Does not result in the text being vertically centred.
58221
I have the following diagram:  \documentclass{article} \usepackage{amsmath,amsfonts,graphicx} \usepackage{algpseudocode} \usepackage{tikz, nth} \usetikzlibrary{arrows.meta,decorations,decorations.pathreplacing,calc,bending,positioning, chains}  \begin{document} \begin{tikzpicture}[scale=0.6]         \draw[thick,]  (0,8) -- (0,0) node[left] {0};         \draw[thick,]  (0,0) -- (8,0) node[right] {8};         \draw[thick,]  (8,8) -- (8,0) node[left] {};         \draw[thick,]  (8,8) -- (0,8) node[left] {8};          \draw[thick,]  (4,0) -- (4,8) node[left] {};          \fill (1, 4) circle[radius=2.5pt] node[below]{$A$};         \fill (2, 6) circle[radius=2.5pt] node[below]{$B$};         \fill (3, 2) circle[radius=2.5pt] node[below]{$C$};         \fill (4, 8) circle[radius=2.5pt] node[below]{$D$};         \fill (7, 3) circle[radius=2.5pt] node[below]{$E$};         \fill (6, 1) circle[radius=2.5pt] node[below]{$F$};         \fill (5, 7) circle[radius=2.5pt] node[below]{$G$};         \fill (3, 8) circle[radius=2.5pt] node[below]{$H$}; \end{tikzpicture} \end{document}   How can I position the caption of the node $D$ both below and left, so that the line doesn't obscure the caption?
115185
This seems like it should be really easy but I can't seem to find it anywhere...  I'd like to be able to fine-tune the positioning of a node label.  I'm aware of the \node[label=above/below/etc:{label}] (x) {}; syntax, but that doesn't seem to give you many options on where the label goes. I'd like to be able to place the label slightly closer or farther away, or maybe in a direction other than the 8 presets available.  \tikz[label distance=x] isn't a good solution because I need it to be node-specific.
52993
This question is kind of the opposite of . Is it posisble to clip a path but let the line caps lokk as the path would end at the clipping area.  basic example  \documentclass[border=10mm]{standalone}  \usepackage{tikz}  \tikzset{line/.style={blue,line width=10mm}}  \begin{document} \begin{tikzpicture}     \draw (0,0) grid (5,5);     \clip (0,0) rectangle (5,5);     \draw [line] (0,1)  -- (5,4); \end{tikzpicture} \end{document}   With the output    but the desired output is    I want to clip a plot in this way and I cannot specify it in a way that the domain equals the clip box, so I must use a clip box, but I don’t want to loose the regular line caps …  more realistic example  Case 1: I want to set the yrange of the two plots according to the y axis, but gnuplot writes all data points to the table file, even if they are out of range (they are marked with an o in a third column, whereas i indicates that the point is in range). It is possible to set xrange in a way that the plots start at the same y value but this is a lot of try and error, since the xrange mus be found individual for every plot.  Case 2: I got a curve that is define by some points an the first and the last of them must be roots, i.e. y = 0. The problem is that the second root lies out of the axes bounds … I guess I could use the (coord)!pos!(coord) syntax but this is try and error again to let this curve end at the same x value as the plots.  \documentclass[border=10mm]{standalone}  \usepackage{tikz}  \tikzset{line/.style={blue,line width=10mm}}  \begin{document} \begin{tikzpicture}     \def\yzoom{50}% needed to prevent overflow     % Axes     \draw [&lt;-&gt;] (0,0.07*\yzoom) |- (10.5,0);     % Clip     \clip (0,0) rectangle (10,0.07*\yzoom); % CASE I     % Plots     \draw [line width=2pt,line cap=round]         plot [smooth,raw gnuplot, id=\jobname-plot] function {%             set xrange [1.4:10];             set yrange [0:0.06*\yzoom];             set samples 100;             f(x) = \yzoom*(0.26/(x-1) - 1/(x**2));             plot f(x);         };     \draw [line width=2pt,line cap=round]         plot [smooth,raw gnuplot, id=\jobname-plot] function {%             set xrange [1:10];             set yrange [0:0.06*\yzoom];             set samples 100;             f(x) = \yzoom*(0.28/(x-1) - 1/(x**2));             plot f(x);         }; % CASE II     % Curve, defined by three points.     % P1 and P3 must have y=0     \draw plot coordinates {(2,0) (5,2) (18,0)}; \end{tikzpicture} \end{document}   Unclipped output:    Clipped output but the round caps are missing …
82752
My simple question is how to set some text using tikz in a column e.g.  +---+ | A | | B | | C | +---+   I do not want to rotate the text so I can not use the rotate option or the set text along path method. Can give me a hint how to do it right?
13004
I'm trying to incorporate tikz nodes within running text, but have them align nicely with the text surrounding them. My MWE is:  % !TEX program = xelatex  \documentclass{scrbook}  \usepackage{tikz}  \begin{document}  Some text \tikz \node[rectangle,rounded corners=0.5mm,text=white,fill=black!65,inner sep=2pt] {\scriptsize{}foo}; more text.  \end{document}   This produces:    I would like to shift the node down so that the baseline of "foo" aligns with the baseline of the surrounding text. There's quite a bit of information on aligning relative to other nodes, but really all I need to do is shift it down vertically by a set amount, but I can't figure out how.  What is the easiest/best way for me to shift the entire node down so that baselines align?
76468
How do you draw natural transformation arrows as mentioned in this  but using TikZ rather than xy? More generally, is it possible to draw edges between edge labels, from an edge label to a node, and from a node to an edge label or is it necessary to explicitly construct a node in order to draw an edge? Does providing an edge label in the path environment implicitly construct a node that can be used as the source and target of another edge? I would like to do this using the matrix and path environments in TikZ if possible.  Example:  \documentclass{article}  \usepackage{tikz} \usetikzlibrary{matrix,arrows}  \begin{tikzpicture}[description/.style={fill=white,inner sep=2pt}]     \matrix (m) [matrix of math nodes, row sep=3em,     column sep=2.0em, text height=1.5ex, text depth=0.25ex]     { \mathcal{D} &amp; &amp; \mathcal{J} \\       \mathcal{C} &amp; &amp; \\ };     \path[-&gt;,font=\scriptsize]     (m-1-1) edge[loop left] node[auto] {$ F \circ G $} (m-1-1)     (m-1-1.20) edge node[auto] {$ G $} (m-1-3.160)     (m-1-3.200) edge node[auto] {$ F $} (m-1-1.340)     (m-1-1) edge node[left] {$ H $} (m-2-1);     \end{tikzpicture}  \end{document}     How can I connect F◦G and H with a curved natural transformation arrow ⟹? Feel free to rearrange the diagram if you'd like.
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!
63436
I'm trying to draw arrows with / marks and numbers like in the following picture:    My current solution looks like this:  \begin{tikzpicture}     [         inverter/.style={rectangle,draw,inner sep=2pt,minimum size=6mm},         dot/.style={circle,inner sep=0pt,minimum size=0.5mm,draw,fill=black}     ]     \node (x) at (0,0) {$x$};     \node (delta) at (1,0) [shape=rectangle,draw,minimum height=18mm,minimum width=6mm] {$\delta$};      \node(ah)     at ( 2,  0.5) [inverter] {$a_h$};     \node(al)     at ( 2, -0.5) [inverter] {$a_l$};      \draw [-&gt;] (x) -- (delta);      \draw [-&gt;,dashed,dash pattern=on 1pt off 1pt] (delta.58.75) -- (ah);     \node at ($ (ah) - (0.55, 0) $) {\scriptsize /};     \node at ($ (ah) - (0.5, 0.2) $) {\tiny 4};     \draw [-&gt;,dashed,dash pattern=on 1pt off 1pt] (delta.-58.75) -- (al);     \node at ($ (al) - (0.55, 0) $) {\scriptsize /};     \node at ($ (al) - (0.5, 0.2) $) {\tiny 4}; \end{tikzpicture}   which is pretty hacky and doesn't look nice. I tried strike out shapes but found the line to be much too long. However, positioning a / and a number manually seems like a pretty bad solution to me. I've seen a similar question that revolved around striking out lines or arrows, but without any numbering. Any input would be most welcome.
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
107943
I've looked to another example but struggle to adapt it to my needs. Tikz is new to me.    \begin{center}   \begin{tikzpicture}[every edge/.style={shorten &lt;=1pt, shorten &gt;=1pt}]   \draw (0,0)  node [below] {0} -- (1,0) node [below] {1};   % draw the tick marks   \coordinate (p) at (0,2pt);   \foreach \myprop/\mytext [count=\n] in {0.06/$p_1$,0.06/$p_2$,0.06/$p_3$,0.06/$p_4$,0.06/$p_5$,0.15/$p_6$,0.13/$p_7$,0.14/$p_8$,0.15/$p_9$,0.13/$p_10$}   \draw [decorate,decoration={brace,amplitude=2}] (p)  edge [draw] +(0,-4pt) -- ++(\myprop,0) coordinate (p) node [midway, above=2pt, anchor=south] {\mytext} ;   \path (1,2pt) edge [draw]  ++(0,-4pt); \end{tikzpicture} \end{center}     Latex squeeze all the values together instead of spreading them over the 0 to 1 axis.
44248
I would like to show, in my latex document, some in-text arrows similar to the ones in the attached figure. I know about the \leftrightarrow and \updownarrow commands, but I don't know how to combine them, nor how to rotate them. Is tikz necessary to achieve this?    Any help will be much appreciated.  EDIT: I clarify better, I'm sorry if my question was unclear. I would like to avoid math mode (but it's not important) and tikz as well (to avoid loading too many packages), but having a look around it seems that tikz is necessary to do it. In the end, I'd like to have something like A \to B but with the symbols I described.  For future reference, my question would be similar to .
11686
The following is my MWE, inspired from the answer to  (where my query seemed to merit a separate question, so here it is!):  \documentclass{article} \usepackage{caption} \usepackage{amsmath} \usepackage{pgf,tikz} \usetikzlibrary{arrows,shapes,calc,intersections,through,backgrounds}  \begin{document} \begin{figure}[b]    \begin{tikzpicture}[line cap=round,line join=round,&gt;=triangle 45,x=1cm,y=1cm]                   % More stuff here - not relevant I think...    \end{tikzpicture}    \caption{\label{q}\leavevmode\\\begin{minipage}{\linewidth}          \begin{align*}             a &amp;= b \\ c &amp;= d          \end{align*}       \end{minipage}    } \end{figure} \end{document}   With the above, I'm getting the following error:  ! Argument of \@caption has an extra }. &lt;inserted text&gt;                 \par l.19    }   I'm not sure how to debug this!
105338
I want to reproduce the following figure with tikz (because there is a typo in the text in this figure).   My tikz code is (borrowed from )  \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{decorations.text} \definecolor{mygray}{RGB}{208,208,208} \definecolor{mymagenta}{RGB}{226,0,116} \newcommand*{\mytextstyle}{\sffamily\Large\bfseries\color{black!85}} \newcommand{\arcarrow}[3]{%    % inner radius, middle radius, outer radius, start angle,    % end angle, tip protusion angle, options, text    \pgfmathsetmacro{\rin}{1.7}    \pgfmathsetmacro{\rmid}{2.2}    \pgfmathsetmacro{\rout}{2.7}    \pgfmathsetmacro{\astart}{#1}    \pgfmathsetmacro{\aend}{#2}    \pgfmathsetmacro{\atip}{5}    \fill[mygray, very thick] (\astart+\atip:\rin)                          arc (\astart+\atip:\aend:\rin)       -- (\aend-\atip:\rmid)       -- (\aend:\rout)   arc (\aend:\astart+\atip:\rout)       -- (\astart:\rmid) -- cycle;    \path[       decoration = {          text along path,          text = {|\mytextstyle|#3},          text align = {align = center},          raise = -1.0ex       },       decorate    ](\astart+\atip:\rmid) arc (\astart+\atip:\aend+\atip:\rmid); }  \begin{document}  \begin{tikzpicture}    \fill[even odd rule, mymagenta] circle (1.5);     \node at (0,0) [       font  = \mytextstyle,       color = white,       align = center    ]{       Learn\\       $6\sigma$    };     \arcarrow{ 85}{3}{Define}    \arcarrow{290}{357}{Measure}    \arcarrow{210}{289}{Analyze}    \arcarrow{206}{146}{Improve}    \arcarrow{130}{96}{Control}  \end{tikzpicture}  \end{document}   and the output is     I need hints to get my figure more close the original one. Thanks