嵌套子方程会弄乱方程计数器

嵌套子方程会弄乱方程计数器

本工作示例:

\documentclass[a4paper]{report}

\usepackage{mleftright}
\usepackage{braket}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathrsfs}

\newcommand{\diff}{\mathop{}\!\mathrm{d}}

\begin{document}

they are related by Fourier transformation:
\begin{subequations}
\begin{subequations}
\label{Position-MomentumSpaceWaveFunctionsDiscr}
\begin{align}
    \psi \mleft( x \mright) = \braket{x \vert \psi} = \braket{x \vert \hat{\mathbb{I}} \vert \psi} & = \braket{x \vert \mleft( \sum_{p' \in \mathscr{P}} \ket{p'} \bra{p'} \mright) \vert \psi} \notag \\
    & = \sum_{p' \in \mathscr{P}} \braket { x \vert p' } \braket{ p' \vert \psi } = \sum_{p' \in \mathscr{P}} \braket { x \vert p' } \phi \mleft( p' \mright) \, , \label{PositionSpaceWaveFunctionsDiscr} \\
    \phi \mleft( p \mright) = \braket{p \vert \psi} = \braket{p \vert \hat{\mathbb{I}} \vert \psi} & = \braket{p \vert \mleft( \sum_{x' \in \mathscr{X}} \ket{x'} \bra{x'} \mright) \vert \psi} \notag \\
    & = \sum_{x' \in \mathscr{X}} \braket { p \vert x' } \braket{ x' \vert \psi } = \sum_{x' \in \mathscr{X}} \braket { p \vert x' } \psi \mleft( x' \mright) \label{MomentumSpaceWaveFunctionsDiscr}
\end{align}
\end{subequations}
or
\begin{subequations}
\label{Position-MomentumSpaceWaveFunctionsCont}
\begin{align}
    \psi \mleft( x \mright) = \braket{x \vert \psi} = \braket{x \vert \hat{\mathbb{I}} \vert \psi} & = \braket{x \vert \mleft( \int\limits_{\mathscr{P}} \! \diff p' \, \ket{p'} \bra{p'} \mright) \vert \psi} \notag \\
    & = \int\limits_{\mathscr{P}}\! \diff p' \, \braket { x \vert p' } \braket{ p' \vert \psi } = \int\limits_{\mathscr{P}}\! \diff p' \, \braket { x \vert p' } \phi \mleft( p' \mright) \, , \label{PositionSpaceWaveFunctionsCont} \\
    \phi \mleft( p \mright) = \braket{p \vert \psi} = \braket{p \vert \hat{\mathbb{I}} \vert \psi} & = \braket{p \vert \mleft( \int\limits_{\mathscr{X}} \! \diff x' \, \ket{x'} \bra{x'} \mright) \vert \psi} \notag \\
    & = \int\limits_{\mathscr{X}}\! \diff x' \, \braket { p \vert x' } \braket{ x' \vert \psi } = \int\limits_{\mathscr{X}}\! \diff x' \, \braket { p \vert x' } \psi \mleft( x' \mright) \, , \label{MomentumSpaceWaveFunctionsCont}
\end{align}
\end{subequations}
\end{subequations}
respectively, with $ \braket{p' \vert x'} = \braket{x' \vert p'}^* $ as outlined in \eqref{InnerProduct} and $ \mathscr{X} $ and $ \mathscr{P} $ denoting the position and momentum eigenspectra. Orthonormality requires:
\newline
\begin{subequations}
\begin{minipage}[t]{0.5\textwidth}
    \begin{equation}
    \label{OrthoNormPositionKetsDiscr}
         \text{and }\braket{x_{1} \vert x} = \delta_{x_{1},x}
    \end{equation}
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
    \begin{equation}
    \label{OrthoNormPositionKetsCont}
        \braket{x_{1} \vert x} = \delta(x_{1}-x)
    \end{equation}
\end{minipage}\hfill
\end{subequations}
\newline
\newline
\newline
for position kets and also momentum eigenkets:

\end{document}

产生以下输出: 在此处输入图片描述

而自然编号应该继续从 2 开始。

在我的实际文档中,嵌套的子方程分别为 1.30aa、1.30ab、1.30ba 和 1.30bb,并且在以下子方程中的一行中编号“重置”为 1.3a 和 1.3b。

如何解决这个问题?

答案1

每次subequations递增计数器equations。由于您嵌套了它们,因此计数器最后equation会递增两次。您可以使用 addint\addtocounter{equation}{-1} ˙after end of outer子方程式来解决这个问题:

\documentclass[a4paper]{report}

\usepackage{mleftright}
\usepackage{braket}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathrsfs}

\newcommand{\diff}{\mathop{}\!\mathrm{d}}

\begin{document}

they are related by Fourier transformation:
\begin{subequations}
\begin{subequations}\label{Position-MomentumSpaceWaveFunctionsDiscr}
\begin{align}
\psi \mleft( x \mright) = \braket{x \vert \psi} = \braket{x \vert \hat{\mathbb{I}} \vert \psi} 
    & = \braket{x \vert \mleft( \sum_{p' \in \mathscr{P}} \ket{p'} \bra{p'} \mright) \vert \psi} \notag \\
    & = \sum_{p' \in \mathscr{P}} \braket { x \vert p' } \braket{ p' \vert \psi } = \sum_{p' \in \mathscr{P}} \braket { x \vert p' } \phi \mleft( p' \mright) \, , \label{PositionSpaceWaveFunctionsDiscr} \\
\phi \mleft( p \mright) = \braket{p \vert \psi} = \braket{p \vert \hat{\mathbb{I}} \vert \psi} 
    & = \braket{p \vert \mleft( \sum_{x' \in \mathscr{X}} \ket{x'} \bra{x'} \mright) \vert \psi} \notag \\
    & = \sum_{x' \in \mathscr{X}} \braket { p \vert x' } \braket{ x' \vert \psi } = \sum_{x' \in \mathscr{X}} \braket { p \vert x' } \psi \mleft( x' \mright) \label{MomentumSpaceWaveFunctionsDiscr}
\end{align}
\end{subequations}
or
\begin{subequations}
\label{Position-MomentumSpaceWaveFunctionsCont}
\begin{align}
    \psi \mleft( x \mright) = \braket{x \vert \psi} = \braket{x \vert \hat{\mathbb{I}} \vert \psi} & = \braket{x \vert \mleft( \int\limits_{\mathscr{P}} \! \diff p' \, \ket{p'} \bra{p'} \mright) \vert \psi} \notag \\
    & = \int\limits_{\mathscr{P}}\! \diff p' \, \braket { x \vert p' } \braket{ p' \vert \psi } = \int\limits_{\mathscr{P}}\! \diff p' \, \braket { x \vert p' } \phi \mleft( p' \mright) \, , \label{PositionSpaceWaveFunctionsCont} \\
    \phi \mleft( p \mright) = \braket{p \vert \psi} = \braket{p \vert \hat{\mathbb{I}} \vert \psi} & = \braket{p \vert \mleft( \int\limits_{\mathscr{X}} \! \diff x' \, \ket{x'} \bra{x'} \mright) \vert \psi} \notag \\
    & = \int\limits_{\mathscr{X}}\! \diff x' \, \braket { p \vert x' } \braket{ x' \vert \psi } = \int\limits_{\mathscr{X}}\! \diff x' \, \braket { p \vert x' } \psi \mleft( x' \mright) \, , \label{MomentumSpaceWaveFunctionsCont}
\end{align}
\end{subequations}
\end{subequations}
\addtocounter{equation}{-1} % <---
respectively, with $ \braket{p' \vert x'} = \braket{x' \vert p'}^* $ as outlined in \eqref{InnerProduct} and $ \mathscr{X} $ and $ \mathscr{P} $ denoting the position and momentum eigenspectra. Orthonormality requires:
\newline
\begin{subequations}
\begin{minipage}[t]{0.5\textwidth}
    \begin{equation}
    \label{OrthoNormPositionKetsDiscr}
         \text{and }\braket{x_{1} \vert x} = \delta_{x_{1},x}
    \end{equation}
\end{minipage}%
\begin{minipage}[t]{0.5\textwidth}
    \begin{equation}
    \label{OrthoNormPositionKetsCont}
        \braket{x_{1} \vert x} = \delta(x_{1}-x)
    \end{equation}
\end{minipage}
\end{subequations}
\newline
\newline
\newline
for position kets and also momentum eigenkets:

\end{document}

在此处输入图片描述

相关内容