0

I have a multi-line equation that is long enough to push the number of the equation at the bottom:

\documentclass[12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage{amssymb, amsthm, amsmath, amsfonts, eurosym, newtxmath, nccmath}
\usepackage{geometry}
\geometry{left = 1.0in, right = 1.0in, top = 1.0in, bottom = 1.0in}

\begin{document}

\begin{equation}
    \begin{split}
            myverylongequation & =  something that is very long \\
%
            & =   something that is more or less long \\
%
            & =   something that is more or less long \\
%
            & = something that is very very very very very very very very very very very very long \\
    \end{split}
\end{equation}

\end{document}

What I would like to achieve is to get the number of the equation "centered," as in the following example:

\documentclass[12pt]{article}

\usepackage[utf8]{inputenc}
\usepackage{amssymb, amsthm, amsmath, amsfonts, eurosym, newtxmath, nccmath}
\usepackage{geometry}
\geometry{left = 1.0in, right = 1.0in, top = 1.0in, bottom = 1.0in}

\begin{document}

\begin{equation}
    \begin{split}
            myshortequation & =  something that is short \\
%
            & =   something that is short \\
%
            & =   something that is short \\
%
            & = something that is short \\
    \end{split}
\end{equation}

\end{document}

1 Answer 1

1

If you're happy that the last long line sticks out of the right margin use the first solution. Fine tune the factor by experiment.

If you can split it, it's better.

\documentclass[12pt]{article}

%\usepackage[utf8]{inputenc}% not necessary
\usepackage{amssymb, amsthm, amsmath}
\usepackage{newtxtext,newtxmath}
\usepackage{geometry}
\geometry{left = 1.0in, right = 1.0in, top = 1.0in, bottom = 1.0in,
  showframe % for seeing the margins
}

\newcommand{\fakewidth}[2]{%
  \makebox[#1\displaywidth][l]{\makebox[0pt][l]{$\displaystyle#2$}}%
}

\begin{document}

\begin{equation}
  \begin{split}
    myverylongequation
    & = something that is very long \\
    & = something that is more or less long \\
    & = something that is more or less long \\
    & = \fakewidth{0.65}{something that is very very very very very very very very very very very long}
  \end{split}
\end{equation}

\begin{equation}
  \begin{split}
    myverylongequation
    & = something that is very long \\
    & = something that is more or less long \\
    & = something that is more or less long \\
    & = \begin{aligned}[t]
          & something that is very very very very very \\
          & very very very very very very long
        \end{aligned}
  \end{split}
\end{equation}


\end{document}

enter image description here

You must log in to answer this question.

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