# TikZ - curly braces end at the same node, but there is a gap

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, ->, >=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!

-

## migrated from stackoverflow.comFeb 12 '13 at 15:30

This question came from our site for professional and enthusiast programmers.

Use coordinates instead of nodes to mark coordinates on your path for later use (all starting with t_k). Use nodes=draw as a option to the TikZ picture to see what nodes do to the placement. –  Qrrbrbirlbel Feb 12 '13 at 15:40

You need to use coordinates instead of nodes to mark coordinates on your path for later use). I added the style draw=green to every node which looks like this:

The dashed line end at the nodes and the right brace also starts at right border of the node. (You could consequently use the .center anchor but coordinates are more comfortable.)

## Code

\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,decorations.pathreplacing}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}[y=1cm, x=1cm, thick, font=\footnotesize]
% axis
\draw[line width=1.2pt, ->, >=latex'](0,0) -- coordinate (x axis) (10,0);

% time points
\draw (3,-4pt) coordinate (t_k)          -- (3,4pt) node[anchor=south] {$t_{k}$};
\draw (5,-4pt) coordinate (t_k_opt)      -- (5,4pt) node[anchor=south] {};
\draw (7,-4pt) coordinate (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) coordinate (t_k_unten) -- (5,-2.5) coordinate (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) coordinate (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}
\end{document}


## Output

-
The differences between a node and a coordinate can also be seen in another answer of mine, although the topic is very much different. –  Qrrbrbirlbel Mar 12 '13 at 1:27