# What are the ways of centering the math formula

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 advance

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}

• Without code hard to tell... – DG' Apr 27 '19 at 9:53
• Welcome. Please add a minimal working example. – Bobyandbob Apr 27 '19 at 9:58
• Welcome to TeX.SE. There are many ways to typeset an equation displayed on a line by itself, usually (but not necessarily) centered on the line. The same goes for multi-line equations. Does the posting What are the differences between , [, align, equation and displaymath? offer some useful pointers? – Mico Apr 27 '19 at 9:58
• I would suggest you start by look at the documentation for the amsmath package. Try some of their code, and if you get stuck, make your question more specific. – Andrew Swann Apr 27 '19 at 10:01

\documentclass{article}
\usepackage{amsmath}

\usepackage{lipsum} % for dummy text

\begin{document}
\lipsum[11]
\begin{gather*}