# Using Align across a list of theorems

I'm trying to align a list of axioms at the equal sign but I can't get align to work across my \begin{ax} \end{ax} tags.

\newtheorem{ax}{Axiom}

\begin{align}
\begin{ax}[inf assoc] $c_0 \sqcap (c_1 \sqcap c_2) &= (c_0 \sqcap c_1) \sqcap c_2$ \end{ax}
\begin{ax}[inf comm] $c_0 \sqcap c_1 &= c_1 \sqcap c_0$ \end{ax}
\begin{ax}[inf idemp] $c \sqcap c &= c$ \end{ax}
\begin{ax}[inf unit] $c \sqcap \top &= c$ \end{ax}
\end{align}


How can I achieve this?

• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Mar 3 '15 at 5:52

A solution with tabular contents.

\documentclass{article}
\usepackage{array}

\newtheorem{ax}{Axiom}

\begin{document}

\begin{ax}[inf assoc]\hfill
\begin{tabular}{>{$}r<{$}@{${ }={ }$}>{$}p{5cm}<{$}}
c_0 \sqcap (c_1 \sqcap c_2) & (c_0 \sqcap c_1) \sqcap c_2
\end{tabular}
\refstepcounter{equation}\hfil\normalfont(\theequation)
\end{ax}
\begin{ax}[inf comm]\hfill
\begin{tabular}{>{$}r<{$}@{${ }={ }$}>{$}p{5cm}<{$}}
c_0 \sqcap c_1 & c_1 \sqcap c_0
\end{tabular}
\refstepcounter{equation}\hfil\normalfont(\theequation)
\end{ax}
\begin{ax}[inf idemp]\hfill
\begin{tabular}{>{$}r<{$}@{${ }={ }$}>{$}p{5cm}<{$}}
c \sqcap c & c
\end{tabular}
\refstepcounter{equation}\hfil\normalfont(\theequation)
\end{ax}
\begin{ax}[inf unit]\hfill
\begin{tabular}{>{$}r<{$}@{${ }={ }$}>{$}p{5cm}<{$}}
c \sqcap \top & c
\end{tabular}
\refstepcounter{equation}\hfil\normalfont(\theequation)
\end{ax}

\end{document}


Output

• You could use array environments instead of tabulars. If nothing else, it would significantly simplify the structure of the environment headers.
– Mico
Mar 3 '15 at 7:13
• Separaotely, the tabular (or array) environment headers should probably be terminated with @{}, right?
– Mico
Mar 3 '15 at 7:19
• @Mico Since I'm using p columns it doesn't change much (array or tabular). In regards of @{} it makes no difference, in this case, either. Mar 3 '15 at 7:51

You haven't told us which package, if any, you use to define the ax environment; in the example below, I'll assume it's the ntheorem package.

If the axiom environments all consist of a header (and possibly a short blurb) followed by a displayed equation, you could load the mathtools package (a superset of the amsmath package) and use its \shortintertext macro to contain the text parts of the axiom declarations. (To fine-tune the spacing above and below the axiom header lines, you would need to tell us which package you use to declare the ax environment.)

\documentclass{article}
\usepackage{mathtools}
\usepackage[amsmath]{ntheorem} % or amsthm
\newtheorem{ax}{Axiom}
\begin{document}
\begin{align}
\shortintertext{%
\begin{ax}[inf assoc] text \end{ax}}
c_0 \sqcap (c_1 \sqcap c_2) &= (c_0 \sqcap c_1) \sqcap c_2\\
\shortintertext{%
\begin{ax}[inf comm] more text\end{ax}}
c_0 \sqcap c_1 &= c_1 \sqcap c_0\\
\shortintertext{%
\begin{ax}[inf idemp] still more text\end{ax}}
c \sqcap c &= c \\
\shortintertext{%
\begin{ax}[inf unit] further text\end{ax}}
c \sqcap \top &= c
\end{align}
\end{document}

• And anyway I would use your solution :-) Mar 3 '15 at 7:52

They won't work. You have to do something special. I've done that below: a manual stepping of the ax counter and placing the Axiom X (title) as part of the align-like construction. Using a full length alignment you can stretch things across the entire line width:

\documentclass{article}
\usepackage{amsmath}

\newtheorem{ax}{Axiom}
\makeatletter
\let\ltxlabel\ltx@label
\makeatother
\begin{document}

\begin{ax}[abc]
Some axiom.
\end{ax}
$a b c d e f g = a b c d e f g$

\begin{flalign}
&\refstepcounter{ax}\textbf{Axiom~\theax~(inf assoc)}\ltxlabel{abc} & c_0 \sqcap (c_1 \sqcap c_2) &= (c_0 \sqcap c_1) \sqcap c_2 & \\
&\refstepcounter{ax}\textbf{Axiom~\theax~(inf comm)} & c_0 \sqcap c_1 &= c_1 \sqcap c_0 & \\
&\refstepcounter{ax}\textbf{Axiom~\theax~(inf idemp)} & c \sqcap c &= c && \\
&\refstepcounter{ax}\textbf{Axiom~\theax~(inf unit)} & c \sqcap \top &= c &
\end{flalign}

See Axiom~\ref{abc}.
\end{document}


Note that the horizontal alignment of the axiom equations doesn't match that of the horizontal alignment of a regular equation. But that's to be expected and might look weird if the descriptions of the axioms are longer.

Of course it's not advisable to label the equations as well as the axioms. So I'd suggest using flalign* instead. To reference the axioms, you would need to use \ltxlabel, since the regular \label under amsmath's align-like environments will only capture the tag (equation number).