14

In Mathjax, how do I write this as a two-liner separated by the second =?

enter image description here

This is the Mathjax code:

$= 2[2W(k-2) + (k-1)2^{k-1}] + k2^k= 2^2W(k-2)+(k-1)2^{k-1}+ k2^k$

What do I need to change to add a new line before the second = sign?

ThisClark
  • 14,352
  • 10
  • 69
  • 100

1 Answers1

19

Use \\ for Mathjax newline.

Way easier than expected, plus this was already answered here - http://meta.math.stackexchange.com/questions/11720/new-line-within-mathjax

$= 2[2W(k-2) + (k-1)2^{k-1}] + k2^k\\= 2^2W(k-2)+(k-1)2^{k-1}+ k2^k$
                                   ^^ 
                                   slashes here
ThisClark
  • 14,352
  • 10
  • 69
  • 100
  • In my case, I see that different screen size supports different number of chars in a line so I don't know in advance from which position I should break it. Is there any way that render engine of Mathjax can take care of it automatically with some config set? – Irfan Raza Oct 17 '18 at 04:44
  • That's a good question. You should ask it in a separate post here. Unfortunately, I have very little knowledge of Mathjax and was only able to answer my own question because someone else already did on math exchange. – ThisClark Oct 17 '18 at 04:45