
を使用していますamsmath[fleqn]
が、equation/align/gather 環境外の数式もインデントしたいと思っています。自然な選択は、同じ長さのamsmath
uses を使用してインデントすることですが、その方法がわかりません。\mathindent
(値を定義せずに) を使用しようとしましたが、「欠落番号」エラーが発生します。どうすればよいでしょうか? ありがとうございます
答え1
\mathindent
は長さを保持しているので、それを「使用」するには、たとえば のように実行する必要があります\hspace{\mathindent}
。興味深い例を次に示します。
\documentclass{article}
\usepackage[fleqn]{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
Some text before the equation.
\begin{equation}
f(x) = ax^2 + bx + c
\end{equation}
Some text after the equation.
\hspace*{\dimexpr\mathindent-\parindent}$f(x) = ax^2 + bx + c$
Some more text before an equation.
\[
f(x) = ax^2 + bx + c
\]
Some more text after an equation.
\end{document}
align
手動でインデントしなくても、番号なしの方程式を記述できることに注意してください。たとえば、の星印付きバージョンを使用することもできます。