2

I am trying to make a small chart and drawing arrows between tcolorbox, using tikz and the 'remember as' tool.

My code is this

    \begin{center}
\begin{tcolorbox}[enhanced, overlay, width=1.5in, halign = flush center, remember as=ci]
Circuit Imprimé
\end{tcolorbox}

\begin{tcolorbox}[enhanced, overlay, width=2in, halign = flush center, remember as=adm]
Analyse des matériaux
\end{tcolorbox}
\end{center}

\begin{tikzpicture}[overlay,remember picture,line width=1mm,draw=red!75!black]
\draw[->] (ci.east) to (adm.east);
\end{tikzpicture}

I get this enter image description here

But you guess that it's not good, and I want to have an arrow that goes horizontal right, the down, then horizontal left (hope it's easy to picture or I'll draw one on paint if you want)

Thanks

EDIT: I managed to give it a specific path using this:

\begin{tikzpicture}[overlay,remember picture,line width=1mm,draw=red!75!black]
\draw[->] (ci.east) -- ++(1,0) -- ++(0,-1.5) -- (adm.east);
\end{tikzpicture}

which gives me this enter image description here

But 2 problems: the first is I want put the 'y' value so that the last part of the arrow will be horizontal, right now I am just guessing the values of the trajectory. Secondly, is it possible to round the angles of the arrow, sharp angles don't look very good.

Thanks

1

I'm without a computer at the moment, but try this:

\draw[->, rounded corners] (ci.east) -- ++(1.5,0)  |- (adm.east);

You can change the roundness like rounded corners=3mm, or more.

  • Hey that's really cool, it works great. Can I just ask you what does the command "|-" does? – Dorian Kartalovski Feb 5 '16 at 2:24
  • @Dorian it's a TikZ operator. It draws a vertical line first and a horizontal line after that stopping perpendicular at the last node or coordinate and then drawing the path to it. – Alenanno Feb 5 '16 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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