I have the following piece of code.
I want to add text to my nodes by simply adding the text between the ampersand symbols. What is the syntax to do this?
For example I try to add the text "John Doe" in the 1st row of the second column. The text must contain a line break between John and Doe. The usual syntax I would use would be something like:
\node[draw, align = center]{John \\ Doe};
How would do this in a matrix in which I predefined the nodes in the matrice's options?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix(a)[matrix of nodes , nodes in empty cells , nodes = {draw , circle , align = center} ,
column sep={1cm,between origins} , row sep = {1cm , between origins}]
{
& John \ Doe & & \
& & &\
};
\draw[->] (a-1-1) -- (a-2-1);
\end{tikzpicture}
\end{document}

documentenvironment. – samcarter_is_at_topanswers.xyz Jan 17 '24 at 09:35&s? – samcarter_is_at_topanswers.xyz Jan 17 '24 at 09:47