2

I have the following long equation and I want to label it but unfortunetly it appears to be too long so the label appears in next line. How can I fix this?

\documentclass{article}
\usepackage{amsmath} 
\begin{document}

\begin{equation}\label{my_eq}
\min_{f,u} \frac{1}{2} \|A(Bu -f)\|^2_2 + \lambda_1\|Cf\|_{1,p} + \lambda_2\|Du\|_{1,p} + 
\frac{\kappa}{2}\|Ef - f_0\|^2_2 + \frac{1}{2}\|E(Pu) - f_0\|^2_2
\end{equation}
\end{document}

long_equation

1 Answer 1

6

There are more options: one it is to use multline or split or to use geometry package or of the other strategies.

\documentclass{article}
\usepackage{amsmath} 
\usepackage{nccmath}

\begin{document}

\begin{multline}\label{my_eq}
\min_{f,u} \mfrac{1}{2} \|A(Bu -f)\|^2_2 + \lambda_1\|Cf\|_{1,p} + \lambda_2\|Du\|_{1,p}\\
+\mfrac{\kappa}{2}\|Ef - f_0\|^2_2 + \mfrac{1}{2}\|E(Pu) - f_0\|^2_2
\end{multline}

\end{document}

enter image description here

With the geometry package you can choose the margins of the paper.

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{amsmath} 
\usepackage{nccmath}
\begin{document}

\begin{equation}\label{my_eq}
\min_{f,u} \mfrac{1}{2} \|A(Bu -f)\|^2_2 + \lambda_1\|Cf\|_{1,p} + \lambda_2\|Du\|_{1,p} + \mfrac{\kappa}{2}\|Ef - f_0\|^2_2 + \mfrac{1}{2}\|E(Pu) - f_0\|^2_2
\end{equation}

\end{document}

enter image description here

6
  • 1
    I 'd add a {} after the + at the end of the first line, for spacing reasons
    – Bernard
    Aug 7, 2020 at 19:15
  • @Bernard Done! Approved your comment.
    – Sebastiano
    Aug 7, 2020 at 19:18
  • 1
    Maybe, also, the fraction coefficients would look nicer with medium-sized factions (\mfrac from nccmath). LaTeX makes me a bit fussy at times :-)
    – Bernard
    Aug 7, 2020 at 19:25
  • @Bernard Don't worry. I provide now to edit.
    – Sebastiano
    Aug 7, 2020 at 19:27
  • 2
    The + sign should go to the next line.
    – egreg
    Aug 7, 2020 at 21:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .