I am new to TikZ, and this is probably regarded as do-my-homework-for-me question. I'd like to draw a diagram like this:
First I need the very basic help on the segments themselves. I have tried nodes with a tabular environment:
\documentclass{standalone}
\usepackage{tikz,tabularx}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node {
\begin{tabularx}{4cm}{|X|X|}
\hline
\multicolumn{2}{|c|}{foo} \\
\hline
prev \hfill & \hfill next \\
\hline
\multicolumn{2}{|c|}{type: local\_par} \\
\multicolumn{2}{|c|}{width: 20pt} \\
\hline
\end{tabularx}
};
\end{tikzpicture}
\end{document}
which comes close, but has a drawbacks:
- I have the feeling that this is not the right way to go
- I don't know how to make the line go from the "next" field to the next table. (Or the prev field of the previous table) as I don't know the position
- The width of the table should be "minimum n points but stretch if needed".
Ultimately I'd like to have the arrows start in the field (next to the entry "prev","next" and "list"), similar to this example:
Best Answer