I want to draw a framebox
around a TikZ picture. But it won't compile. I try makebox
instead of framebox
, but the problem persists.
Here is a MWE. pdflatex
will raise Undefined control sequence \pgf@matrix@last@nextcell@options
.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\makebox{%
\begin{tikzpicture}
\matrix (m) [matrix of nodes] {
text & text \\
};
\end{tikzpicture}%
}
\end{document}
Thanks for the answers. They look as good but I can only accept one answer.
Problems with similar nature can be found here
- tikz matrix undefined control sequence
- Problem with defining shortcuts for TikZ matrices (Thanks @js-bibra)
The later explains why &
causes the trouble.