I have the following problem: I am writing my PhD and the alignat environment changes the behaviour during the document. Here is an example:
\documentclass[12pt, a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[english]{varioref}
\usepackage[fleqn]{amsmath}
\begin{document}
\frontmatter
\chapter*{A}
This is a string which tests the text width. This is a string which tests the text width. This is a string which tests the text width.
\begin{alignat}{3}
& \big\{\phi_{B^\prime}(v) | \mbox{$v \in V$ is a leaf of $G$}\big\}
&& = \big\{b \in B | \iota(b) \not\equiv d \mod d\big\}\\
\intertext{and}
& \big\{\phi_{B^\prime}(v) | \mbox{$v \in V$ is not a leaf of $G$}\big\}
&& = \big\{b \in B | \iota(b) \equiv d \mod d\big\}.
\end{alignat}
\mainmatter
\chapter{B}
This is a string which tests the text width. This is a string which tests the text width. This is a string which tests the text width.
\begin{alignat}{3}
& \big\{\phi_{B^\prime}(v) | \mbox{$v \in V$ is a leaf of $G$}\big\}
&& = \big\{b \in B | \iota(b) \not\equiv d \mod d\big\}\\
\intertext{and}
& \big\{\phi_{B^\prime}(v) | \mbox{$v \in V$ is not a leaf of $G$}\big\}
&& = \big\{b \in B | \iota(b) \equiv d \mod d\big\}.
\end{alignat}
\end{document}
After using \mainmatter the alignat environment changes its behaviour. I tried to use \pagenumbering{arabic}, but it did not help.
Is it a bug? Or do I something wrong?
Thank you very much for your answer.
Best regards, T



(1)vs(1.1)I do not see any difference – daleif Jan 07 '16 at 15:23\mainmatterswitches chapter counting on, i.e.\frontmatterwill use unnumbered chapters, regardless, whether\chapteror\chapter*is used. As such, theequationnumber is now(1.1)(wider than before) – Jan 07 '16 at 15:29book.cls:\renewcommand\theequation {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}-- i.e. as long as the chapter number is zero, it will not be prepended to theequationnumber, i.e.\mainmatterincreases the counter output and that's to wide foralignat– Jan 07 '16 at 15:37\frontmatterand thefleqnoption, which seems to be triggered when the equation is rather wide. – egreg Jan 07 '16 at 15:49amsmath; it is not a problem when used with an ams document class, but with[12pt]{book}it reappears. it has been re-posted to the "live"amsmathbugs list. thank you for the reliably working example. – barbara beeton Jan 07 '16 at 20:56