3

Why the numbers of the label of two consecutive subequations is even? This event happen the first times for me.

enter image description here

\documentclass[12pt]{book}
\usepackage{newtxtext,newtxmath}
\usepackage{amsmath}
\setcounter{chapter}{12}
\setcounter{equation}{40}
\begin{document}
\begin{equation}
\begin{subequations}
\int_0^\infty \frac{x^{a-1}}{1-x}\:dx
\int_{1}^{x}\frac{1}{t}dt=\ln x, \quad x>0
\end{subequations}
\end{equation}
text
\begin{equation}
\begin{subequations}
\int_0^\infty \frac{x^{a-1}}{1-x}\:dx
\end{subequations}
\end{equation}
\end{document}
3
  • 1
    subequations is just a setting, just remove the first \end{subequations} and the second \begin{subequations} that is how the env is intended to be used.
    – daleif
    Commented May 30 at 12:36
  • @daleif Hi, please, add also your answer.
    – Sebastiano
    Commented May 30 at 12:37
  • 1
    Besides subequations go on the outside not inside the env,
    – daleif
    Commented May 30 at 12:44

2 Answers 2

4

Because when each equation is written, the equation counter is incremented by both the equation and subequations environments. If you want to use subequations here, it would probably be better to use gather and add the text with \intertext (or rather mathtools' \shortintertext, to keep the same spacing).

\documentclass[12pt]{book}
\usepackage{newtxtext,newtxmath}
\usepackage{mathtools}
\setcounter{chapter}{12}
\setcounter{equation}{40}
\begin{document}
\begin{subequations}
\begin{gather}
\int_0^\infty \frac{x^{a-1}}{1-x}\:dx
\int_{1}^{x}\frac{1}{t}dt=\ln x, \quad x>0
\shortintertext{text}
\int_0^\infty \frac{x^{a-1}}{1-x}\:dx
\end{gather}
\end{subequations}
\end{document}
2
  • Vincent. Excellent!!!!! Thank you very very much.
    – Sebastiano
    Commented May 30 at 12:15
  • Of course it looks better this way, but one could just use a sinlge subequations env in the OPs example.
    – daleif
    Commented May 30 at 12:37
4

The intended use of subequations is

\begin{subequations}
\label{main}
.. whatever envs that produces eq nunmbers that are now numbered <main>a, <main>b and various text
\end{subequations}

The adding of letters go until \end{subequations}.

So here is the proper use of the OPs code.

\documentclass{book}
\usepackage{amsmath}
\setcounter{chapter}{12}
\setcounter{equation}{40}
\begin{document}
\begin{subequations}
 \label{main}
\begin{equation}
\label{main-a}
\int_0^\infty \frac{x^{a-1}}{1-x}\:dx
\int_{1}^{x}\frac{1}{t}dt=\ln x, \quad x>0
\end{equation}
text
\begin{equation}
\label{main-b}
\int_0^\infty \frac{x^{a-1}}{1-x}\:dx
\end{equation}
\end{subequations}
\eqref{main}, \eqref{main-a}, \eqref{main-b}
\end{document}

Though Vincents example with gather and \shortintertext looks cleaner in this case.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .