0

I have a problem with my paths in tikz, as I try to show in the picture : enter image description here

By using my path as -| or |- I can obtain the two green paths, but I would like to have the red one, and neither |-| or || are defined.

Here is my code

\documentclass{article}
\usepackage{tikz}

\tikzstyle{block4} = [rectangle, draw, fill=cyan!8, text width=6cm, text centered, rounded corners, minimum height=4em]
\tikzstyle{through} = [rectangle, fill=white, text width=6cm, text centered, rounded corners, minimum height=4em]
\tikzstyle{block5} = [rectangle, draw, fill=yellow!8, text width=6.5cm, text centered, rounded corners, minimum height=4em]
\tikzstyle{block6} = [rectangle, draw, fill=green!8, text width=6cm, text centered, rounded corners, minimum height=4em]
\tikzstyle{block7} = [rectangle, draw, fill=blue!8, text width=6cm, text centered, rounded corners, minimum height=4em]

\begin{tikzpicture}[node distance = 2cm, auto]
\centering
% Place nodes
\node [block4] (Foyer) 
        {\emph{table foyer.foyer} \\
        \begin{itemize}
        \item sous-table par département
        \item suppression doublons
        \end{itemize}
        };

\node [block4, right of=Foyer, node distance=7cm] (Pote) 
        {\emph{table pote.dep} \\
        \begin{itemize}
        \item  choix anrev correct
        \item  doublons dirindic
        \end{itemize}
        };


\path (Foyer) -- (Pote) node[through, pos=.5,below=1cm] (Merge1) 
        {\textbf{Fusion par dirindik}
        };


\node [block5, right of=Merge1, node distance=14cm] (Indrev) 
        {\emph{table foyer.indrev}
        \\ \begin{itemize}
        \item détermine, via MDS, âge, persfipd
            \begin{itemize}
            \item dirindik(N-1)
                \begin{itemize}
                \item valeur
                \item "inconnu anprec"
                \end{itemize}
            \item persfip(N-1)
            \end{itemize}
        \end{itemize}};


\node [block4, below of=Merge1, node distance=1.5cm] (FoyerPote) 
        {\emph{table Travail.FoyerPoteDEP} \\
        \begin{itemize}
        \item  on empile chaque département
        \end{itemize} 
        \emph{table Travail.FoyerPoteFR}
        };

\node [block7, below of=FoyerPote, node distance=2.5cm] (IRFoyer) 
        {\emph{table Travail.FoyerPote nationale} \\
        \begin{itemize}
        \item  On récupère les variables idoines
            \begin{itemize}
            \item les MDS année précédente
            \item l'impôt
            \item les var pour REVDISP(N)
            \end{itemize}
        \end{itemize} 
        }; 

\path (Merge1) -- (Indrev) node[through, pos=.5,below=6cm] (Merge2) 
        {\textbf{Fusion par dirindik}
        };

\node [block6, below of=Merge2, node distance=1.5cm] (IndivPote) 
        {\emph{table Travail.FoyerPote par dep} \\
        \begin{itemize}
        \item  on empile
        \end{itemize} 
        \emph{table Travail.FoyerPote nationale}
        };        


% Draw edges
\path [line] (Foyer)  -|  (FoyerPote);
\path [line] (Pote) -| (FoyerPote);
\path [line] (FoyerPote) -- (IRFoyer);
\path [line] (IRFoyer) -| (IndivPote);
\path [line] (Indrev) -| (IndivPote);

\end{tikzpicture}
\end{document}
  • 1
    Have you tried the following: for the first vertical line (the most top one) of the red path, go until Indrev|-IRFoyer, then the next point is FoyerPote-|IndivPote I think... – henry Oct 03 '14 at 14:08
  • First thanks, I did not know one can mention a path to be a reference for another path. Tex and Tikz keep being magic

    Second, the first instruction works, but not the other one, I am trying to figuer it out

    – Anthony Martin Oct 03 '14 at 14:32
  • 1
    (Indrev|-IRFoyer) -| (IndivPote); works.

    Not yet sure I have figured why, but it does

    – Anthony Martin Oct 03 '14 at 14:44
  • See this very clever answer http://tex.stackexchange.com/questions/45347/vertical-and-horizontal-lines-in-pgf-tikz/110172#110172 – Thomas F. Sturm Oct 03 '14 at 14:44
  • I am fully aware of what you mean. :) I suggest defining the whole set of coordinates beforehand. Go to page 162 in the TikZ manual (either type "pgfmanual.pdf" into your OS's finder/dash/search windows or in the terminal, write texdoc tikz) and check out this line: \draw (1,0) coordinate (first point) -- (3,2) coordinate (second point);. So you now could write: \draw (ABC-|DEF) coordinate (myPointName);. You could make it a list as well, with line breaks for clarity. – henry Oct 03 '14 at 14:44
  • If you include the calc library you could define halfway points as, for example, ($(Foyer)!.5!(Pote)$). – John Kormylo Oct 03 '14 at 15:01
  • try this answers: http://tex.stackexchange.com/questions/45347/vertical-and-horizontal-lines-in-pgf-tikz/45805#45805 – rpapa Oct 03 '14 at 19:03

0 Answers0