我是 Latex 的新手,今天我尝试使用包“amsmath”的环境收集,但出现以下错误:
! Extra alignment tab has been changed to \cr. <template> }}\savetaglength@ \endtemplate l.173 \end{gather}
我的源代码:
\documentclass[a4paper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage{paracol}
\usepackage{blindtext}
\usepackage{mathtools}
\usepackage{amsmath}
\begin{document}
...
\begin{gather}
40y - 2x + x + 2 &= 40 \\
y &= \frac{38}{40} + x \\
\frac{P(x)}{Q(x)}\int_{-\infty}^\infty f(x)dx, \; P(x) = y' + x
\end{gather}
\end{document}
抱歉我的英语不好,我在谷歌上搜索了这个问题,但我得到的唯一结果是与这个案例无关的表格错误。
答案1
收集不支持对齐。您有两个选择。要么避免对齐,要么使用对齐环境。
对于前一种情况:
\documentclass[a4paper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage{paracol}
\usepackage{blindtext}
\usepackage{amsmath,amsthm,mathtools}
\begin{document}
\begin{gather}
40y - 2x + x + 2 = 40 \\
y = \frac{38}{40} + x \\
\frac{P(x)}{Q(x)}\int_{-\infty}^\infty f(x)dx, \; P(x) = y' + x
\end{gather}
\end{document}
而在后一种情况下:
\documentclass[a4paper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage{paracol}
\usepackage{blindtext}
\usepackage{amsmath,amsthm,mathtools}
\begin{document}
\begin{gather}
\begin{align*}
40y - 2x + x + 2 &= 40 \\
y &= \frac{38}{40} + x \\
\frac{P(x)}{Q(x)}\int_{-\infty}^\infty f(x)dx, \; P(x) = y' + x
\end{align*}
\end{gather}
\end{document}