0

I have the following code

 \documentclass[tikz,border=3mm]{standalone}
    \usetikzlibrary{positioning,matrix}
    \begin{document}
    \begin{tikzpicture}[Dotted/.style={% https://tex.stackexchange.com/a/52856/194703
        line width=1.2pt,
        dash pattern=on 0.01\pgflinewidth off #1\pgflinewidth,line cap=round,
        shorten >=0.3em,shorten <=0.3em},
        Dotted/.default=5]
     \matrix[matrix of math nodes,nodes={circle,draw,minimum size=1.5em},
        column sep=2em,row sep=1ex](mat) {
        C_1 & D_1 \\
        C_2 & D_2 \\[2em]
        C_m & D_n \\
     };
     \draw[Dotted] (mat-2-1) -- (mat-3-1);
     \draw[Dotted] (mat-2-2) -- (mat-3-2);
     \foreach \X in {1,2,3}
     {\foreach \Y in {1,2,3}
     {\draw (mat-\X-1) -- (mat-\Y-2);}}
     \matrix[matrix of math nodes,nodes={circle,draw,minimum size=1.5em},
        column sep=1em,below=2em of mat,xshift=2em,
        column 2/.style={column sep=2.5em}](mat2) {
        E_1 & E_2 & E_p\\
     };
     \draw[Dotted] (mat2-1-2) -- (mat2-1-3);
    \end{tikzpicture}

However I want to add a new set of nodes at the end .

The problem is if I use \\ or \newline I cant get the pointer to the next line.

This is how I want the output to occurenter image description here

But I can't go to the new line, can someone please help.

Charlotte
  • 963
  • Isn't this code just the answer you got here? –  Apr 27 '20 at 06:12
  • @Schrödinger'scat; yes but since you said that this site is not a hotline for additional requests and suggested to ask a new question, I did so – Charlotte Apr 27 '20 at 06:16
  • If the original question gets answered, one should accept it instead of adding requests in the comments. If one copies a code from somewhere, it is appropriate to indicate the source of the code. –  Apr 27 '20 at 06:19

1 Answers1

0

Adding a row to the matrix is as simple as adding something of the sort

F_1 & F_2 & F_p\\

Code:

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{positioning,matrix}
\begin{document}
\begin{tikzpicture}[Dotted/.style={% https://tex.stackexchange.com/a/52856/194703
    line width=1.2pt,
    dash pattern=on 0.01\pgflinewidth off #1\pgflinewidth,line cap=round,
    shorten >=0.3em,shorten <=0.3em},
    Dotted/.default=5]
 \matrix[matrix of math nodes,nodes={circle,draw,minimum size=1.5em},
    column sep=2em,row sep=1ex](mat) {
    C_1 & D_1 \\
    C_2 & D_2 \\[2em]
    C_m & D_n \\
 };
 \draw[Dotted] (mat-2-1) -- (mat-3-1);
 \draw[Dotted] (mat-2-2) -- (mat-3-2);
 \foreach \X in {1,2,3}
 {\foreach \Y in {1,2,3}
 {\draw (mat-\X-1) -- (mat-\Y-2);}}
 \matrix[matrix of math nodes,nodes={circle,draw,minimum size=1.5em},
    column sep=1em,row sep=1em,below=2em of mat,xshift=2em,
    column 2/.style={column sep=2.5em}](mat2) {
    E_1 & E_2 & E_p\\
    F_1 & F_2 & F_p\\
 };
 \foreach \X in {1,2}
 {\draw[Dotted] (mat2-\X-2) -- (mat2-\X-3);}
\end{tikzpicture}
\end{document}

enter image description here