0

I am trying to split an equation over two lines but when I do it doesn't centre in the middle of the page.

Here is my code:

\begin{subequation}
\begin{align}
\centering
    \begin{split}
      \textit{SOC}= \alpha + \beta_1\textit{Only languages} + \beta_2\textit{Languages with other subject} \\*+ \beta_3\textit{Social Sciences} + \beta_4\textit{STEM }+ \sum Y + \epsilon
    \end{split}
\tag{2B}
\end{align}
\end{subequation}

and this is what comes up:

enter image description here

4
  • What exactly do you expect?
    – Bernard
    Apr 16, 2021 at 10:04
  • @Bernard can it not be centered in the middle of the page? just seems like its aligned to the right hand side of the page at the moment
    – susan
    Apr 16, 2021 at 10:11
  • The whole block of equations is centred, but the inner alignment is to the right (not the right of the page) because you didn't mark any algnment point
    – Bernard
    Apr 16, 2021 at 11:20
  • First of all, remove \centering that's out of place there.
    – egreg
    Apr 16, 2021 at 13:41

1 Answer 1

3

Three ways of splitting an equation over 3 lines

There are many ways to split an equation over two lines and most have different justifications. The first way shown is what was in the question. There are two problems with this code. First the \centering is not needed and second the align environment is used but no align marks, &, are included so everything is automatically aligned to the right. Two other ways of splitting up an equation are multline (notice only one i, not multiline) and gather. For centering both parts you probably want gather.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
    With \verb|multline|
    \begin{subequations}
        \begin{multline}
            \textit{SOC}= \alpha + \beta_1\textit{Only languages} + \beta_2\textit{Languages with other subject} \\*+ \beta_3\textit{Social Sciences} + \beta_4\textit{STEM }+ \sum Y + \epsilon
            \tag{2B}
        \end{multline}
    \end{subequations}
    With \verb|gather|
    \begin{subequations}
        \begin{gather*}
            \textit{SOC}= \alpha + \beta_1\textit{Only languages} + \beta_2\textit{Languages with other subject} \\*+ \beta_3\textit{Social Sciences} + \beta_4\textit{STEM }+ \sum Y + \epsilon
            \tag{2B}
        \end{gather*}
    \end{subequations}
\end{document}

Note that the amsmath environment is subequations (with an s on the end) not subequation.

5
  • great, thank you!
    – susan
    Apr 16, 2021 at 11:32
  • @DavidCarlisle makes a good point, that was just copied from the question, I'll make a note of this in the answer.
    – Willoughby
    Apr 16, 2021 at 13:37
  • 2
    @Willoughby I know:-) but code in questions is supposed to be wrong: code in answers is supposed to be right (because people copy code from answers even if you add a note saying it's wrong) Apr 16, 2021 at 13:41
  • @DavidCarlisle Good point again, I'll just remove it as its in the question
    – Willoughby
    Apr 16, 2021 at 13:43
  • 1
    +1 then, thanks for putting up with my complaints:-) Apr 16, 2021 at 14:21

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.