带缩进的数学方程

带缩进的数学方程

我想使用 \mathindent 将所有数学公式从左边距移动 60pt。但是当公式超出文本宽度时,该特定公式将从右向左对齐。

请参阅我的 MWE 如下

\documentclass{book}

\usepackage{amssymb,amsfonts}
\usepackage[fleqn]{amsmath}
\setlength{\mathindent}{60pt}


\begin{document}

A standard data availability statement has been added to your article, based on the information you gave in your submission. This text cannot be changed unless there is an error. Please remove any other data statement if the information is now duplicated.\vspace*{12pt}

{\noindent\large\textbf{Need to move right to left align}}

\begin{equation}
X^T = \left({S_1^T,S_2^T,\ldots,S_T^T} \right), X^S = \left( {S_1^B,S_2^B,\ldots,S_B^B} \right) X^T = \left({S_1^T,S_2^T,\ldots,S_T^T} \right).
\end{equation}

A standard data availability statement has been added to your article, based on the information you gave in your submission. This text cannot be changed unless there is an error. Please remove any other data statement if the information is now duplicated.\vspace*{12pt}

{\noindent\large\textbf{Correct One}}

\begin{equation}
X^T = \left({S_1^T,S_2^T,\ldots,S_T^T} \right), X^S = \left( {S_1^B,S_2^B,\ldots,S_B^B} \right)
\end{equation}

A standard data availability statement has been added to your article, based on the information you gave in your submission. This text cannot be changed unless there is an error. Please remove any other data statement if the information is now duplicated.\vspace*{12pt}

{\noindent\large\textbf{Need to move slightly left}}

\begin{align}
A_b^s = {F_{\textrm{{sAvg}}}}\left( {{A_b}^\mathrm{avg}} \right) &= \frac{1}{{H \times W}}\sum\limits_{h = 1}^H {\sum\limits_{w = 1}^W {{A_b}^\mathrm{avg}\left( {h,w} \right)}} {A_{h,w,b}}^\mathrm{avg} = {F_{\textrm{{cAvg}}}}\nonumber\\
X^T &= \left({S_1^T,S_2^T,\ldots,S_T^T} \right), X^S = \left( {S_1^B,S_2^B,\ldots,S_B^B} \right)
\end{align}


A standard data availability statement has been added to your article, based on the information you gave in your submission. This text cannot be changed unless there is an error. Please remove any other data statement if the information is now duplicated.\vspace*{12pt}

{\noindent\large\textbf{Correct One}}
% \setlength{\mathindent}{0pt}
\begin{align}
A_b^s &= {F_{\textrm{{sAvg}}}}\left( {{A_b}^\mathrm{avg}} \right) = \frac{1}{{H \times W}}\sum\limits_{h = 1}^H {\sum\limits_{w = 1}^W {{A_b}^\mathrm{avg}\left( {h,w} \right)}} {A_{h,w,b}}^\mathrm{avg} \nonumber\\
X^T &= \left({S_1^T,S_2^T,\ldots,S_T^T} \right), X^S = \left( {S_1^B,S_2^B,\ldots,S_B^B} \right)
\end{align}


\end{document}

答案1

一个简单的解决方案:在必要时使用fleqn环境(来自nccmath):

    \documentclass{book}

    \usepackage{amssymb,amsfonts}
    \usepackage[fleqn]{amsmath}
    \setlength{\mathindent}{60pt}
    \usepackage{nccmath}
    \usepackage{showframe}
    \renewcommand{\ShowFrameLinethickness}{0.3pt}

    \begin{document}

    A standard data availability statement has been added to your article, based on the information you gave in your submission. This text cannot be changed unless there is an error. Please remove any other data statement if the information is now duplicated.\vspace*{12pt}

    {\noindent\large\textbf{Need to move right to left align}}
    \begin{fleqn}%[60pt]
    \begin{equation}
    X^T = \left({S_1^T,S_2^T,\ldots,S_T^T} \right), X^S = \left( {S_1^B,S_2^B,\ldots,S_B^B} \right) X^T = \left({S_1^T,S_2^T,\ldots,S_T^T} \right).
    \end{equation}
    \end{fleqn}

    A standard data availability statement has been added to your article, based on the information you gave in your submission. This text cannot be changed unless there is an error. Please remove any other data statement if the information is now duplicated.\vspace*{12pt}

    {\noindent\large\textbf{Correct One}}

    \begin{equation}
    X^T = \left({S_1^T,S_2^T,\ldots,S_T^T} \right), X^S = \left( {S_1^B,S_2^B,\ldots,S_B^B} \right)
    \end{equation}

    A standard data availability statement has been added to your article, based on the information you gave in your submission. This text cannot be changed unless there is an error. Please remove any other data statement if the information is now duplicated.\vspace*{12pt}

    {\noindent\large\textbf{Need to move slightly left}}
    \begin{fleqn}
    \begin{align}
    A_b^s = {F_{\textrm{{sAvg}}}}\left( {{A_b}^\mathrm{avg}} \right) &= \frac{1}{{H \times W}}\sum\limits_{h = 1}^H {\sum\limits_{w = 1}^W {{A_b}^\mathrm{avg}\left( {h,w} \right)}} {A_{h,w,b}}^\mathrm{avg} = {F_{\textrm{{cAvg}}}}\nonumber\\
    X^T &= \left({S_1^T,S_2^T,\ldots,S_T^T} \right), X^S = \left( {S_1^B,S_2^B,\ldots,S_B^B} \right)
    \end{align}
    \end{fleqn}

    A standard data availability statement has been added to your article, based on the information you gave in your submission. This text cannot be changed unless there is an error. Please remove any other data statement if the information is now duplicated.\vspace*{12pt}

    {\noindent\large\textbf{Correct One}}
    \begin{align}
    A_b^s &= {F_{\textrm{{sAvg}}}}\left( {{A_b}^\mathrm{avg}} \right) = \frac{1}{{H \times W}}\sum\limits_{h = 1}^H {\sum\limits_{w = 1}^W {{A_b}^\mathrm{avg}\left( {h,w} \right)}} {A_{h,w,b}}^\mathrm{avg} \nonumber\\
    X^T &= \left({S_1^T,S_2^T,\ldots,S_T^T} \right), X^S = \left( {S_1^B,S_2^B,\ldots,S_B^B} \right)
    \end{align}

    \end{document} 

在此处输入图片描述

相关内容