Markdown公式以不同方式对齐

需要对齐的内容以\begin{align}\end{aligned}包围,在需要对齐的符号(如等号)前加&来标记,用\\来换行。

1. 单公式以等号对齐

效果:

K P I = ( N + S ) W = N W + S W \begin{aligned} KPI&=(N+S)W \\ &=NW+SW \end{aligned} KPI=(N+S)W=NW+SW

代码:

\begin{aligned}
KPI&=(N+S)W \\
&=NW+SW
\end{aligned}

2. 多公式以等号对齐

效果:

K P I = ( N + S ) W P I = N + S I = W \begin{aligned} KPI&=(N+S)W \\ PI&=N+S \\ I&=W \end{aligned} KPIPII=(N+S)W=N+S=W

代码:

\begin{aligned}
KPI&=(N+S)W \\
PI&=N+S \\
I&=W
\end{aligned}

3. 多公式以首个字符对齐

效果:

K P I = ( N + S ) W P I = N + S I = W \begin{aligned} &KPI=(N+S)W \\ &PI=N+S \\ &I=W \end{aligned} KPI=(N+S)WPI=N+SI=W

代码:

\begin{aligned}
&KPI=(N+S)W \\
&PI=N+S \\
&I=W
\end{aligned}

你可能感兴趣的:(工具,markdown)