我想复制这个:
但是我得到了这个:
有人能帮帮我吗?
我的 MWE 是这样的:
\immediate\write18{makeindex \jobname.nlo -s nomencl.ist -o \jobname.nls}
\documentclass[a4paper,11pt,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage{geometry}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{tablefootnote}
\usepackage{graphicx}
\usepackage{adjustbox}
\usepackage{array}
\usepackage{mathtools}
\usepackage{float}
\usepackage{subfig}
%, nccmath}
\usepackage{siunitx}
\usepackage{mhchem}
\usepackage{chemfig}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[autostyle]{csquotes}
\usepackage{multirow}
\usepackage{xcolor}
\usepackage{booktabs}
\usepackage{soul}
\usepackage{acro}
\usepackage{pgfplots}
\usepackage{enumitem}
\usepackage{lscape}
\usepackage{tabularx}
\usepackage{nomencl}
\makenomenclature
\usepackage{amsmath}
\usepackage{lipsum}
%\usepackage[toc,page]{appendix}
%\usepackage{tikz}
\usetikzlibrary{intersections, calc}
\pgfplotsset{compat=1.14}
\usepackage{filecontents}
\acsetup{first-style=short}
\usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex}
\addbibresource{example.bib}
\begin{document}
\begin{equation}
\begin{split}
\mathbold{min}~ \nabla f(x)^{T} d + \frac{1}{2} d^{T} Hd \\
\mathbold{s.t.}~ g_{j}(x) + \nabla g_{j}(x)^{T} d \leq 0 , \quad j = 1, ..., m, \\
g_{j}(x) + \nabla g_{j}(x)^{T} d = 0 \quad j = m +1, ..., m+l,
\end{split}
\end{equation}
\end{document}
答案1
具有两个(嵌套)环境的解决方案。我删除了所有不相关的包。请注意,如果您加载,则alignedat
不必加载- 后者会为您完成:amsmath
mathtools
\documentclass[a4paper, 11pt, oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage{geometry}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\begin{alignedat}{2}
& \mathbold{min} & \enspace & \nabla f(x)^{T} d + \frac{1}{2} d^{T} Hd \\
& \mathbold{s.t.} & & \begin{alignedat}[t]{2}
g_{j}(x) + \nabla g_{j}(x)^{T} d & \leq 0 , & \quad j & = 1, ..., m, \\
g_{j}(x) + \nabla g_{j}(x)^{T} d & = 0 & j & = m +1, ..., m+l,
\end{alignedat}
\end{alignedat}
\end{equation}
\end{document}