Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to create a downward chain of TikZ nodes. Some nodes are rotated and they may differ in height.

Consider the output of the MWE below:

enter image description here

The horizontal chain adapts to the different widths of the nodes, while the downward one doesn't. Might this have anything to do with the rotation? Do you know how I can get the downward chain to prevent intersections of node like the horizontal does?

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains,shapes}
\tikzstyle{arrow}
  = [ shape=single arrow
    , single arrow head extend=.75em
    , single arrow head indent=.25em
    , minimum width=3em
    , draw
    ]
\tikzstyle{rarrow}
  = [ shape=single arrow
    , single arrow head extend=.75em
    , single arrow head indent=.25em
    , minimum width=3em
    , draw
    , rotate=-90
    ]
\begin{document}
    \begin{tikzpicture}[start chain,every node/.style={on chain,join}]
        \node[arrow] {foo};
        \node[arrow] {foo};
        \node[arrow] {foooooooooo};
        \node[arrow] {foo};
    \end{tikzpicture}\\
    \begin{tikzpicture}[start chain=going below,every node/.style={on chain,join}]
        \node[rarrow] {foo};
        \node[rarrow] {foo};
        \node[rarrow] {foooooooooo};
        \node[rarrow] {foo};
    \end{tikzpicture}

\end{document}
share|improve this question

1 Answer 1

up vote 2 down vote accepted

This is quite fast workaround as the tikzpicture environments are independent of each other:

\documentclass{article}
\parindent=0pt
\usepackage{tikz}
\usetikzlibrary{chains,shapes}
\tikzstyle{arrow}
  = [ shape=single arrow
    , single arrow head extend=.75em
    , single arrow head indent=.25em
    , minimum width=3em
    , draw
    ]
\tikzstyle{rarrow}
  = [ shape=single arrow
    , single arrow head extend=.75em
    , single arrow head indent=.25em
    , minimum width=3em
    , draw
    ]
\begin{document}
    \begin{tikzpicture}[start chain,every node/.style={on chain,join}]
        \node[arrow] {foo};
        \node[arrow] {foo};
        \node[arrow] {foooooooooo};
        \node[arrow] {foo};
    \end{tikzpicture}\\
\rotatebox{-90}{%
    \begin{tikzpicture}[start chain,
 every node/.style={on chain,join}]
        \node[rarrow] {foo};
        \node[rarrow] {foo};
        \node[rarrow] {foooooooooo};
        \node[rarrow] {foo};
    \end{tikzpicture}}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.