我创建了一个包含 tikz 节点矩阵的 \newcommand。问题是,当矩阵只有一列时,一切都正常。当它有两列或更多列时,它会停止编译。我觉得自己很蠢,我的错误在哪里?以下是列表
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\tikzset{tabmatrix/.style = {matrix of nodes,
nodes in empty cells,
row sep=-\pgflinewidth,
column sep=-\pgflinewidth}}
\newcommand{\mycommand}{%
$\vcenter{\begin{tikzpicture}[baseline=(current bounding box.west)]\footnotesize
\matrix [tabmatrix,nodes={draw}]
{
a & b \\ %deleting "& b" and "& d" makes everything work
c & d \\
};
\end{tikzpicture}}$
}
\begin{document}
Bla bla bla \mycommand
\end{document}