如何將方程式放在左邊緣?

如何將方程式放在左邊緣?

所以,我是 LaTeX 的新手,但仍然不知道如何使用某些功能。問題是,我不明白如何替換左邊緣而不是中心的方程式系統?我見過一些類似的在這裡提問和給出的提示,但仍然不明白我該怎麼做,我在我的文本中做到這一點。

這是我的程式碼:

\documentclass[14pt]{article}
\usepackage{graphicx}
\usepackage{amsmath}

\begin{document}
\textbf{№1}
\begin{equation*}
    \begin{cases}
    x \equiv 48 (mod 86) \\
    x \equiv 11 (mod 19) \\ 
    x \equiv 15 (mod 39) \\
    \end{cases}\
\end{equation*}
\end{document}

這是重新編譯後的樣子: 這是重新編譯後的樣子:

但我想把方程式放在左邊。誰能解釋一下我該怎麼做?

答案1

這個想法是使用fleqn.

您可以\mathindent依照自己的喜好進行設定。在以下範例中,它是在文件中設定的,但您應該在序言中設定它,以便在整個文件中使用該值。

請注意,這cases並不是真正正確的工具。並且絕對(mod86)是錯誤的。請參閱 的用法\pmod

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

\newenvironment{system}{%
  \!\left\lbrace
  \renewcommand{\arraystretch}{1.2}% like cases does
  \begin{array}{@{}l@{}}%
}{\end{array}\right.\kern-\nulldelimiterspace}

\begin{document}

This part has a left aligned equation, but slightly indented,
which is more common:
\begin{equation*}
\begin{system}
  x \equiv 48 \pmod{86} \\
  x \equiv 11 \pmod{19} \\ 
  x \equiv 15 \pmod{39}
\end{system}
\end{equation*}

\bigskip

\setlength{\mathindent}{0pt}

This part has a left aligned equation, set at the left edge,
which is less common:
\begin{equation*}
\begin{system}
  x \equiv 48 \pmod{86} \\
  x \equiv 11 \pmod{19} \\ 
  x \equiv 15 \pmod{39}
\end{system}
\end{equation*}

\end{document}

在此輸入影像描述

有什麼使用價值\mathindent?我不會將其設為零。如果您使用fleqn,您還應該leqno在左側添加方程式編號,零\mathindent將不起作用。為什麼leqno?因為等式設定在左邊時,右邊距的數字會離得太遠。

查看以下輸出並自行判斷。

\documentclass[12pt]{article}
\usepackage[fleqn,leqno]{amsmath}

\newenvironment{system}{%
  \!\left\lbrace
  \renewcommand{\arraystretch}{1.2}% like cases does
  \begin{array}{@{}l@{}}%
}{\end{array}\right.\kern-\nulldelimiterspace}

\begin{document}

This part has a left aligned equation, but slightly indented,
which is more common:
\begin{equation*}
\begin{system}
  x \equiv 48 \pmod{86} \\
  x \equiv 11 \pmod{19} \\ 
  x \equiv 15 \pmod{39}
\end{system}
\end{equation*}
This part has a left aligned equation, but slightly indented,
which is more common:
\begin{equation}
\begin{system}
  x \equiv 48 \pmod{86} \\
  x \equiv 11 \pmod{19} \\ 
  x \equiv 15 \pmod{39}
\end{system}
\end{equation}

\bigskip

\setlength{\mathindent}{0pt}

This part has a left aligned equation, set at the left edge,
which is less common:
\begin{equation*}
\begin{system}
  x \equiv 48 \pmod{86} \\
  x \equiv 11 \pmod{19} \\ 
  x \equiv 15 \pmod{39}
\end{system}
\end{equation*}
This part has a left aligned equation, set at the left edge,
which is less common:
\begin{equation}
\begin{system}
  x \equiv 48 \pmod{86} \\
  x \equiv 11 \pmod{19} \\ 
  x \equiv 15 \pmod{39}
\end{system}
\end{equation}

\end{document}

在此輸入影像描述

答案2

https://tex.stackexchange.com/a/304347/246082

基本上,

\usepackage[fleqn]{amsmath}

會完成工作的。

在此輸入影像描述

對於 Plain TeX,這通常是透過

\everydisplay{\leftdisp}
\def\leftdisp#1$${%
    \hbox to \displaywidth{\kern\parindent$\displaystyle{#1}$}$$}

(使用的TeXbook答案\leftline會給出一個框過滿的警告。)也改變\everydisplay這種方式會與 LaTeX 衝突,特別是amsmath包裝。

相關內容