GeneralAlignment for a System of Equations

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
mrmag
Posts: 14
Joined: Mon Jul 21, 2008 1:55 pm

Alignment for a System of Equations

Post by mrmag »

Hello all,

how can I make left figure scope for the following system of inequalities?

Code: Select all

\begin{eqnarray}
4q+3  < 2q+6 \label{hello1} \\
4q-2q < 6-3   \label{hello2} \\
2q < 3           \label{hello3}
\end{eqnarray}
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.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Alignment for a System of Equations

Post by Stefan Kottwitz »

Hi mrmag,

welcome to the board!

Don't use eqnarray, this is an obsolete environment and could give inconsistent spacing, use the align environment of amsmath instead. For more explanation see: eqnarray vs. align.

This is your example inside align:

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
4q+3  &< 2q+6 \label{hello1} \\
4q-2q &< 6-3  \label{hello2} \\
2q    &< 3    \label{hello3}
\end{align}
\end{document}
I've chosen alignment on the inequality symbols.
What do you mean by "left figure scope"? Do you want all formulas left aligned? To each other or to the left margin?

Stefan
LaTeX.org admin
mrmag
Posts: 14
Joined: Mon Jul 21, 2008 1:55 pm

Re: Alignment for a System of Equations

Post by mrmag »

Thanks for the prompt answer. I mean "{" - left figure scope. Each system should have such a scope. But I can't unite them together with the system...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Alignment for a System of Equations

Post by Stefan Kottwitz »

Like this?

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{cases}
  4q+3 < 2q+6 \\
  4q-2q < 6-3 \\
  2q < 3
\end{cases}
\]
\end{document}
Stefan
LaTeX.org admin
mrmag
Posts: 14
Joined: Mon Jul 21, 2008 1:55 pm

Re: Alignment for a System of Equations

Post by mrmag »

Yes, like this. But the number of each row is disappeared! I need the system with the figure scope and numbers of inequalities?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Alignment for a System of Equations

Post by Stefan Kottwitz »

Then you could use the empheq package together with amsmath:

Code: Select all

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}
\usepackage{empheq}
\begin{document}
\begin{empheq}[left=\empheqlbrace]{align}
4q+3  &< 2q+6 \label{eq:1} \\
4q-2q &< 6-3  \label{eq:2} \\
2q    &< 3    \label{eq:3}
\end{empheq}
See \eqref{eq:1} and \eqref{eq:3}.
\end{document}
Here the equations will be aligned, numbered, they can be referenced and are grouped by a left brace.

Stefan
LaTeX.org admin
mrmag
Posts: 14
Joined: Mon Jul 21, 2008 1:55 pm

Re: Alignment for a System of Equations

Post by mrmag »

This is the real solution of the problem! Thank you very much, Stefan!
Post Reply