寬方程式和 fleqn 左邊距對齊

寬方程式和 fleqn 左邊距對齊

是否可以強制 Latex 保持寬方程式的左邊距?

我有一個文檔,其中fleqn啟用了左對齊所有方程式的選項。如果方程式比可用空間長,LaTeX 會將方程式向左移動,如果無法產生足夠的空間,則將方程式標籤移到下一行。我想強制 LaTeX 始終保持左邊距,即使方程式比可用空間長。我想在整個文件中強制執行這一點,即使是以違反右邊距為代價。有什麼辦法可以實現這一點嗎?

問題範例

微量元素:

\documentclass{article}
\usepackage[fleqn]{amsmath}
\begin{document}

What I have now:
\begin{equation}
    f(x) = x^2
\end{equation}
\begin{equation}
    f(x) = x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^{10} + x^{11} + x^{12} + x^{13} + x^{14} + x^{15} + x^{16}
\end{equation}
\begin{equation}
    f(x) = x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^{10} + x^{11} + x^{12} + x^{13} + x^{14} + x^{15} + x^{16} + x^{17}
\end{equation}
\begin{equation}
    f(x) = x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^{10} + x^{11} + x^{12} + x^{13} + x^{14} + x^{15} + x^{16} + x^{17} + x^{18}
\end{equation}

What I want:
\begin{equation}
    f(x) = x^2
\end{equation}
\begin{equation}
    \qquad\,\, f(x) = x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^{10} + x^{11} + x^{12} + x^{13} + x^{14} + x^{15} + x^{16}
\end{equation}
\begin{equation}
    \qquad\,\,\, f(x) = x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^{10} + x^{11} + x^{12} + x^{13} + x^{14} + x^{15} + x^{16} + x^{17}
\end{equation}
\begin{equation}
    \qquad\,\,\,f(x) = x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^{10} + x^{11} + x^{12} + x^{13} + x^{14} + x^{15} + x^{16} + x^{17} + x^{18}
\end{equation}
\end{document}

答案1

我會打破長期條款。無論如何,你是最終的評判者。

使用gather

\documentclass{article}
\usepackage[fleqn]{amsmath}

\begin{document}

\begin{equation}
0=0
\end{equation}
Now let's see the result
\begin{gather}
  f(x) = x^2
\\
  f(x) = x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^{10} 
       + x^{11} + x^{12} + x^{13} + x^{14} + x^{15} + x^{16}
\\
  f(x) = x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^{10}
       + x^{11} + x^{12} + x^{13} + x^{14} + x^{15} + x^{16} + x^{17}
\end{gather}
It also works for a single equation
\begin{gather}
  f(x) = x^2 + x^3 + x^4 + x^5 + x^6 + x^7 + x^8 + x^9 + x^{10}
       + x^{11} + x^{12} + x^{13} + x^{14} + x^{15} + x^{16} + x^{17} + x^{18}
\end{gather}

\end{document}

在此輸入影像描述

相關內容