1

I am beginner at latex, and I am wondering how should I make the math formula centered. What I want is as shown on the picture. Also what is the best way of making spaces when writing math code? I am reffering to the spaces between min and f(x). Thanks in advanceenter image description here

My code looks like this, but there are a few problems 1) P should be in the middle of these lines and on the left of both. 2) spaces between min s.t, are there any other ways than writing a lot of \:

\begin{align} 
(P)\:\: minf(x)\\ 
s.t\:\:g(x,s)\leq 0\:\:\forall s\in\Omega 
\end{align}

1 Answers1

3

it may help you:

enter image description here

\documentclass{article}
\usepackage{amsmath}

\usepackage{lipsum} % for dummy text

\begin{document}
\lipsum[11]
\begin{gather*}
(P) \qquad\begin{aligned}
        \min    &\quad   f(x)        \\
\mathrm{s.t}    &\quad   g(x,s)\leq 0\:\:\forall s\in\Omega
          \end{aligned}
\end{gather*}
\lipsum[12]
\end{document}
Zarko
  • 296,517