[Tex/LaTex] why the formula doesn’t align left with “flalign*”

align

I want to make my formula align left, so I write like this:

\documentclass[UTF8]{ctexart}
\usepackage[fleqn]{lmodern,amsmath}

\title{标题}
\author{roger}
\begin{document}
公式如下:
\begin{flalign*}
d1 = (x_1, ...x_N) \\
BM25(w_i, d1) = \frac{(k+1)c(w_i, d1)}{c(w_i, d1) + k(1 - b + b\frac{|d|}{avdl})} \\
x_i = \frac{BM25(w_i, d1)}{\Sigma_{j=1}^NBM25(w_j, d1)}
\end{flalign*}
\end{document}

Here is my result:
this is my result

Best Answer

flalign is a variant of align but uses the full width of the page (length of the line, hence fl). Like the other AMS alignments it is designed to set equations as pairs of columns with a left column right aligned (typically to &=) and a left column left aligned, and then the next two columns again being right-left aligned.

You have specified no alignment points so the entire structure is in the first, right aligned part of the first equation.

You want &= on each row, and perhaps use align rather than flalign.

enter image description here

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


\author{roger}
\begin{document}
zzz:
\begin{flalign*}
d1 = (x_1, ...x_N) \\
BM25(w_i, d1) = \frac{(k+1)c(w_i, d1)}{c(w_i, d1) + k(1 - b + b\frac{|d|}{avdl})} \\
x_i = \frac{BM25(w_i, d1)}{\Sigma_{j=1}^NBM25(w_j, d1)}
\end{flalign*}


zzz:
\begin{flalign*}
\mathrm{d1} &= (x_1, ...x_N) \\
\mathrm{BM25}(w_i, \mathrm{d1}) &= \frac{(k+1)c(w_i, \mathrm{d1})}{c(w_i, \mathrm{d1}) + k(1 - b + b\frac{|d|}{avdl})} \\
x_i &= \frac{\mathrm{BM25}(w_i, \mathrm{d1})}{\Sigma_{j=1}^N\mathrm{BM25}(w_j, \mathrm{d1})}
\end{flalign*}


zzz:
\begin{align*}
\mathrm{d1} &= (x_1, ...x_N) \\
\mathrm{BM25}(w_i, \mathrm{d1}) &= \frac{(k+1)c(w_i, \mathrm{d1})}{c(w_i, \mathrm{d1}) + k(1 - b + b\frac{|d|}{avdl})} \\
x_i &= \frac{\mathrm{BM25}(w_i, \mathrm{d1})}{\Sigma_{j=1}^N\mathrm{BM25}(w_j, \mathrm{d1})}
\end{align*}
\end{document}