1

so I want to have the equation numbers to be on a separate lines below the equations. My code currently is as follows:

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\begin{document}
\begin{align}
  m_{2}(\mathcal{B}_n) - m_{2}(\mathcal{A}_n) & = (m_{1}(\mathcal{A}_n) - f(\mathcal{A}_n))(\mathcal{B}_n - \mathcal{A}_n) + v(\mathcal{B}_n) - v(\mathcal{A}_n) + \frac{(\mathcal{B}_n - \mathcal{A}_n)^{2}}{2} \\
  m_{2}(\mathcal{A}_{n+1}) - m_{2}(\mathcal{B}_n) & = (m_{1}(\mathcal{B}_n) - f(\mathcal{B}_n))(\mathcal{A}_{n+1} - \mathcal{B}_n) + v(\mathcal{A}_{n+1}) - v(\mathcal{B}_n) - \frac{(\mathcal{A}_{n+1} - \mathcal{B}_n)^{2}}{2}
\end{align}
\end{document}

Any help would be gratefully appreciated, thanks :)

  • Welcome to TeX.SX! Please complete your example with documentclass, the needed packages and the document environment (make it a MWE). – TeXnician Jul 17 '17 at 17:50
  • 1
    This is indeed the case, however horrible it looks. So, if you are not getting that kind of output, what are you doing differently? – Werner Jul 17 '17 at 18:04
  • To avoid getting massively overfull lines, you have only there options: (a) introduce line breaks somewhere in the formulas; (b) widen the text block significantly; or (c) reduce the font size significantly (probably to the point of making the material indecipherable). How wide is the text block of your document at the moment, and do you the option to widen it, either globally or locally? – Mico Jul 17 '17 at 21:04
1

It's unclear what you are asking; perhaps you want to avoid the overlong line:

\documentclass{article}
\usepackage{amsmath}

\newcommand{\cvar}[1]{\mathcal{#1}}
\newcommand{\cA}{\cvar{A}}
\newcommand{\cB}{\cvar{B}}

\begin{document}

\begin{align}
m_{2}(\cB_n) - m_{2}(\cA_n)     
  & = (m_{1}(\cA_n) - f(\cA_n))(\cB_n - \cA_n) \notag \\
  &\qquad+ v(\cB_n) - v(\cA_n) + \frac{(\cB_n - \cA_n)^{2}}{2}
\\[2ex]
m_{2}(\cA_{n+1}) - m_{2}(\cB_n) 
  & = (m_{1}(\cB_n) - f(\cB_n))(\cA_{n+1} - \cB_n) \notag \\
  &\qquad+ v(\cA_{n+1}) - v(\cB_n) - \frac{(\cA_{n+1} - \cB_n)^{2}}{2}
\end{align}

\end{document}

Note the indirect way I defined \cA and \cB (use more semantic names if you wish), so you can change the appearance of all variables of that type by simply changing the definition of \cvar.

enter image description here

1

As @Werner observed, the output you say you want is exactly what you'll get with the code you provided. If this is not what you want, then try this

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
  m_{2}(\mathcal{B}_n) - m_{2}(\mathcal{A}_n) & = (m_{1}(\mathcal{A}_n) - f(\mathcal{A}_n))(\mathcal{B}_n - \mathcal{A}_n) \notag\\
  &\qquad + v(\mathcal{B}_n) - v(\mathcal{A}_n) + \frac{(\mathcal{B}_n - \mathcal{A}_n)^{2}}{2} \\
  m_{2}(\mathcal{A}_{n+1}) - m_{2}(\mathcal{B}_n) & = (m_{1}(\mathcal{B}_n) - f(\mathcal{B}_n))(\mathcal{A}_{n+1} - \mathcal{B}_n) \notag\\
  &\qquad + v(\mathcal{A}_{n+1}) - v(\mathcal{B}_n) - \frac{(\mathcal{A}_{n+1} - \mathcal{B}_n)^{2}}{2}
\end{align}
\end{document}
0

If you would rather have the line breaks occur at the = symbols, the following solution might appeal to you.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
&m_{2}(\mathcal{B}_n) - m_{2}(\mathcal{A}_n) \notag \\
&\quad= (m_{1}(\mathcal{A}_n) - f(\mathcal{A}_n))(\mathcal{B}_n - \mathcal{A}_n) 
     + v(\mathcal{B}_n) - v(\mathcal{A}_n) 
     + \frac{(\mathcal{B}_n - \mathcal{A}_n)^2}{2} \\[1ex]
&m_{2}(\mathcal{A}_{n+1}) - m_{2}(\mathcal{B}_n) \notag \\
&\quad= (m_{1}(\mathcal{B}_n) - f(\mathcal{B}_n))(\mathcal{A}_{n+1} - \mathcal{B}_n) 
     + v(\mathcal{A}_{n+1}) - v(\mathcal{B}_n) 
     - \frac{(\mathcal{A}_{n+1} - \mathcal{B}_n)^2}{2}
\end{align}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.