\begin{align}
\max \quad & b_s \\
\text{s.t.} \quad & Af = b \\
\quad & b_d = - b_s \\
\quad & b_i = 0 \forall i \neq s, t \\
\quad & 0 \leq f_{ij} \leq \infty
\end{align}
我想让等号对齐,但我无法让它工作。有人能帮忙吗?
答案1
你是这个意思吗?
\begin{align}
\max \quad & b_s \\
\text{s.t.} \quad Af & = b \\
\quad b_d & = - b_s \\
\quad b_i & = 0 \quad \forall i \neq s, t \\
\quad 0 \leq & f_{ij} \leq \infty
\end{align}
答案2
也许你正在寻找
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\max \quad b_s \\
\text{s.t.} \quad Af & = b \\
b_d & = - b_s \\
b_i & = 0,\ \forall i \neq s, t \\
0 & \leq f_{ij} \leq \infty
\end{align}
\end{document}
还有一个特定的包optidef
,带有选项maxi!
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage{optidef}
\begin{document}
\begin{maxi!}|s|[2]<b>
{}{b_s}{}
{}
\addConstraint{Af}{=b}
\addConstraint{b_d}{=-b_s}
\addConstraint{b_i}{=0, \quad \forall i \neq s, t}
\addConstraint{}{0 \leq f_{ij} \leq \infty}
\end{maxi!}
\end{document}