以下代码第二个\newsavebox{\spec}
存在问题。它不编译。但是,如果我使用\speciesone
两倍,即:
\matrix [matrix of nodes] {
\node (species1) [shape=rectangle,draw] {\usebox{\speciesone}}; & \node (species2) [shape=rectangle,draw] {\usebox{\speciesone}};\\
};
我没问题。
\documentclass[xcolor=pdftex,table,10pt,yellow,mathserif]{article}
\usepackage{tikz}
\usetikzlibrary{matrix}
\newsavebox{\speciesone}
\sbox{\speciesone}{
\begin{tabular}{c c c c}
\multicolumn{3}{c}{{$k~ \times $ 1}} \tabularnewline
\hline
$\vec{v} =$ & $v_{1}$ & $v_{2}$ & $v_{3}$ \tabularnewline
\hline
\hline
& $\circ$ & $\circ$ & $\circ$ \tabularnewline
\end{tabular}
}
\newsavebox{\spec}
\sbox{\spec}{
\begin{tabular}{c c c c}
\multicolumn{3}{c}{{$k~ \times $ 2}} \tabularnewline
\hline
$\vec{v} =$ & $v_{1}$ & $v_{2}$ & $v_{3}$ \tabularnewline
& $\circ$ & $\circ$ & $\circ$ \tabularnewline
\end{tabular}
}
\begin{document}
\begin{tikzpicture}
\matrix [matrix of nodes] {
\node (species1) [shape=rectangle,draw] {\usebox{\speciesone}}; & \node (species2) [shape=rectangle,draw] {\usebox{\spec}};\\
};
\end{tikzpicture}
\end{document}
答案 0 :(得分:0)
要避免未定义的控制序列... 错误,您应该剪切\begin{document}
并将其粘贴到之前
\newsavebox{\speciesone}
\sbox{\speciesone}{
...
}
和
\newsavebox{\spec}
\sbox{\spec}{
...
}