In this MWE of a flowchart, it doesn't compile when \chainin
command is used and I need to understand the following:
align=center
doesn't center the content of the node, for example,(m-2-1)
.- How can I break the line inside any of the matrix nodes since using
\\
makes the compilation run for a long time? - How can I join between
(m-3-1)
and(m-1-2)
in such a way that the join goes to the right until the midway, then vertically to the left of(m-1-2)
then right? - When using
\chainin
command, I got an error:Undefined control sequence. \chainin
despite loadingchains
library.
I already drew this flowchart without chains
, but I need to know if it is possible with it or not.
\RequirePackage{luatex85}
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,chains, positioning,matrix,shapes}
\begin{document}
\begin{tikzpicture}[
every node/.style={draw,rectangle,align=center},
every join/.style=latex,
join
]
\matrix (m) [matrix of nodes,column sep=5mm,row sep=5mm]{
{1\\new line} & 4\\
2 & 5\\
3 & 6\\
};
{ [start chain]
\chainin (m-1-1);
\chainin (m-2-1);
\chainin (m-3-1);
\chainin (m-1-2);
\chainin (m-2-2);
\chainin (m-3-2);
}
\end{tikzpicture}
\end{document}
Best Answer
The problem with the
Undefined control sequence
is that you're missing one library:As far as I'm aware of, It's not mentioned in the manual but I've seen this issue before.
As for your issue (3), I think it's best that you draw that line separately and break the chain into two. At least because I don't know how to modify the
\chainin
path operator...MWE:
I also have in the MWE used a different method for making the line break inside the matrix environment (issue 2). As said so in the manual one can use nested nodes, so since every matrix cell is a node we can use a
\node
inside that node, and since we already have the styleevery node
set toalign=center
, that node is already center aligned and therefore there will be no need for specifying atext width
. Though I do not know why the keyalign=center
does not work inside\matrix
, perhaps a bug...