Math & ScienceAlignment of equations

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
jaybz
Posts: 90
Joined: Sun Jul 11, 2010 6:02 pm

Alignment of equations

Post by jaybz »

How can I produce this. Note the equations should be centered on the page and everything should be very tight vertically and the numbering is every-other odd number.

Code: Select all

1. We have:
                       x + 2 = 1
                           x = -1
5. By theorem 3.2:
                       y + 4 = 7
                           y = 3   
Last edited by jaybz on Sat Apr 16, 2011 12:24 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

Alignment of equations

Post by Stefan Kottwitz »

Hi jaybz,

use align* for centered aligned equations, \intertext for text between, keeping the alignment. Lenghts may be adjusted as desired.
A small example:

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\setlength{\abovedisplayskip}{0pt}
\setlength{\abovedisplayshortskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\setlength{\belowdisplayshortskip}{0pt}
\begin{align*}
\intertext{1. We have:}
  x + 2 &= 1 \\
  x &= -1 \\
\intertext{5. By theorem 3.2:}
  y + 4 &= 7 \\
  y &= 3  
\end{align*}
\end{document}
You could create your own environment for that, especially regarding the spacing.

Stefan
LaTeX.org admin
jaybz
Posts: 90
Joined: Sun Jul 11, 2010 6:02 pm

Re: Alignment of equations

Post by jaybz »

Thank very much.
Post Reply