Left-Aligning Equations in \texttt{align} Environment

  • Context: MHB 
  • Thread starter Thread starter Dustinsfl
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on aligning equations to the left within the \texttt{align} environment in LaTeX. Users are advised to place ampersands (&) at the beginning of each line to achieve left alignment. The conversation also touches on aesthetic preferences for equation alignment, with some users favoring alignment on the equals sign. Additionally, alternatives such as the \texttt{eqnarray*} and \texttt{alignat} environments are suggested for achieving specific formatting needs.

PREREQUISITES
  • Understanding of LaTeX syntax and environments
  • Familiarity with the \texttt{align} environment
  • Knowledge of mathematical typesetting in LaTeX
  • Basic understanding of aesthetics in document formatting
NEXT STEPS
  • Learn how to use the \texttt{eqnarray*} environment for equation formatting
  • Explore the \texttt{alignat} environment for custom alignment options
  • Research best practices for mathematical typesetting in LaTeX
  • Investigate the impact of ampersand placement on equation alignment
USEFUL FOR

LaTeX users, mathematicians, and anyone involved in typesetting equations who seeks to improve the presentation of mathematical content in documents.

Dustinsfl
Messages
2,217
Reaction score
5
So I want to use begin{align} end{align} but I want my equations to line up on the left not the right.

How can this be done?

\begin{align}
\frac{ds}{dt} = -k_1es + (k_{-1} - k_3)c_1 + k_{-3}c_2\\
\frac{dc_1}{dt} = k_1se - (k_{-1} + k_2 + k_3s)c_1 + (k_{-3} + k_4)c_2\\
\frac{dc_2}{dt} = k_3sc_1 - (k_{-3} + k_4)c_2\\
\frac{de}{dt} = -k_1se + (k_{-1} + k_2)c_1\\
\frac{dp}{dt} = k_2c_2 + k_4c_2
\end{align}
 
Physics news on Phys.org
\begin{align}
\frac{ds}{dt} &= -k_1es + (k_{-1} - k_3)c_1 + k_{-3}c_2\\
\frac{dc_1}{dt} &= k_1se - (k_{-1} + k_2 + k_3s)c_1 + (k_{-3} + k_4)c_2\\
\frac{dc_2}{dt} &= k_3sc_1 - (k_{-3} + k_4)c_2\\
\frac{de}{dt} &= -k_1se + (k_{-1} + k_2)c_1\\
\frac{dp}{dt} &= k_2c_2 + k_4c_2
\end{align}

Insert ampersands. Incidentally, MathJax automatically parses this environment, so it's probably best not to put too much $\LaTeX$ into your post titles.
 
Ackbach said:
\begin{align}
\frac{ds}{dt} &= -k_1es + (k_{-1} - k_3)c_1 + k_{-3}c_2\\
\frac{dc_1}{dt} &= k_1se - (k_{-1} + k_2 + k_3s)c_1 + (k_{-3} + k_4)c_2\\
\frac{dc_2}{dt} &= k_3sc_1 - (k_{-3} + k_4)c_2\\
\frac{de}{dt} &= -k_1se + (k_{-1} + k_2)c_1\\
\frac{dp}{dt} &= k_2c_2 + k_4c_2
\end{align}

Insert ampersands. Incidentally, MathJax automatically parses this environment, so it's probably best not to put too much $\LaTeX$ into your post titles.

Is there anyway to make it flush? Lines 2 and 3 look ugly.
 
dwsmith said:
Is there anyway to make it flush? Lines 2 and 3 look ugly.

That's a matter of aesthetics. I prefer aligned equations to align on the equals sign. If you prefer to align on the left-hand sides of the derivatives, then put the ampersands on the far left like this:

\begin{align}
&\frac{ds}{dt} = -k_1es + (k_{-1} - k_3)c_1 + k_{-3}c_2\\
&\frac{dc_1}{dt} = k_1se - (k_{-1} + k_2 + k_3s)c_1 + (k_{-3} + k_4)c_2\\
&\frac{dc_2}{dt}= k_3sc_1 - (k_{-3} + k_4)c_2\\
&\frac{de}{dt} = -k_1se + (k_{-1} + k_2)c_1\\
&\frac{dp}{dt} = k_2c_2 + k_4c_2
\end{align}

I don't like that, but that's how you can do it if you do like it.
 
Ackbach said:
That's a matter of aesthetics. I prefer aligned equations to align on the equals sign. If you prefer to align on the left-hand sides of the derivatives, then put the ampersands on the far left like this:

\begin{align}
&\frac{ds}{dt} = -k_1es + (k_{-1} - k_3)c_1 + k_{-3}c_2\\
&\frac{dc_1}{dt} = k_1se - (k_{-1} + k_2 + k_3s)c_1 + (k_{-3} + k_4)c_2\\
&\frac{dc_2}{dt}= k_3sc_1 - (k_{-3} + k_4)c_2\\
&\frac{de}{dt} = -k_1se + (k_{-1} + k_2)c_1\\
&\frac{dp}{dt} = k_2c_2 + k_4c_2
\end{align}

I don't like that, but that's how you can do it if you do like it.

\begin{align}
&\frac{ds}{dt} & = & -k_1es + (k_{-1} - k_3)c_1 + k_{-3}c_2,\\
&\frac{dc_1}{dt} & = & k_1se - (k_{-1} + k_2 + k_3s)c_1 + (k_{-3} + k_4)c_2,\\
&\frac{dc_2}{dt} & = & k_3sc_1 - (k_{-3} + k_4)c_2,\\
&\frac{de}{dt} & = & -k_1se + (k_{-1} + k_2)c_1,\\
&\frac{dp}{dt} & = & k_2c_2 + k_4c_2
\end{align}

On my pdf document, the space between the derivatives and equal sign is about 2in but on the forum it is about a 1/2in. How can I get my pdf file to align like this?
 
Use eqnarray* environment.
 
You can also use alignat but I don't know if this will work here.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
989
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K