Hello,

I'm using emacs-auctex-11.86-2.fc12.noarch and
tex-preview-11.86-2.fc12.noarch on Fedora 12.

It is a known problem that latex-preview's showlabels option doesn't
work with amsmath's multline environment: the label simply doesn't show
up in the preview of these equations.  This has previously been reported
in http://www.mail-archive.com/[email protected]/msg00653.html quite a
few years ago.  As I rely quite heavily on this option (I think reftex
doesn't use the previews so it isn't as convenient), this bug is rather
annoying.

Using the attached test file, I think I have found the problem.  When
the multline environment is used, the content is expanded twice in
amsmath.sty's \multline@, the first time for measurement only.
\i...@setbox is thus also called twice, but the second time \next is
equal to \...@lastlabel and processing get skipped.  If I remove this
duplication check, by editing the definition of \i...@setbox in
prshowlabels.def:

-   \ifx\next...@lastlabel\egroup\romannumeral\else
+   \iffalse\egroup\romannumeral\else

Labels then show up normally.

Please CC me as I'm not subscribed.

r6144

\documentclass{article}
\usepackage{amsmath}
\usepackage{trace}
\usepackage[active,displaymath,textmath,graphics,showlabels]{preview}
\begin{document}
\traceon % preview's trace option is turned off before the p...@ship@end hooks are run
\begin{equation}
  \label{eq:bar}
  x^2 = 4.
\end{equation}
\begin{multline}
  \label{eq:baz}
  x^2 \\ + y^2 = 4.
\end{multline}
\begin{align}
  \label{eq:foo1}
  x + y &= z \\
  \label{eq:foo2}
  z + w &= x
\end{align}
We now refer to the preceding equation \eqref{eq:foo2}:
\end{document}
_______________________________________________
bug-auctex mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to