1

In the example below I need all frames to have the same height. How to force the height of each part of the node?

enter image description here

% !TeX encoding = utf8
% % !TeX spellcheck = fr 

\documentclass[border=7pt,10pt]{article}
\usepackage[margin=1cm]{geometry}

\usepackage[utf8]{inputenc}
\usepackage{tikz,ifthen}
\usetikzlibrary{ positioning,calc,shapes.multipart }
\usepackage{multicol}
\usepackage{SIunitx}



\begin{document}

\begin{tikzpicture}[every two node part/.style={red,minimum size=3em}]

\tikzset{cadre/.style={draw, text width=10em,align=center,rectangle split, rectangle split parts=2,minimum height=12em}}
\node[ cadre](mot)
{Moteur triphasé
\nodepart{two}
$C_m$, $\omega_m$\\
Inertie de l'arbre moteur:\\ $J_m=\SI{1.3e-3}{\kilogram\metre^2}$};
\node[right=2em of mot,cadre](redu){Réducteur
\nodepart{two}
rapport de réduction $r=\num{58.6}$\\
Rendement $\eta_r=\num{0.74}$\\
Inertie du réducteur ramené sur l'arbre de sortie\\
$J_{red}=\SI{1.8e-3}{\kilogram\metre^2}$};


\node[right=2em of redu,cadre](tamb){
Tambour
\nodepart{two}
$\omega_T$\\
Inertie du tambour\\
$J_{T}=\SI{1.37}{\kilogram\metre^2}$
};


\node[below=5em of tamb,cadre](cablerolu){
Câble enroulé
\nodepart{two}
Inertie câble enroulé  sur le tambour\\
$J_{C}$
};


\node[left=2em of cablerolu,cadre](cablederolu){
Câble déroulé
\nodepart{two}
Longueur câble déroulé: $\ell_C$\\
Longueur totale:$L_{max}=\SI{200}{\metre}$\\
masse linéique $\rho_L=\SI{0.368}{\kilogram\per\metre}$
};


\node[left=2em of cablederolu,cadre](sonde){
Sonde
\nodepart{two}
Masse: $M_s =\SI{ 5,6}{\kilogram}$\\
Vitesse $v_s$
};

\draw [-latex] (mot) --(redu);
\draw[-latex]  (redu)-- (tamb);
\draw[-latex]  (tamb.east)--++(2em,0)|-(cablerolu);
\draw[-latex] (cablerolu) -- (cablederolu);
\draw [-latex]   (cablederolu) -- (sonde);

\end{tikzpicture}

\end{document}
  • 1
    sorry, this is not possible. you should use two nodes or labels to mine node. – Zarko Sep 25 '18 at 12:27
1

see if the following solution is acceptable for you:

\documentclass[border=7pt,10pt]{article}
\usepackage[margin=1cm]{geometry}
\usepackage{tikz,ifthen}
\usetikzlibrary{calc,
                positioning}
\usepackage{SIunitx}

\begin{document}
    \begin{tikzpicture}[
     node distance = 4mm and 8mm,
every label/.style = {label distance=0pt, draw,
                      text width=10em, text depth=0.3ex,
                      align=center, outer sep=0pt},
      cadre/.style = {draw, minimum height=12em, text width=10em,
                      outer sep=0pt, align=center, text=red,
                      label=above:#1}
                       ]
\node[cadre=Moteur triphasé] (mot)  {$C_m$, $\omega_m$\\
                                     Inertie de l'arbre moteur:\\ $J_m=\SI{1.3e-3}{\kilogram\metre^2}$
                                     };
\node[cadre=Réducteur,
      right=of mot]     (redu)      {rapport de réduction $r=\num{58.6}$\\
                                     Rendement $\eta_r=\num{0.74}$\\
                                     Inertie du réducteur ramené sur l'arbre de sortie\\
                                     $J_{red}=\SI{1.8e-3}{\kilogram\metre^2}$
                                     };
\node[cadre=Tambour,
      right=of redu]        (tamb)      {$\omega_T$\\
                                         Inertie du tambour\\
                                         $J_{T}=\SI{1.37}{\kilogram\metre^2}$
                                        };
\node[cadre=Câble enroulé,
      below=of tamb]    (cablerolu)     {Inertie câble enroulé  sur le tambour\\
                                         $J_{C}$
                                        };
\node[cadre=Câble déroulé,
      left=of cablerolu](cablederolu)   {$\ell_C$\\
                                         Longueur totale:$L_{max}=\SI{200}{\metre}$\\
                                         masse linéique $\rho_L=\SI{0.368}{\kilogram\per\metre}$
                                        };
\node[cadre=Sonde,
      left=of cablederolu]  (sonde)     {Masse: $M_s =\SI{ 5,6}{\kilogram}$\\
                                         Vitesse $v_s$
                                        };
\draw[-latex]   (mot)   edge (redu)
                (redu)  edge (tamb)
                (cablerolu) edge (cablederolu)
                (cablederolu) edge  (sonde)
                (tamb.east)-- ++(2em,0) |-(cablerolu);
    \end{tikzpicture}
\end{document}

enter image description here

  • merci. I did not think about using the labels. But it's still a pity not to have the opportunity to impose the size of the different parts, At first, I had a node in 3 part, it would not have been possible to go through the labels . – rpapa Sep 25 '18 at 13:22
1

Here is a solution based on fit, with which case the texts are top-aligned.

\documentclass[border=7pt,10pt]{article}
\usepackage[margin=1cm]{geometry}

\usepackage[utf8]{inputenc}
\usepackage{tikz,ifthen}
\usetikzlibrary{positioning,calc,shapes.multipart,fit}
\usepackage{multicol}
\usepackage{siunitx}



\begin{document}

\begin{tikzpicture}[every two node part/.style={red,minimum size=3em}]

\tikzset{cadre/.style={text width=10em,align=center,rectangle split, rectangle
split parts=2,minimum height=12em},my fit/.style={draw,inner sep=0pt}}
\node[ cadre](mot)
{Moteur triphasé
\nodepart{two}
$C_m$, $\omega_m$\\
Inertie de l'arbre moteur:\\ $J_m=\SI{1.3e-3}{\kilogram\metre^2}$};
\path ($(mot.north)+(0,-4.2cm)$) coordinate (motaux);
\node[my fit,fit=(mot) (motaux)](fmot){};
%
\node[right=2em of mot.north east,anchor=north west,cadre](redu){Réducteur
\nodepart{two}
rapport de réduction $r=\num{58.6}$\\
Rendement $\eta_r=\num{0.74}$\\
Inertie du réducteur ramené sur l'arbre de sortie\\
$J_{red}=\SI{1.8e-3}{\kilogram\metre^2}$};
\path ($(redu.north)+(0,-4.2cm)$) coordinate (reduaux);
\node[my fit,fit=(redu) (reduaux)](fredu){};
%
\node[right=2em of redu.north east,anchor=north west,cadre](tamb){
Tambour
\nodepart{two}
$\omega_T$\\
Inertie du tambour\\
$J_{T}=\SI{1.37}{\kilogram\metre^2}$
};
\path ($(tamb.north)+(0,-4.2cm)$) coordinate (tambaux);
\node[my fit,fit=(tamb) (tambaux)](ftamb){};
%
\node[below=2em of ftamb,cadre](cablerolu){
Câble enroulé
\nodepart{two}
Inertie câble enroulé  sur le tambour\\
$J_{C}$
};
\path ($(cablerolu.north)+(0,-4.2cm)$) coordinate (cableroluaux);
\node[my fit,fit=(cablerolu) (cableroluaux)](fcablerolu){};
%
\node[left=2em of cablerolu.north west,anchor=north east,cadre](cablederolu){
Câble déroulé
\nodepart{two}
Longueur câble déroulé: $\ell_C$\\
Longueur totale:$L_{max}=\SI{200}{\metre}$\\
masse linéique $\rho_L=\SI{0.368}{\kilogram\per\metre}$
};
\path ($(cablederolu.north)+(0,-4.2cm)$) coordinate (cablederoluaux);
\node[my fit,fit=(cablederolu) (cablederoluaux)](fcablederolu){};
%
\node[left=2em of cablederolu.north west,anchor=north east,cadre](sonde){
Sonde
\nodepart{two}
Masse: $M_s =\SI{ 5,6}{\kilogram}$\\
Vitesse $v_s$
};
\path ($(sonde.north)+(0,-4.2cm)$) coordinate (sondeaux);
\node[my fit,fit=(sonde) (sondeaux)](fsonde){};
%
\draw [-latex] (fmot) --(fredu);
\draw[-latex]  (fredu)-- (ftamb);
\draw[-latex]  (ftamb.east)--++(2em,0)|-(fcablerolu);
\draw[-latex] (fcablerolu) -- (fcablederolu);
\draw [-latex]   (fcablederolu) -- (fsonde);
%
\foreach \X in {mot,redu,tamb,cablerolu,cablederolu,sonde}
{\draw (\X.text split west) --  (\X.text split east);}
\end{tikzpicture}
\end{document}

enter image description here

1

Instead of TikZ you could use a tcbraster with raster equal height option and remember as boxes which will allow to draw arrows between boxes.

% !TeX encoding = utf8
% % !TeX spellcheck = fr 

\documentclass[border=7pt,10pt]{article}
\usepackage[margin=1cm]{geometry}

\usepackage[utf8]{inputenc}
\usepackage[most]{tcolorbox}
\usepackage{SIunitx}

\begin{document}

\begin{tcbitemize}[raster columns=3,
    raster column skip=1cm,
    raster left skip=0pt,
    raster right skip=8mm,
    raster row skip=1cm,
    raster equal height,
    enhanced,
    sharp corners,
    colbacktitle=white,
    coltitle=black,
    center title,
    colback=white,
    colupper=red,
    halign=center,
    remember as=\thetcbrasternum
    ]
    \tcbitem[title=Moteur triphasé] $C_m$, $\omega_m$\\ Inertie de l'arbre moteur:\\ $J_m=\SI{1.3e-3}{\kilogram\metre^2}$

    \tcbitem[title=Réducteur] rapport de réduction $r=\num{58.6}$\\
Rendement $\eta_r=\num{0.74}$\\
Inertie du réducteur ramené sur l'arbre de sortie\\
$J_{red}=\SI{1.8e-3}{\kilogram\metre^2}$

    \tcbitem[title=Tambour] $\omega_T$\\
Inertie du tambour\\$J_{T}=\SI{1.37}{\kilogram\metre^2}$

    \tcbitem[title=Sonde] Masse: $M_s =\SI{ 5,6}{\kilogram}$\\
Vitesse $v_s$

    \tcbitem[title=Câble déroulé] Longueur câble déroulé: $\ell_C$\\
Longueur totale:$L_{max}=\SI{200}{\metre}$\\
masse linéique $\rho_L=\SI{0.368}{\kilogram\per\metre}$

    \tcbitem[title=Câble enroulé] Inertie câble enroulé  sur le tambour\\
$J_{C}$
\end{tcbitemize}

\begin{tikzpicture}[remember picture, overlay, ->]
\draw (1)--(2); 
\draw (2)--(3); 
\draw (3.east)--++(0:5mm)|-(6); 
\draw (6)--(5); 
\draw (5)--(4);
\end{tikzpicture}
\end{document}

enter image description here

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.