1

I would like to align equations separated by paragraphs while retaining there auto-generated label and \listof label for after the toc. How would I align these equations and keep the \listofmyequations and \label intact?

\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}

I have tried \intertext and \shortintertext but failed. Perhaps I am placing these incorrectly. I don't know.

3 Answers 3

1

In your MWE replace

\usepackage{amsmath,amssymb,amsthm}

with

\usepackage[fleqn,reqno]{amsmath}
\setlength{\mathindent}{3pc} % or another length to suit you
\usepackage{amssymb,amsthm}
2
  • your answer indents the equations. I would like to align the equations please.
    – arkriger
    Apr 26, 2022 at 20:21
  • @arkriger I took "align" to mean that the start of each equation was the same distance from the lefthand margin' which is what my answer provided. I had no idea, as shown in the other answer, that you wanted the "=" signs to be vertically aligned. Apr 27, 2022 at 18:21
1

The solution was to remove the equation and go with align and \intertext{ with \myequations{name of the equation} inside the intertext}.

This might be a bit long-winded but keeps the \listofmyequations intact and references the auto-generated \label correctly.

\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}

enter image description here

4
  • where should not be indented.
    – Sigur
    Apr 27, 2022 at 17:50
  • @Sigur You are right. thank you. \noindent added.
    – arkriger
    Apr 29, 2022 at 15:20
  • The problem is the vertical spaces between equations and texts. It is not natural, IMO.
    – Sigur
    Apr 29, 2022 at 15:42
  • @Sigur you could try \vspace{some value} before the \indent or \noindent.
    – arkriger
    Apr 30, 2022 at 8:57
0

A small variation of OP answer (+1), which result (to my opinion) in better looking page. You may find the following suggestions useful:

  • redefined is \myequations
  • successive `intertext are merged in one
  • defined is new command for simulating paragraphs in \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}

enter image description here

enter image description here

Edit: However, it is not clear, why is needed such complicated structure of this equation. That equation on this page are aligned at =?

Well, this is mater of personal taste. I do not see any advantages. More usual way of writing text at least is much simpler and consequently less error prone:

\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}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.