1

I'm writing the following formulas in latex and I see the elements of the first equation is spreading in the page. Here is what is what I have tried:

\usepackage{amsmath}

\begin{equation}
\min\limits_{w, \xi_n, \rho} \frac{1}{2} $$ || w || $$^2 + \frac{1}{\gamma n}\biggl(\sum_{i=1}^N \mathbf{\xi}_{i}\biggr) - \rho
\end{equation}
\State subject to:
\begin{equation}
(w \cdot \phi(x_i)) \geq \rho - \mathbf{\xi}_{i}
\end{equation}

I appreciate if anyone can help me to fix it.

What I have tried is the following equations

Shima19
  • 11
  • 3

1 Answers1

0

You can solve removing both the occurrences of $$ inside your first equation environment.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\min\limits_{w, \xi_n, \rho} \frac{1}{2} || w || ^2 + \frac{1}{\gamma n}\biggl(\sum_{i=1}^N \mathbf{\xi}_{i}\biggr) - \rho
\end{equation}

%\State 
subject to:

\begin{equation}
(w \cdot \phi(x_i)) \geq \rho - \mathbf{\xi}_{i}
\end{equation}

\end{document}

Also, I commented \State in case it is a macro, as in the first comment to your question above.

This way, you get the following output:

screenshot of output

MattAllegro
  • 6,455
  • 5
  • 45
  • 52