对齐按段落分隔的公式

对齐按段落分隔的公式

我想对齐按段落分隔的方程式,同时保留自动生成的标签和\listof目录后的标签。我该如何对齐这些方程式并保持\listofmyequations\label完整?

\documentclass[11pt,a4paper,twoside,openright,fleqn,%
headinclude,footinclude,parskip=half,%
numbers=noenddot,cleardoublepage=empty]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[notlof,notlot,notbib]{tocbibind} 
\usepackage{tocloft}
\usepackage{amsmath,amssymb,amsthm}
%\usepackage[ruled,vlined,algochapter,linesnumbered]{algorithm2e}
\usepackage{pdfpages}
%-- colours for the hyperlinks
%\usepackage[usenames,dvipsnames]{xcolor}
\definecolor{colorforlinks}{RGB}{27, 60, 131}
\usepackage[breaklinks=true,
    colorlinks=true,
    linktocpage=true,
    allcolors=colorforlinks]{hyperref} 

\newcommand{\listequationsname}{List of Equations}

\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
    \addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}

\begin{document}

\listofmyequations

\chapter{Precision and Accuracy}

The precision, or repeatability, and a paragraph of words here: 

\begin{equation}
    \label{eq:std}
    \sigma = \sqrt{\frac{\sum_{i=1}^{n}(x_{i,j} - \bar{x})^{2}}{n-1}}    
\end{equation}
\myequations{Standard Deviation}
where \(i\) is the epoch number, \(j\) is the \(x\),\(y\) and \(z\) component, \(x_{i,j}\) is the measurement at the epoch of observation, \(\bar{x}\) is the mean of \(j\) measurements and \(n\) is the total number of epochs. 

Then some words about Accuracy for a paragraph or so:
\begin{equation}
    \label{eq:rms}
    RMS_{x,\,y \,or\, z} = \sqrt{\frac{\sum_{i=1}^{n}(P_{i}-O)^{2}}{n}}
\end{equation}
\myequations{Root Mean Square}

Furthermore; some words about 2-dimensional RMS or 2DRMS:
\begin{equation}
    \label{eq:2drms}
    2DRMS = 2 * \sqrt{ RMS_{x}^{2} + RMS_{y}^{2}} 
\end{equation}
\myequations{Distance Root Mean Square}

where \(RMS_{x}\) and \(RMS_{y}\) are the RMS for the \(x\) and \(y\)  components respectively.

Lastly; a paragraph or so about Mean Radial Spherical Error:
\begin{equation}
    \label{eq:mrse}
    MRSE = \sqrt{ RMS_{x}^{2} + RMS_{y}^{2} + RMS_{u}^{2}} 
\end{equation}
\myequations{Mean Radial Spherical Error}

where \(RMS_{x}\), \(RMS_{y}\) and \(RMS_{z}\) are the RMS for the \(x\), \(y\) and \(z\) components respectively.

\end{document}

我试过了\intertext\shortintertext但失败了。也许我放错了。我不知道。

答案1

在您的 MWE 中替换

\usepackage{amsmath,amssymb,amsthm}

\usepackage[fleqn,reqno]{amsmath}
\setlength{\mathindent}{3pc} % or another length to suit you
\usepackage{amssymb,amsthm}

答案2

解决方案是删除equation并使用align\intertext{ with \myequations{name of the equation} inside the intertext}

这可能有点冗长,但保持\listofmyequations完整并正确引用自动生成\label

\documentclass[11pt,a4paper,twoside,openright,fleqn,%
headinclude,footinclude,parskip=half,%
numbers=noenddot,cleardoublepage=empty]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[left=15mm,top=10mm]{geometry}
\usepackage[notlof,notlot,notbib]{tocbibind} 
\usepackage{tocloft}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{pdfpages}

%-- colours for the hyperlinks
\definecolor{colorforlinks}{RGB}{27, 60, 131}
\usepackage[breaklinks=true,
colorlinks=true,
linktocpage=true,
allcolors=colorforlinks]{hyperref} 
\setlength{\parindent}{2pc}

\newcommand{\listequationsname}{List of Equations}

\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
    \addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}

\begin{document}
    
    \listofmyequations
    
    \chapter{Precision and Accuracy}
    
    The precision, or repeatability, and a paragraph of words here: 
    
    \begin{align}
        STD &= \sqrt{\frac{\sum_{i=1}^{n}(x_{i,j} - \bar{x})^{2}}{n-1}}    \label{eq:std} 
        \intertext{\myequations{Standard Deviation} \noindent where \(i\) is the epoch number, \(j\) is the \(x\),\(y\) and \(z\) component, \(x_{i,j}\) is the measurement at the epoch of observation, \(\bar{x}\) is the mean of \(j\) measurements and \(n\) is the total number of epochs.}
        \intertext{\indent Then some words about Accuracy for a paragraph or so:}
        RMS_{x,\,y \,or\, z} &= \sqrt{\frac{\sum_{i=1}^{n}(P_{i}-O)^{2}}{n}}  \label{eq:rms} 
        \intertext{ \myequations{Root Mean Square}  \noindent where \(x\),\(y\) and \(z\) are the horizontal and vertical coordinate components, \(P\) is the measured Real-Time ppp value, \(O\) the \emph{true} reference value, \(i\) is the epoch of observation and \(n\) is the total number of epochs.} 
        \intertext{\indent Furthermore; some words about 2-dimensional RMS or 2DRMS:}
        2DRMS &= 2 * \sqrt{ RMS_{x}^{2} + RMS_{y}^{2}} \label{eq:2drms}
        \intertext{\myequations{Distance Root Mean Square}  \noindent where \(RMS_{x}\) and \(RMS_{y}\) are the RMS for the \(x\) and \(y\)  components respectively.}
        \intertext{\indent Lastly; a paragraph or so about Mean Radial Spherical Error:}
        MRSE &= \sqrt{ RMS_{x}^{2} + RMS_{y}^{2} + RMS_{u}^{2}} \label{eq:mrse}
    \end{align}
    \myequations{Mean Radial Spherical Error}
    \noindent where \(RMS_{x}\), \(RMS_{y}\) and \(RMS_{z}\) are the RMS for the \(x\), \(y\) and \(z\) components respectively.
\end{document}

在此处输入图片描述

答案3

对 OP 答案 (+1) 进行了小幅修改,(在我看来)页面看起来更美观。您可能会发现以下建议很有用:

  • 重新定义为\myequations
  • 连续的互文被合并成一个
  • 定义是用于模拟段落的新命令\intertext
\documentclass[11pt,a4paper,twoside,openright,fleqn,%
                headinclude,footinclude,parskip=half,%
                numbers=noenddot,cleardoublepage=empty]{scrbook}
\usepackage{geometry}
\usepackage[notlof,notlot,notbib]{tocbibind}
\usepackage{tocloft}
\usepackage{amsmath,amssymb,amsthm}

\usepackage{lipsum}

\usepackage{pdfpages}
\definecolor{colorforlinks}{RGB}{27, 60, 131}
\usepackage[breaklinks=true,
            colorlinks=true,
            linktocpage=true,
            allcolors=colorforlinks]{hyperref}
            
\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
    \addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\ignorespaces}
\newcommand\inl{
\setlength{\parindent}{2pc}

\begin{document}
\listofmyequations

\chapter{Precision and Accuracy}
The precision, or repeatability, and a paragraph of words here:
    \begin{align}
        STD &= \sqrt{\frac{\sum_{i=1}^{n}(x_{i,j} - \bar{x})^{2}}{n-1}}     \label{eq:std}
\intertext{\myequations{Standard Deviation} 
    where \(i\) is the epoch number, \(j\) is the \(x\),\(y\) and \(z\) component, \(x_{i,j}\) is the measurement at the epoch of observation, \(\bar{x}\) is the mean of \(j\) measurements and \(n\) is the total number of epochs. 
    \newline\indent
Then some words about Accuracy for a paragraph or so:}
        \mathrm{RMS}_{x,\,y \,\mathrm{or}\, z} 
            & = \sqrt{\frac{\sum_{i=1}^{n}(P_{i}-O)^{2}}{n}}                \label{eq:rms}
\intertext{\myequations{Root Mean Square}  
    where \(x\),\(y\) and \(z\) are the horizontal and vertical coordinate components, \(P\) is the measured Real-Time ppp value, \(O\) the \emph{true} reference value, \(i\) is the epoch of observation and \(n\) is the total number of epochs. 
    \newline\indent
    Furthermore; some words about 2-dimensional RMS or 2DRMS:}
        2\mathrm{DRMS} 
            & = 2 * \sqrt{ RMS_{x}^{2} + RMS_{y}^{2}}                       \label{eq:2drms}
\intertext{\myequations{Distance Root Mean Square}  
    \noindent where \(RMS_{x}\) and \(RMS_{y}\) are the RMS for the \(x\) and \(y\)  components respectively. 
    \newline\indent
    Lastly; a paragraph or so about Mean Radial Spherical Error:}
        \mathrm{MRSE} 
            & = \sqrt{ RMS_{x}^{2} + RMS_{y}^{2} + RMS_{u}^{2}}             \label{eq:mrse}
    \end{align}\myequations{Mean Radial Spherical Error}
where \(\mathrm{RMS}_{i},\; i\in\{x,y,z\}\) are the RMS for the \(x\), \(y\) and \(z\) components respectively.

\lipsum[66]
\end{document}

在此处输入图片描述

在此处输入图片描述

编辑: 但是,不清楚为什么需要如此复杂的方程结构。本页上的方程在 处对齐吗=

好吧,这是个人喜好问题。我看不出有什么优点。更常见的文本书写方式至少要简单得多,因此不容易出错:

\documentclass[11pt,a4paper,twoside,openright,fleqn,%
                headinclude,footinclude,parskip=half,%
                numbers=noenddot,cleardoublepage=empty]{scrbook}
\usepackage{geometry}
\usepackage[notlof,notlot,notbib]{tocbibind}
\usepackage{tocloft}
\usepackage{amsmath,amssymb,amsthm}

\usepackage{lipsum}

\usepackage{pdfpages}
\definecolor{colorforlinks}{RGB}{27, 60, 131}
\usepackage[breaklinks=true,
            colorlinks=true,
            linktocpage=true,
            allcolors=colorforlinks]{hyperref}

\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
    \addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\ignorespaces}
\setlength{\parindent}{2pc}

\begin{document}
\listofmyequations

\chapter{Precision and Accuracy}
The precision, or repeatability, and a paragraph of words here:
    \begin{equation}\label{eq:std}
STD = \sqrt{\frac{\sum_{i=1}^{n}(x_{i,j} - \bar{x})^{2}}{n-1}}                  
    \end{equation}\myequations{Standard Deviation}
where \(i\) is the epoch number, \(j\) is the \(x\),\(y\) and \(z\) component, \(x_{i,j}\) is the measurement at the epoch of observation, \(\bar{x}\) is the mean of \(j\) measurements and \(n\) is the total number of epochs.

Then some words about Accuracy for a paragraph or so:
    \begin{equation}\label{eq:rms}
\mathrm{RMS}_{x,\,y \,\mathrm{or}\, z} = \sqrt{\frac{\sum_{i=1}^{n}(P_{i}-O)^{2}}{n}}    
    \end{equation}\myequations{Root Mean Square}
where \(x\),\(y\) and \(z\) are the horizontal and vertical coordinate components, \(P\) is the measured Real-Time ppp value, \(O\) the \emph{true} reference value, \(i\) is the epoch of observation and \(n\) is the total number of epochs.

Furthermore; some words about 2-dimensional RMS or 2DRMS:
    \begin{equation}\label{eq:2drms}
2\mathrm{DRMS}= 2 * \sqrt{ RMS_{x}^{2} + RMS_{y}^{2}}                           
    \end{equation}\myequations{Distance Root Mean Square}
where \(RMS_{x}\) and \(RMS_{y}\) are the RMS for the \(x\) and \(y\)  components respectively.

Lastly; a paragraph or so about Mean Radial Spherical Error:
    \begin{equation}\label{eq:mrse}
\mathrm{MRSE} = \sqrt{ RMS_{x}^{2} + RMS_{y}^{2} + RMS_{u}^{2}}             
    \end{equation}\myequations{Mean Radial Spherical Error}
where \(\mathrm{RMS}_{i},\; i\in\{x,y,z\}\) are the RMS for the \(x\), \(y\) and \(z\) components respectively.

\lipsum[66]
\end{document}

在此处输入图片描述

相关内容