複数の独立した方程式を整列させる

複数の独立した方程式を整列させる

おはよう、

複数行の式を、さらには数ページに渡って整列させる方法についての質問やチュートリアルをたくさん見つけましたが、間に段落のテキストがある複数の式を整列させる方法がわかりません。

ここに私の問題の最小限の動作例を示します。

    \documentclass[10pt,a4paper]{book}
    \usepackage[utf8]{inputenc}
    \usepackage{amsmath}
    \usepackage{amsfonts}
    \usepackage{amssymb}
    \usepackage{fleqn}
    \begin{document}
    Since we have
    \begin{equation}
        e^x = \frac{d}{dx}e^x
    \end{equation}
    and
    \begin{equation}
        e^x = \int e^x dx
    \end{equation}
    one of my students concluded that
    \begin{equation}
        \int dx = \frac{d}{dx}.
    \end{equation}
    \end{document}

これは次のようにコンパイルされます:

式 1 と 2 は完全に一致していますが、式 3 は一致していません。

ご覧のとおり、最初の 2 つの方程式は左側が同じ幅を占めているため、完全に揃っています。方程式 3 は左側が広いため揃っていません。ドキュメント全体ではないにしても、少なくとも 1 ページ上ですべての等号を揃える簡単な解決策を探しています。

私が書いている完全な文書では、方程式の間に数行の説明があり、インライン数式や参照などが含まれることもあります。そのため、数式環境内でプレーンテキストにいくつかの単語を単純に記述するソリューションは、実際には実行可能ではないと私は考えています。

私の質問が明確に述べられたことを願っております。良い一日をお過ごしください。

答え1

「数式環境内にプレーンテキストでいくつかの単語を配置する」というソリューションは実行可能ではないようだとおっしゃったことは承知しています。しかし、それでも\intertext( amsmath) コマンドと\shortintertext( mathtools) コマンドを検討する必要があるかもしれません。

これらを使用すると、インライン数式や引用を含むテキストの段落全体を数式の間に配置できます。

2 つのコマンドの違いは間隔にあります。\shortintertext以下の例に示すように、段落間のスペースが小さくなります。

\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{mathtools}

\usepackage{filecontents}

\begin{filecontents}{references.bib}
@inproceedings{TestSmith,
    title={This is a Test},
    author={Smith, John and Jones, Ben},
    booktitle={2016 Placeholder Conference on Citation Testing},
    pages={3--4},
    year={2016}
}
\end{filecontents}


\begin{document}

The "intertext" and "shortintertext" commands allow you to put text inside an align environment.
\begin{align}
c + c + e^x &= \frac{d}{dx}e^x 
\intertext{this is normal "intertext"} 
\intertext{It has large spacing between paragraphs} 
b + b + b + e^x &= \int e^x dx
\shortintertext{"shortintertext" from the "mathtools" package has smaller spacing}
\shortintertext{like this}
\int dx &= \frac{d}{dx}.
\shortintertext{This works even for multi-line paragraphs, inline math ($x=\alpha+\frac{a}{b+1}$) and citations~\cite{TestSmith}.}    
\shortintertext{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. . Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.}
\int dx &= \frac{d}{dx} + a + a + a.
\end{align}

\bibliographystyle{apalike}
\bibliography{references}

\end{document}

上記のコードの出力

答え2

\intertextニーズに十分対応できる場合は、単一ページでも複数ページでも機能します。

\documentclass[10pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[fleqn]{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
%\usepackage{fleqn}
\begin{document}

Since we have
\begin{align}
    e^x &= \frac{d}{dx}e^x
\intertext{and}
    e^x &= \int e^x dx
\intertext{one of my students concluded that.. one of my students concluded that.. one of my students concluded that..}
    \int dx &= \frac{d}{dx}.
\end{align}

\end{document}

ここに画像の説明を入力してください

関連情報