Math & ScienceSuspend align enviroment

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

Suspend align enviroment

Post by jaybz »

Is it possible to suspend the align environment like with enumerate? I can't seam to find any examples.
Last edited by jaybz on Wed Apr 27, 2011 11:25 pm, edited 1 time in total.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Suspend align enviroment

Post by localghost »

A better description of what you are after could be helpful. It is quite unclear with what want to interrupt the environment. If I understand you right, the \intertext command of amsmath is probably what you are looking for. It is enhanced by \shortintertext of the mathtools package. Some more stuff about math typesetting can be found in the »Math mode« document.


Thorsten
jaybz
Posts: 90
Joined: Sun Jul 11, 2010 6:02 pm

Suspend align enviroment

Post by jaybz »

How can I reproduce this effect without all the hspaces ?

Code: Select all

\documentclass[a4paper,12pt]{article}
\usepackage[top=1in, bottom=0.3in, left=25mm, right=25mm]{geometry}
\usepackage{mathtools}
\begin{document}
\begin{align*}
2x &= 4x^{2} + 7x \hspace{29mm} \makebox[10mm][c]{and \hspace{11mm} $g(x) = 42$} \\
2x &= 4x^{2} + 7x \hspace{36mm} g'(x) = 12 \\
2x &= tan(x)x^{2} + 7x \hspace{26mm} g''(x) = 7x +1 \\
\end{align*}
\end{document}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Suspend align enviroment

Post by localghost »

The amsmath package also provides the alignat* environment for such cases.

Code: Select all

\documentclass[12pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage{mathtools}

\begin{document}
  \begin{alignat*}{2}
    2x &= 4x^{2}+7x       &\makebox[10em]{and} g(x) &= 42 \\
    2x &= 4x^{2}+7x       & g'(x) &= 12 \\
    2x &= \tan(x)x^{2}+7x & g''(x) &= 7x +1
  \end{alignat*}
\end{document}
The tangent function is written upright in math expressions and therefore has with \tan a predefined operator command (see code above).
jaybz
Posts: 90
Joined: Sun Jul 11, 2010 6:02 pm

Re: Suspend align enviroment

Post by jaybz »

Yes that works nicely, I knew about the tan(x) I was just in a hurry.
Thank you.
Post Reply