Math & Sciencealign command

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
abu aasiyah
Posts: 26
Joined: Wed Sep 30, 2009 7:04 pm

align command

Post by abu aasiyah »

Hey,

The align-command is such that when you type in several equation one on top of the other, every equation gets a number attached to it. How do you only attach a number to the last equation in the alignment. For instance:

Code: Select all

\documentclass[12pt,a4paper,danish]{article} 
\usepackage[latin1]{inputenc} 
\usepackage[danish]{babel} % danske overskrifter
\usepackage[T1]{fontenc} 
\usepackage{lmodern} 
\usepackage{graphicx} 
\usepackage{mathtools}
\usepackage{amsmath}

\begin{document}

\begin{align}
\frac{d^{2} \left( EI\frac{d^{2}\omega}{dx^{2}} \right)}  {dx^{2}}=p \quad& \Leftrightarrow \\
EI\frac{d^{2}  \left( \frac{d^{2}\omega}{dx^{2}} \right)} {dx^{2}}=p \quad& \Leftrightarrow \\
\frac{d^{4}\omega}{dx^{4}}=\frac{p}{EI}
\end{align}

\end{document}

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

align command

Post by Stefan Kottwitz »

Hi,

use \notag for the lines where you don't want to give a number:

Code: Select all

\begin{align}
\frac{d^{2} \left( EI\frac{d^{2}\omega}{dx^{2}} \right)} {dx^{2}}=p \quad& \Leftrightarrow \notag\\
EI\frac{d^{2} \left( \frac{d^{2}\omega}{dx^{2}} \right)} {dx^{2}}=p \quad& \Leftrightarrow \notag\\
\frac{d^{4}\omega}{dx^{4}}=\frac{p}{EI}
\end{align}
Stefan
LaTeX.org admin
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

align command

Post by frabjous »

If you want just one tag associated with the entire aligned sequence, another option would be to use the aligned environment inside an equation environment:

Code: Select all

\documentclass[12pt,a4paper,danish]{article}
\usepackage[latin1]{inputenc}
\usepackage[danish]{babel} % danske overskrifter
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{aligned}
\frac{d^{2} \left( EI\frac{d^{2}\omega}{dx^{2}} \right)}  {dx^{2}}=p \quad& \Leftrightarrow \\
EI\frac{d^{2}  \left( \frac{d^{2}\omega}{dx^{2}} \right)} {dx^{2}}=p \quad& \Leftrightarrow \\
\frac{d^{4}\omega}{dx^{4}}=\frac{p}{EI}
\end{aligned}
\end{equation}

\end{document}
Without further modification, that'll put the tag vertically in the middle of the series. If you want it only to attach to the last line, you might prefer Stefan's suggestion.
Post Reply