1

I ran into a very odd problem, which is illustrated in the following code sample:

\documentclass{scrartcl}
\usepackage{amsmath}

\begin{document}
\begin{equation}
  \begin{aligned}
    a=&b\times c \sqrt{\kappa}\\
    =&def.
  \end{aligned}
\end{equation}
\begin{equation}
  \begin{aligned}
    a&=b\times c \sqrt{\kappa}\\
    &=def.
  \end{aligned}
\end{equation}
\end{document}

The position of the ampersand modifies the amount of space after the equation sign, which looks ugly and is not intended (at least I cannot come up with a reason why that would be). Any ideas how I could fix this?

enter image description here

  • 3
    Yes, use the correct one: &= not =&. – Werner Nov 15 '15 at 1:19
  • But when I have to break one line of my equation in two I would like to do a=&b \\ &+c, such that the plus is not aligned with = – Daniel Nov 15 '15 at 1:37
  • 2
    @Daniel better really to use split on the rhs rather than split a singlle equations over multiple lines of an align – David Carlisle Nov 15 '15 at 1:40
  • You should have put that information in the question. Good things come to those who put the information in the question :) The more relevant information you give us, the better your answers will be and it will also (in some cases) save users from wasting time interrogating you, or else posting perfectly good answers which then become worthless when more information is added. Help us to help you, yes? :) – Au101 Nov 15 '15 at 1:41
  • Okay, in that case I was mistaken about what purpose aligned serves. Thank you! @Au: understood – Daniel Nov 15 '15 at 1:43
7

If a binary relation such as = is used at the end or start of math list it does not get the additional space at the end of the list. align is designed to be used with &= and adds a {} at the start of the second column, so the effective list is ${}=def$ and you get space either side of the =.

There are some rare occasions where it is convenient to move the alignment point to the right of the relation, in which case you need to add the {} at the end of the first column.

enter image description here

\documentclass{scrartcl}
\usepackage{amsmath}

\begin{document}
\begin{equation}
  \begin{aligned}
    a={}&b\times c \sqrt{\kappa}\\
    ={}&def.
  \end{aligned}
\end{equation}
\begin{equation}
  \begin{aligned}
    a&=b\times c \sqrt{\kappa}\\
    &=def.
  \end{aligned}
\end{equation}
\end{document}
  • I was using \, which worked as well, but I was hoping for a more general solution. From your answer I gather that this is not possible. – Daniel Nov 15 '15 at 1:40
  • 1
    @Daniel {} gives the correct space \, is smaller. But in either case it should only be needed very rarely – David Carlisle Nov 15 '15 at 1:43

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.