1

This may be a very stupid question, but it is driving me crazy.

I have three tcolorbox linked by arrows. The second line of boxes are in a minipage environment, and I want one flushleft and one in the center below the first box.

This is my code:

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

\begin{minipage}{.5\linewidth}
\begin{flushleft} 
\begin{tcolorbox}[enhanced, overlay, width=1.3in, halign = flush center, remember as=pm]
Procédés\\ Métallurgiques
\end{tcolorbox}
\end{flushleft} 
\end{minipage}%
\begin{minipage}{.3\linewidth}
\begin{tcolorbox}[enhanced, overlay, width=1.8in, halign = flush center, remember as=adm]
Analyse des matériaux
\end{tcolorbox}
\end{minipage} 

\end{center}

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

But i get something like this: enter image description here

enter image description here

EDIT: To be honest I am trying to redo this chart for a project, in a more stylised manner. But since I'm new to tikz and tcolorbox, it's no super easy: enter image description here

  • The problem is to small offset for arrows, see my answer below. – Zarko Feb 5 '16 at 3:13
1
Your `tikzpicures` replace width:

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

and you will get:

enter image description here

I wonder, why you draw this image on so complicated way, directly in TikZ it would be far more simple and under "control":

\documentclass{article}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning}
    \usepackage[many]{tcolorbox}

    \begin{document}
\begin{tikzpicture}[
    node distance = 5mm and -3mm,
mynode/.style = {draw=gray, ultra thick, fill=gray!20,
                 rounded corners, align=center,
                 minimum height= 12mm, inner sep=2mm,
                 text width = #1},
 arrow/.style = {draw=red!75!black, line width=1mm, 
                 -{Triangle[]}  }
                          ]   
\node (ci)  [mynode=1.5in]      {Circuit Imprimé};
\node (pm)  [mynode=1.3in,
             below  left=of ci] {Procédés\\ Métallurgiques};
\node (adm) [mynode=1.3in,
             below right=of ci] {Analyse\\ des Matériaux};
%
\draw[arrow] (ci.east) -- +(5,0) |- (adm);
\draw[arrow] (adm) -- (pm);
\end{tikzpicture}
    \end{document}

which gives:

enter image description here

As can you see, above solution no need minipages, content of tcolorbox-es you is written into node, node are positioned relatively to each other. Distance is controlled by node distance. Only car is to determine ofset of arrow between nodes ci and adm.

Note, at first images I didn't use utf8 coding, so some letters are missing.

  • Hey Zarko, thanks for the answer, but that wasn't my actual issue. Its the boxes. Maybe cause I didn't screenshot the whole page it's hard to see. But the 'Circuit imprimé' box is centered on the page. I want the 'Analyse des matériaux' to be just below it, centered too and the 'Procédé Metallurgique' to be flushleft (there is a lot of blank space left to that box). I'll add another screenshot. But thanks for your simpler solution with tikz, i'm quite new with tcolorbox and tikz – Dorian Kartalovski Feb 5 '16 at 3:51
  • Added image in your question even more convinced me, that you need to draw image! The left border of this image is depend on how it is included into your text. If it should start at left border of text, than don't use center environment! Added picture shows (as I see) , decision tree. See texample.net for more examples, how to do this. Anyway, in the first part of my answer I provide solution for your temporary way of drawing picture. Withit, I'm sure so, your original wuestion is solved. For new images, I suggest you ask a new question. – Zarko Feb 5 '16 at 5:32

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.