我在用 LaTeX 写报告时遇到了问题。我非常需要将这个方程式块对齐在页面的左侧,事实上,我希望所有方程式都左对齐,并可以选择居中、右对齐特定的 {align} 块。我该怎么做?以下代码是右居中的,而方程式的某些部分实际上超出了页面。
\begin{align}
u(x+\Delta x, t) = u(x,t) +\frac{\partial u(x,t)}{\partial x}\Delta x +\frac{\partial u(x,t)}{\partial t}(t-t) + \frac12\frac{\partial^2 u(x,t)}{\partial x^2}(\Delta x)^2 \\+ \frac{\partial^2u(x,t)}{\partial x\partial y}(t-t)(\Delta x)^2 + \frac12\frac{\partial u(x,t)}{\partial^2t}(t-t)^2 +(...)\Delta x^3 +(...)\Delta x^4 \intertext{Seeing powers of t dropping in expansion around $x\pm\Delta x$}\\
u(x-\Delta x, t) = u(x,t) -\frac{\partial u(x,t)}{\partial x}\Delta x + \frac12\frac{\partial^2 u(x,t)}{\partial x^2}(\Delta x)^2 -(...)\Delta x^3 +(...)\Delta x^4\\
\left[\frac12\frac{\partial^2 u(x,t)}{\partial x^2}(\Delta x)^2+ \frac12\frac{\partial^2 u(x,t)}{\partial x^2}(\Delta x)^2\right] = u(x-\Delta x, t) + u(x+\Delta x, t) - u(x,t) - u(x,t) + O(\Delta x^4)
\intertext{Odd powers of $\Delta x$ cancelling eachother}\\
\frac{\partial^2 u(x,t)}{\partial x^2} = \frac{u(x-\Delta x, t) + u(x+\Delta x, t) - 2u(x,t)}{\Delta x^2} + O(\Delta x^2)
\end{align}
有没有办法在这里自动缩进复制粘贴,而无需在每行之间留出 4 个空格?这行不通,因为浏览器会保留我复制粘贴的格式,所以有些行无法缩进,除非我手动缩进每一行。这看起来很丑,非常丑。
答案1
请按如下方式使用:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
u(x+\Delta x, t) &= u(x,t) +\frac{\partial u(x,t)}{\partial x}\Delta x +\frac{\partial u(x,t)}{\partial t}(t-t) + \frac12\frac{\partial^2 u(x,t)}{\partial x^2}(\Delta x)^2 \\
& \qquad + \frac{\partial^2u(x,t)}{\partial x\partial y}(t-t)(\Delta x)^2 + \frac12\frac{\partial u(x,t)}{\partial^2t}(t-t)^2 \\
& \qquad +(...)\Delta x^3 +(...)\Delta x^4
\intertext{Seeing powers of t dropping in expansion around $x\pm\Delta x$}
u(x-\Delta x, t) &= u(x,t) -\frac{\partial u(x,t)}{\partial x}\Delta x + \frac12\frac{\partial^2 u(x,t)}{\partial x^2}(\Delta x)^2 -(...)\Delta x^3 +(...)\Delta x^4\\
& \left[\frac12\frac{\partial^2 u(x,t)}{\partial x^2}(\Delta x)^2+ \frac12\frac{\partial^2 u(x,t)}{\partial x^2}(\Delta x)^2\right] \\
& = u(x-\Delta x, t) + u(x+\Delta x, t) - u(x,t) - u(x,t) + O(\Delta x^4)
\intertext{Odd powers of $\Delta x$ cancelling eachother}
\frac{\partial^2 u(x,t)}{\partial x^2} &= \frac{u(x-\Delta x, t) + u(x+\Delta x, t) - 2u(x,t)}{\Delta x^2} + O(\Delta x^2)
\end{align}
\end{document}