Math & Sciencenumber an align conglomerate on the left

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
madablasan
Posts: 2
Joined: Sun Mar 18, 2012 4:06 am

number an align conglomerate on the left

Post by madablasan »

Hi all,
I have a question about alignment of equation numbers, this is my code:

Code: Select all

\documentclass{book}
\usepackage{amsmath}
\begin{document}
\begin{align}
\max \qquad &\sum_{v}d(A,B)v(F_{1},F_{2},A,B)&&\label{problem}\tag{P}\\
\text{s.t.}\qquad & \displaystyle\sum_{\substack{v:i\in F_{1},\\j\in
B}}v(F_{1},F_{2},A,B)\leq c_{ij}&&\text{for every
$i\in\mathcal{F},j\in\mathcal{C}$}\label{constraint1}\\
&\sum_{v:i\in F_{2}}u_{i}(A,B)v(F_{1},F_{2},A,B)\leq
f_{i}&&\text{for every $i\in\mathcal{F}$}\label{constraint2}\\
&v\geq 0.&&\nonumber
\end{align} 
\end{document}
Essentially, I have 4 lines within an align environment, two of which I want numbered (constraint1 and constraint2). Besides that, I would like to number the whole system on the left. Since I didn't find a way to do that, right now I tagged the first line as (P), but I couldn't find a way to move that (P) to the left side in the center.

I know \reqno and \leqno let you number all equations either on the right or on the left, but I don't know how to number a single equation (or align, or array conglomerate) on the left and everything else on the right.

Thanks!

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

number an align conglomerate on the left

Post by Stefan Kottwitz »

Hi,

welcome to the board!

You could use parbox or minipage environments or tabular for placing a tag on the left side, such as:

Code: Select all

\parbox{.05\textwidth}{(P)}%
\parbox{.95\textwidth}{%
  \begin{align}
  ...
  \end{align}}
Just a remark: if tags are commonly on the right side, I would not place a single tag on the left. Numbering or tags, respectively, are intended for look-up when cross-referenced, so the reader should know there's a consistent place to look for. Just one exceptional tag on a left side looks more like a design idea, not like a real and useful tag - just my opinion.

Stefan
LaTeX.org admin
madablasan
Posts: 2
Joined: Sun Mar 18, 2012 4:06 am

Re: number an align conglomerate on the left

Post by madablasan »

Ok, that worked great, thanks! I put the (P) as a tag/label inside an empty align on the left box so that it could be accessible through hyperref.
About the style, I think you're right, but it's common practice in my field to do it this way. I will bring it up with my supervisor, he suggested the tag on the left in the first place.
Post Reply