Document ClassesLeft-aligned two column equations

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
rsmeds
Posts: 2
Joined: Thu Jul 17, 2008 11:18 am

Left-aligned two column equations

Post by rsmeds »

Hi,

I'm trying to layout an equation in the following way:

Code: Select all

First:    x = 1/|y|    (3.5a)
Second:   x = y        (3.5b)
Third:    x = y^2+|x|  (3.5c)
i.e. Two columns, both left-aligned, and sub-equation numbers to the right, the first column being text.

I've tried doing it like this (using amsmath):

Code: Select all

\begin{subequation}
  \begin{align}
    \text{First:} & x=1/|y| \\
    \text{Second:} & x=y \\
    \text{Third:} & x=y^2+|x|
  \end{align}
\end{subequations}
but that results in the first (text) column being right-aligned.

I've been hacking at this for days now, it's driving me nuts, and I'd really appreciate it if someone could help.
Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Left-aligned two column equations

Post by Stefan Kottwitz »

Hi rsmeds,

welcome to the forum!
Try the alignat environment:

Code: Select all

\begin{subequations}
  \begin{alignat}{2}
    &\text{First:}       && x=1/|y|  \\
    &\text{Second:}\quad && x=y      \\
    &\text{Third:}       && x=y^2+|x|
  \end{alignat}
\end{subequations}
Stefan
LaTeX.org admin
rsmeds
Posts: 2
Joined: Thu Jul 17, 2008 11:18 am

Left-aligned two column equations

Post by rsmeds »

Hi,

That worked perfectly, thanks!

Added \qquad:s for some extra spacing, and now it's precisely the way I wanted it.

Thanks a lot.
--Rolf
Stefan_K wrote:Hi rsmeds,

welcome to the forum!
Try the alignat environment:

Code: Select all

\begin{subequations}
  \begin{alignat}{2}
    &\text{First:}       && x=1/|y|  \\
    &\text{Second:}\quad && x=y      \\
    &\text{Third:}       && x=y^2+|x|
  \end{alignat}
\end{subequations}
Stefan
Post Reply