0

I'm using LuaLaTeX and the scrbook class. Here's what I want to typeset:

enter image description here

I tried to typeset this using several helpful macros related to adjustable shortintertexts and align/alignat environments from this TeX SE answer and also this one.

Here's my 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}

So far I'm quite satisfied with the result (even if it's not the most efficient) but the only thing I'm conflicted about is how I brute-forced the \tags to somewhat be level with the \adjintertexts by using negative vertical space via trial and error.

My question is:

How do I typeset centered and aligned equations with additional preceding and succeeding flush left / ragged right labeled intertexts in one single math mode environment?

Thank you.

1 Answers1

1

You can do it with \shortintertext of mathtools and flalign, although I don't think this is really clear for the reader.

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

enter image description here

egreg
  • 1,121,712