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

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

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