
這段程式碼
\begin{equation}
\label{eq:test}
| \mathbf{v} |
\end{equation}
給我錯誤:
ERROR: LaTeX Error: \mathbf allowed only in math mode.
--- TeX said ---
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.430 | \mathbf
{v} |
我的問題很簡單:為什麼?不是方程式數學模式?
答案1
您已經知道許多套件重新定義了|
.因此,我通常建議使用amsmath
和 它的命令\lvert
以及\rvert
作為左右管道分隔符。除了防止重新定義 之外|
,這還可以在|
確實是分隔符號時提供更好的間距。