수학을 왼쪽으로 정렬

수학을 왼쪽으로 정렬

수학을 왼쪽으로 정렬해야 합니다. 명령 [fleqn]에 옵션을 추가하려고 했습니다 \documentclass. 작동하지만 이제 문서의 모든 방정식이 내가 원하는 것이 아닌 왼쪽으로 정렬됩니다.

내 LaTeX 코드는 다음과 같습니다

\documentclass{article}

\usepackage{amsmath}

\begin{document}

Classic math which I don't want align to the left

\[
    2x + 5
\]

Multiline math which must be left-aligned   

\begin{gather*}
    x^2 + 3 \\
    2x - 5
\end{gather*}

\end{document}

gather*환경은 예시로만 사용됩니다. gather*내 요구에 적합한 환경이 있습니까 ? 감사해요

답변1

그것은 다소 이상한 요구 사항입니다. 아마도 가장 쉬운 것은 $$대신에 를 사용하는 것입니다 \[. $$공식적으로 지원되지 않는 구문입니다. 주요 문제는 지원된다는 것입니다.~ 아니다fleqn+ 당신이 여기서 원하는 것과 정확히 일치하는 것으로 보이는 작업 .

참고 디스플레이 수학 위에 빈 줄을 두지 마십시오 $$.\[\begin{align}

여기에 이미지 설명을 입력하세요

\documentclass[fleqn]{article}

\usepackage{amsmath}

\begin{document}

Classic math which I don't want align to the left
$$
    2x + 5
$$

Multiline math which must be left-aligned   
\begin{gather*}
    x^2 + 3 \\
    2x - 5 \\
\end{gather*}

\end{document}

답변2

gathered환경 에서 중첩을 수행할 수 있습니다 flalign(*).

\documentclass{article}

\usepackage{mathtools}
\usepackage[showframe]{geometry}

\begin{document}

Classic math which I don't want align to the left

\begin{equation}
\begin{gathered}
    x^2 + 3 \\
    2x - 5 = z
    \end{gathered}
\end{equation}

Multiline math which must be left-aligned
\begin{flalign}
\hskip\parindent & \begin{gathered}
    x^2 + 3 \\
    2x - 5 = z
    \end{gathered} &
\end{flalign}

\end{document} 

여기에 이미지 설명을 입력하세요

관련 정보