左对齐集合中的单个方程

左对齐集合中的单个方程

如何在gather环境中左对齐单个方程式?

\begin{gather}
a=1 \\ % How to left align this?
b=2 \\
\end{gather}

答案1

这实际上取决于你对单个方程式左对齐的定义。以下是一些选项:

在此处输入图片描述

\documentclass{article}
\usepackage{lipsum,mathtools}
\begin{document}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus augue velit, euismod in 
mauris sed, mattis vulputate urna. Curabitur mollis nunc arcu, eu pretium neque varius ac.
\begin{gather}
  f(x) = ax^2 + bx + c \\ % How to left align this?
  g(x) = x^2
\end{gather}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus augue velit, euismod in 
mauris sed, mattis vulputate urna. Curabitur mollis nunc arcu, eu pretium neque varius ac.
\begin{gather}
  f(x) = ax^2 + bx + c \\ % How to left align this?
  \mathrlap{g(x) = x^2}%
  \phantom{f(x) = ax^2 + bx + c}
\end{gather}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus augue velit, euismod in 
mauris sed, mattis vulputate urna. Curabitur mollis nunc arcu, eu pretium neque varius ac.
\begin{gather}
  f(x) = ax^2 + bx + c \\ % How to left align this?
  \mathmakebox[0pt]{\mathmakebox[\textwidth][l]{g(x) = x^2}}%
\end{gather}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus augue velit, euismod in 
mauris sed, mattis vulputate urna. Curabitur mollis nunc arcu, eu pretium neque varius ac.
\begin{align}
  &f(x) = ax^2 + bx + c \\ % How to left align this?
  &g(x) = x^2
\end{align}

\end{document}

相关内容