1

I have a problem writing my report in LaTeX. I dearly need this block of equations to be aligned on the left side of the page, in fact I want all my equations to be left-aligned and have the option of centering, right-aligning specific {align} blocks. How do I do this? The following code is right-centered and parts of my equation is actually out of the page..

\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}

Is there a way to indent a copy-paste autoamtically in here without spacing each line with 4 whitespaces? That isn't working because the browser is keeping the formatting of my copy-paste so some lines can't be indented unless I do each line by hand. This looks ugly, very ugly.

1
  • 5
    The align environment of amsmath should be aligned by inserting & wherever alignment is wanted. Additionally, global left-aligned equations is possible by using the fleqn option to amsmath: \usepackage[fleqn]{amsmath}. Finally, align does not automatically break equations if they do not fit on the page. You need to either manually break the equations where they cannot fit within the text block, or use something like breqn.
    – Werner
    Commented Dec 8, 2011 at 20:59

1 Answer 1

3

use it this way:

\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}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .