Label in align*-environment

I want to label an alignat* environment and refer to it. It works with the alignat environment but not with alignat*.

Does anyone know what the problem is?

Replay

The "star" environments (such as align*, eqn*, and others) are made to suppress labels. To create a label, you'll need to use the standard form of the environment (align, eqn).

If you're only interested in referencing the page, you could use the traditional LaTeX \label just before the alignat*, from which you can extract the \pageref:

\label{<label>}
\begin{alignat*}{..}
  ...
\end{alignat*}

Perhaps using the traditional \label - modified by amsmath to \[email protected] - inside should also work for you:

Label in align*-environment

\documentclass{article}

\usepackage{amsmath,lipsum}

\makeatletter
\newcommand{\labelpage}[1]{\[email protected]{#1}}
\makeatother

\begin{document}

See pages~\pageref{eq:first} and~\pageref{eq:second}.

\begin{alignat}{1}
  f(x) &= ax^2 + bx + c \label{eq:first}
\end{alignat}

\lipsum[1-20]

\begin{alignat*}{1}
  f(x) &= ax^2 + bx + c \labelpage{eq:second}
\end{alignat*}

\end{document}

It's not possible to use \label in starred display environments (align*, alignat*, flalign*, gather* and multline*) unless the equation we want to refer to has a \tag.

Conversely, \label can go in any line of a non-starred display environment.

So you have a couple of alternatives, if you insist in not numbering equations.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

Some aligned and not numbered equations, but for one that has
a tag to which we can refer with the standard reference system
\verb|\eqref| getting \eqref{test-tag}
\begin{align*}
a &= b \\
c &= d \tag{a}\label{test-tag}
\end{align*}

Another strategy might be using the page reference, but in
this case the \verb|\label| must go between the text and
the display environment\label{test-page}
\begin{align*}
x &= y \\
u &= v
\end{align*}
and we can then refer to the page with the standard
\verb|\pageref|, getting \pageref{test-page}.

\end{document}

Label in align*-environment

Category: cross referencing Time: 2016-07-28 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.228 (s). 12 q(s)