![amsmath 已加载,但“\end{aligned}”是未定义的控制序列](https://linux22.com/image/414642/amsmath%20%E5%B7%B2%E5%8A%A0%E8%BD%BD%EF%BC%8C%E4%BD%86%E2%80%9C%5Cend%7Baligned%7D%E2%80%9D%E6%98%AF%E6%9C%AA%E5%AE%9A%E4%B9%89%E7%9A%84%E6%8E%A7%E5%88%B6%E5%BA%8F%E5%88%97.png)
以下是 MWE(使用 overleaf 上的 XeLateX):
\documentclass[11pt, a4paper, preprint]{article}
\usepackage{amsmath, amssymb, graphicx, outline, float, cite, color}
\usepackage{longtable,array}
\renewcommand{\thefigure}{S\arabic{figure}}
\renewcommand{\thetable}{S\arabic{table}}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{authblk}
\usepackage{placeins}
\usepackage{caption}
\captionsetup[figure]{font=footnotesize,labelfont=normalsize}
\usepackage{xr-hyper}
\usepackage{hyperref}
\usepackage{framed}
\usepackage{graphicx}
\graphicspath{ {Figs/} }
\newcommand{\tcr} { \textcolor{red} }
\title{compile errors}
\begin{document}
\begin{align}
\bm{K} &= \sigma_0\\
\text{foo} &= \text{bar}
\end{align}
\end{document}
以下是完整的错误输出:
<argument> \bm
{K}(\bm {x},\bm {x'}) &= \sigma _0 + \sigma _i^2 exp
\left [...
l.383 \end{align}
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.
答案1
您没有显示错误消息:
! Undefined control sequence.
<argument> \bm
{K} &= \sigma _0\\ \text {foo} &= \text {bar}
l.25 \end{align}
?
所以这向你表明\bm
你需要加载未定义的命令bm
。