我遇到了以下问题。尝试编译代码时
\newcommand{\system}{$\displaystyle \left\{
\begin{aligned}
&y=0\\
&y^2=0\\
\end{aligned} \right.$}
\begin{center}
\begin{tabular}{c}
\newcommand{\sameas}{\\ \rotatebox{90}{$\Leftrightarrow$} \\}
$\displaystyle y=0$
\sameas
$\displaystyle y^2=0$
\sameas
\system
\sameas
\system
\sameas
$\displaystyle y=0$
\end{tabular}
\end{center}
LaTeX 正确显示了对 的第一次调用\sameas
,但表示不知道\sameas
接下来的调用是什么。为什么它会突然忘记 的定义\sameas
?
错误信息如下:
l.94 \sameas
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
我正在使用 Overleaf。
答案1
表格或对齐单元格是特克斯集团, 所以
.... & \newcommand\foo{???} & \foo
就好像
.... { \newcommand\foo{???} } \foo
并且所有非全局分配都会在组结束时被丢弃。