如何在单一数学模式环境中排版居中且对齐的方程式以及附加的左齐/右参差不齐标记的互文?

如何在单一数学模式环境中排版居中且对齐的方程式以及附加的左齐/右参差不齐标记的互文?

我正在使用 LuaLaTeX 和scrbook类。以下是我想要排版的内容:

在此处输入图片描述

我尝试使用与可调shortintertexts 和align/alignat环境相关的几个有用的宏来排版这个 TeX SE 答案还有这个。

这是我的 MWE:

\documentclass[%
% draft,
twoside,
DIV=15, % division factor
BCOR=12.5mm, % binding correction
headsepline=1.5pt, % header line
footsepline=0.4pt, % footer line
]{scrbook} % 11pt, a4paper (default)
\usepackage{scrhack}
\usepackage[automark]{scrlayer-scrpage}
\usepackage[english]{babel}
\usepackage[babel]{microtype}
\usepackage{mathtools, amssymb}
\usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math} % Math fonts
    \setmathfont{Latin Modern Math}
\usepackage{setspace}\setdisplayskipstretch{}
\usepackage{enumitem}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        % \adjintertext custom spacing \intertext macro
    \MHInternalSyntaxOn
    \newcommand{\adjintertext}[3]% #1=above skip, #2=below skip, #3=text
    {\ifvmode\else\\\@empty\fi
      \noalign{%
        %\penalty\postdisplaypenalty\vskip\belowdisplayskip
        \vskip-\lineskiplimit      % CCS
        \vskip\normallineskiplimit % CCS
        \vskip#1
        \vbox{\normalbaselines
            \ifdim
            \ifdim\@totalleftmargin=\z@
                \linewidth
            \else
                -\maxdimen
            \fi
            =\columnwidth
            \else \parshape\@ne \@totalleftmargin \linewidth
            \fi
        \noindent#3\par}%
        %\penalty\predisplaypenalty\vskip\abovedisplayskip%
        \vskip-\lineskiplimit      % CCS
        \vskip\normallineskiplimit % CCS
        \vskip#2
    }}%
    \MHInternalSyntaxOff
        % altalign environment (align with no horizontal spaces like alignat)
    \newenvironment{altalign}{\alignat{99}}{\endalignat}
    \catcode`*=11
    \newenvironment{altalign*}{\alignat*{99}}{\endalignat*}
    \catcode`*=12
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
    \onehalfspacing
    \KOMAoptions{DIV=current}
    \addtokomafont{pagenumber}{\normalsize\bfseries\sffamily} % page number font
    \ifoot*{} % inner footer
    \cfoot*{} % central footer
    \ofoot*{\pagemark} % outer footer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{altalign*}
    \adjintertext{0pt}{-16.40pt}{For any numbers \(a\)} \tag{P'10} \\
        & \text{(i) } &&  a &&= b, && \\
        & \text{(ii) } && a &&< b, && \\
        & \text{(iii) } && b &&< a. && \\[10pt]
    \adjintertext{0pt}{-16.40pt}{For any numbers \(a\), \(b\), and \(c\), if \(a < b\) and \(b < c\), then \(a < c\).} \tag{P'11} \\
    \adjintertext{0pt}{-16.40pt}{For any numbers \(a\), \(b\), and \(c\), if \(a < b\), then \(a + c < b + c\).} \tag{P'12} \\
    \adjintertext{0pt}{-16.40pt}{For any numbers \(a\), \(b\), and \(c\), if \(a < b\) abd \(0 < c\), then \(ac < bc\).} \tag{P'13}
\end{altalign*}
\end{document}

到目前为止,我对结果非常满意(即使它不是最有效的),但唯一让我感到矛盾的是,我如何通过反复试验,使用负垂直空间强行使\tags 与 s 保持水平。\adjintertext

我的问题是:

如何在单一数学模式环境中排版居中且对齐的方程式,以及附加的前部和后部左对齐/右不齐标记的互文?

谢谢。

答案1

您可以使用和\shortintertext来完成此操作,尽管我认为这对读者来说不是很清楚。mathtoolsflalign

\documentclass{article}
\usepackage{mathtools}

\usepackage{showframe,lipsum} % these are just for the example

\begin{document}

\lipsum[1][1-4]
\begin{flalign*}
& \text{For any numbers \(a\)}
&& \tag{P'10} \\
\shortintertext{\centering
  $\begin{alignedat}{2}
     & \text{(i) }   & a &= b, \\
     & \text{(ii) }  & a &< b, \\
     & \text{(iii) } & b &< a.
  \end{alignedat}$%
}
& \text{For any numbers \(a\), \(b\), and \(c\), if \(a < b\) and \(b < c\), then \(a < c\).}
&& \tag{P'11} \\
& \text{For any numbers \(a\), \(b\), and \(c\), if \(a < b\), then \(a + c < b + c\).}
&& \tag{P'12} \\
& \text{For any numbers \(a\), \(b\), and \(c\), if \(a < b\) abd \(0 < c\), then \(ac < bc\).}
&& \tag{P'13}
\end{flalign*}
\lipsum[2][1-5]

\end{document}

在此处输入图片描述

相关内容