我正在尝试创建一个线性程序
如同:
有人可以帮忙吗?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{thmtools}
\setlength\parindent{0pt}
\theoremstyle{definition}
\newtheorem{definition}{Definition}[section]
\theoremstyle{plain}
\declaretheorem[name=Theorem, numberwithin=section]{thm}
\declaretheorem[name=Lemma, numberwithin=section]{lem}
\declaretheorem[name=Proposition, numberwithin=section]{prop}
\declaretheorem[name=Corollary, numberwithin=section]{cor}
\declaretheorem[name=Conjecture, numberwithin=section]{conj}
\declaretheorem[name=Claim, numberwithin=section]{claim}
\theoremstyle{remark}
\newtheorem{remark}{Remark}[section]
\newtheorem{example}{Example}[section]
\usepackage{hyperref}
\begin{document}
\section{Introduction}
\begin{equation*}
\begin{aligned}
& \text{maximize}
& f(x) \\
& \text{subject to}
& x_1+x_2 = 8\\
& & x_3 + x_4 = 2
\end{aligned}
\end{equation*}
\bibliographystyle{plain}
\bibliography{references}
\end{document}
答案1
答案2
对齐环境的每一行都以 & 开头。删除它并将每行上剩余的 & 替换为 &~。