Latex 中的方程式错误 table

Equation error in Latex table

我想创建一个 table 具有两个参数和相应的方程式。 不知何故乳胶给我错误:

'! Missing $ inserted.'

我不知道那是什么意思...

\begin{table}[H]
\centering
\caption{XXX}
\label{tab:XXX}
\begin{adjustbox}{max width=\textwidth}
    \begin{tabular}{c c}
    \hline\hline
    \vspace{0.25cm}
    Parameter & Mathematical Equation \    \hline 
    \vspace{0.25cm}
    Standard Deviation & \sigma=\sqrt{\frac{\sum(X-\mu)$^2$}{N}} \
    \vspace{0.25cm}
    Variance & \sigma^2=\frac{\sum(X-\mu)$^2$}}{N} \
    \ \hline
    \end{tabular}
\end{adjustbox}
\end{table}

在 TeX 中,$ 符号包含内联数学代码 (see here)。您的示例已在 ^2 左右使用它。但是,您还可以使用其他仅在数学环境中有效的宏,例如\sigma。因此,您应该用 $ 符号包围 all 需要数学模式的宏:

\begin{table}[H]
\centering
\caption{XXX}
\label{tab:XXX}
\begin{adjustbox}{max width=\textwidth}
    \begin{tabular}{c c}
    \hline\hline
    \vspace{0.25cm}
    Parameter & Mathematical Equation \    \hline 
    \vspace{0.25cm}
    Standard Deviation & $\sigma=\sqrt{\frac{\sum(X-\mu)^2}{N}}$ \
    \vspace{0.25cm}
    Variance & $\sigma^2=\frac{\sum(X-\mu)^2}{N}$ \
    \ \hline
    \end{tabular}
\end{adjustbox}
\end{table}

如果您不想混合使用 TeX 和 LaTeX 命令,请考虑使用 \(...\) 而不是 $...$