在我的论文中,当我想引用方程式时,我遇到了一个问题。引用基本上是基于以三位数字编号的章节或小节进行的(例如 1-1-1)。此外,如果我在同一个小节中有多个方程式,则所有方程式都用相同的数字显示!(以下示例中为 1.1.2!)!但是,每个方程式旁边的数字都正确显示为 (1-1) 或 (1-2) 或 ... 。我希望文本中的方程式编号按顺序显示为 1-1、1-2、1-3、1-4、... 。
请帮我解决这个问题。谢谢
这是我的最小工作示例:
\documentclass[11pt,oneside,english,singlespacing,parskip,headsepline]{MastersDoctoralThesis}
\usepackage{mathtools}
\makeatletter
\newcommand{\mathleft}{\@fleqntrue\@mathmargin0pt}
\newcommand{\mathcenter}{\@fleqnfalse}
\makeatother
\begin{document}
\chapter{Chapter 1}
\section{Section1}
\subsection{Subsection 1-1}
\mathleft
\begin{equation}
\label{eq:KE_Energy}
\begin{aligned}
& \langle KE \rangle = \frac{1}{2} \langle mv^{2} \rangle \\
\end{aligned}
\end{equation}
Equation \ref{eq:KE_Energy} is kinetic energy.
\subsection{Subsection 1-2}
\mathleft
\begin{equation}
\label{eq:KE_Energy2}
\begin{aligned}
& \langle KE \rangle = \frac{1}{2} \langle mv^{2} \rangle \\
\end{aligned}
\end{equation}
Equation \ref{eq:KE_Energy2} is kinetic energy.
\mathleft
\begin{equation}
\label{eq:KE_Energy3}
\begin{aligned}
& \langle KE \rangle = \frac{1}{2} \langle mv^{2} \rangle \\
\end{aligned}
\end{equation}
Equation \ref{eq:KE_Energy3} is kinetic energy.
\section{Section2}
\subsection{Subsection 2-1}
\mathleft
\begin{equation}
\label{eq:KE_Energy4}
\begin{aligned}
& \langle KE \rangle = \frac{1}{2} \langle mv^{2} \rangle \\
\end{aligned}
\end{equation}
Equation \ref{eq:KE_Energy4} is kinetic energy.
\end{document}
输出如下:
答案1
序言中定义的\mathleft
和命令中断删除它们的所有使用将恢复正确的编号。\mathcenter
amsmath
\documentclass[11pt,oneside,english,singlespacing,parskip,headsepline]{MastersDoctoralThesis}
\usepackage{mathtools}
\makeatletter
%\newcommand{\mathleft}{\@fleqntrue\@mathmargin0pt}
%\newcommand{\mathcenter}{\@fleqnfalse}
\makeatother
\begin{document}
\chapter{Chapter 1}
\section{Section1}
\subsection{Subsection 1-1}
%\mathleft
\begin{equation}
\label{eq:KE_Energy}
\begin{aligned}
& \langle KE \rangle = \frac{1}{2} \langle mv^{2} \rangle \\
\end{aligned}
\end{equation}
Equation \ref{eq:KE_Energy} is kinetic energy.
\subsection{Subsection 1-2}
%\mathleft
\begin{equation}
\label{eq:KE_Energy2}
\begin{aligned}
& \langle KE \rangle = \frac{1}{2} \langle mv^{2} \rangle \\
\end{aligned}
\end{equation}
Equation \ref{eq:KE_Energy2} is kinetic energy.
%\mathleft
\begin{equation}
\label{eq:KE_Energy3}
\begin{aligned}
& \langle KE \rangle = \frac{1}{2} \langle mv^{2} \rangle \\
\end{aligned}
\end{equation}
Equation \ref{eq:KE_Energy3} is kinetic energy.
\section{Section2}
\subsection{Subsection 2-1}
%\mathleft
\begin{equation}
\label{eq:KE_Energy4}
\begin{aligned}
& \langle KE \rangle = \frac{1}{2} \langle mv^{2} \rangle \\
\end{aligned}
\end{equation}
Equation \ref{eq:KE_Energy4} is kinetic energy.
\end{document}
答案2
根据前面的回答,我修改了软件包如下:
\usepackage[fleqn]{mathtools}
\makeatletter
\newcommand{\mathleft}{\@fleqntrue\@mathmargin0pt}
\newcommand{\mathcenter}{\@fleqnfalse}
\makeatother
\setlength{\mathindent}{0cm}
(更改的是第一行和最后一行)。这解决了问题,不需要进行其他修改。