3

I'm trying to have all my equation aligned to the left of the document instead of the center. I'm trying with flalign but fore some strange reason I get this :

enter image description here

Here is the code :

\documentclass[11pt, french]{article} %article report  book  letter  slides
\usepackage{blindtext}
\usepackage{geometry}
 \geometry{
 a4paper,
 total={170mm,257mm},
 left=20mm,
 top=20mm,
 }
\usepackage[french]{babel}
\selectlanguage{french}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{esint}
\begin{document}
\newcommand{\prt}[2]{\frac{\partial #1}{\partial #2}}

\begin{flalign}
C_x = C_{x_0} + k{C_z}^2 && \\
\prt{f}{C_z} = \frac{0.015+\frac{{C_z}^2}{20}-\frac{{C_z}^2}{10}}{\left( 0.015+{C_z}^2 \right)^2}&&\\
\prt{f}{C_z} = 0 \Leftrightarrow C_{x_0} + k{C_z}^2 - 2k{C_z}^2 = 0 \Leftrightarrow C_z = \sqrt{\frac{C_{x_0}}{k}} = 0,548 &&\\
C_x = 0.015 + \frac{1}{20} * 0.548^2 = 0.03&&\\
f = \frac{0.548}{0.03} = 18,26 &&
\end{flalign}

\end{document}

How can I fix my problem?

3
  • 1
    \documentclass[11pt, french,fleqn]{article} Commented Nov 21, 2022 at 15:51
  • 1
    flalign is "full length align" not flush left and like all ams aligments has alignnment rlrlrl... so as you have everything in the first column it is right aligned. If you do not want to align the = use gather not (fl)align Commented Nov 21, 2022 at 15:54
  • See Align equation left which contains a more detailed explanation.
    – user202729
    Commented Dec 1, 2023 at 10:27

2 Answers 2

6

enter image description here

Use [fleqn] to get equations flush left, and use gather not align as you are not aligning on =

\documentclass[11pt, french,fleqn]{article} %article report  book  letter  slides
\usepackage{blindtext}
\usepackage{geometry}
 \geometry{
 a4paper,
 total={170mm,257mm},
 left=20mm,
 top=20mm,
 }
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\selectlanguage{french}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{esint}
\begin{document}
\newcommand{\prt}[2]{\frac{\partial #1}{\partial #2}}

\begin{gather}
C_x = C_{x_0} + k{C_z}^2  \\
\prt{f}{C_z} = \frac{0.015+\frac{{C_z}^2}{20}-\frac{{C_z}^2}{10}}{\left( 0.015+{C_z}^2 \right)^2}\\
\prt{f}{C_z} = 0 \Leftrightarrow C_{x_0} + k{C_z}^2 - 2k{C_z}^2 = 0 \Leftrightarrow C_z = \sqrt{\frac{C_{x_0}}{k}} = 0,548 \\
C_x = 0.015 + \frac{1}{20} * 0.548^2 = 0.03\\
f = \frac{0.548}{0.03} = 18,26 
\end{gather}

\end{document}
0
3

As David Carlisle has already pointed in his answer, you need to specify the option fleqn, either as an option at the document class stage or when loading the amsmath package.

I would keep using an align setup for the five questions in your sample document.

enter image description here

\documentclass[11pt,french,fleqn]{article} 
\usepackage{geometry}
\geometry{a4paper,total={170mm,257mm},left=20mm,top=20mm}
\usepackage{babel}
\usepackage{amssymb}
\usepackage{amsmath}
\newcommand{\prt}[2]{\frac{\partial #1}{\partial #2}}
\usepackage{showframe}
\begin{document}

\begin{align}
C_x &= C_{x_0} + k{C_z}^2  \\
\prt{f}{C_z} &= \frac{0.015+C_z^2/20-C_z^2/10}{(0.015+C_z^2)^2}\\
\prt{f}{C_z} &= 0 
  \quad\Longleftrightarrow\quad 
  C_{x_0} + k{C_z}^2 - 2k{C_z}^2 = 0 
  \quad\Longleftrightarrow\quad 
  C_z = \sqrt{C_{x_0}/k} = 0.548 \\
C_x &= 0.015 + (1/20) \cdot 0.548^2 = 0.03\\
f   &= 0.548/0.03 = 18.26 
\end{align}

\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .