Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help with amsmath: align not possible?

4,531 views
Skip to first unread message

Daniel Barrett

unread,
Oct 26, 2007, 5:04:54 PM10/26/07
to
I'm having a problem with a software package that generates small
LaTeX files like this, for displaying a single math formula:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\pagestyle{empty}
\begin{document}
$\displaystyle
INSERT MATH FORMULA HERE
$
\end{document}

Unfortunately, whenever the math formula contains a \begin{align}
... \end{align} environment, LaTeX produces this error:

Package amsmath Error: \begin{align} allowed only in paragraph mode.

Is there a better set of LaTeX commands to generate instead of the
above, so this error does not occur? (Removing the three usepackage
lines eliminates the error, but we do want to use amsmath.)

FYI, this is part of a mathematics renderer for MediaWiki: it produces
a single math formula, converts it to PNG format, and embeds it in the
wiki page.

Thank you,

--
Dan Barrett
dbar...@blazemonger.com

Joseph Wright

unread,
Oct 26, 2007, 5:11:21 PM10/26/07
to
> dbarr...@blazemonger.com

What is wrong with:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\pagestyle{empty}
\begin{document}

\begin{align}
INSERT MATH FORMULA HERE
\end{align}
\end{document}

Joseph Wright

G. A. Edgar

unread,
Oct 26, 2007, 5:35:10 PM10/26/07
to
In article <slrnfi4ljn....@spinky.blazemonger.com>, Daniel
Barrett <dbar...@blazemonger.com> wrote:

Do not put \begin{align} \end{align} inside of $ $ .
Also, the align environment is automatically in displaystyle .

--
G. A. Edgar http://www.math.ohio-state.edu/~edgar/

Steve Mayer

unread,
Oct 27, 2007, 7:24:07 AM10/27/07
to
"Daniel Barrett" <dbar...@blazemonger.com> wrote in message
news:slrnfi4ljn....@spinky.blazemonger.com...

> $\displaystyle
> INSERT MATH FORMULA HERE
> $

> FYI, this is part of a mathematics renderer for MediaWiki: it produces


> a single math formula, converts it to PNG format, and embeds it in the
> wiki page.
>

"G. A. Edgar" <ed...@math.ohio-state.edu.invalid> wrote in message
news:261020071735102752%ed...@math.ohio-state.edu.invalid...


> Do not put \begin{align} \end{align} inside of $ $ .
> Also, the align environment is automatically in displaystyle .

The problem is that you are using a renderer which automatically puts the
code between $...$ and maybe adds \displaystyle as well. You could either
parse the code so as not to use $...$ whenever you use align or similar
environments or, more simply, just add \par just before \begin{align} (this
could be automated). This works by forcing LaTeX itself to deal with the
error and add its own $ cancelling out the ones that shouldn't be there if
you see what I mean.

Steve Mayer


0 new messages