This question already has an answer here:

How to box formulas such as

&&P(X_{n+1} = i_{n+1}\mid
X_{0}=i_{0}, X_{1}=i_{1},\ldots,X_{n-1}=i_{n-1},X_{n}=i_{n}) \\
&&=P(X_{n+1}=i_{n+1}\mid X_{n}=i_{n}).

I use amsmath package

p(x) &= 3x^6 + 14x^5y + 590x^4y^2 + 19x^3y^3\\
&- 12x^2y^4 - 12xy^5 + 2y^6 - a^3b^3

marked as duplicate by Werner math-mode Dec 6 '15 at 19:11

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Here are two versions: empheq and tcolorbox


%&&P(X_{n+1} = i_{n+1}\mid
%X_{0}=i_{0}, X_{1}=i_{1},\ldots,X_{n-1}=i_{n-1},X_{n}=i_{n}) \\
%&&=P(X_{n+1}=i_{n+1}\mid X_{n}=i_{n}).

   &P(X_{n+1} = i_{n+1}\mid X_{0}=i_{0}, X_{1}=i_{1},\dots,X_{n-1}=i_{n-1},X_{n}=i_{n}) \\
  ={}&P(X_{n+1}=i_{n+1}\mid X_{n}=i_{n})

\begin{tcolorbox}[ams align*,colback=white!40!yellow]
   &P(X_{n+1} = i_{n+1}\mid X_{0}=i_{0}, X_{1}=i_{1},\dots,X_{n-1}=i_{n-1},X_{n}=i_{n}) \\
  ={}&P(X_{n+1}=i_{n+1}\mid X_{n}=i_{n})


enter image description here

  • 1
    ={}& in both cases; and \dots, not \ldots – egreg Dec 6 '15 at 10:40
  • Thanks everybody. Do I understand correctly that I should use mathtools instead of amsmath? Replacing eqnarray* by align* did not help when I use amsmath – user164118 Dec 6 '15 at 10:54
  • @user164118: mathtools makes some additions to amsmath – user31729 Dec 6 '15 at 11:00
  • I found that \usepackage{amsmath} suffices \documentclass[a4paper,12pt]{article} \usepackage{amsmath,amsfonts} \usepackage{graphicx} \begin{document} \begin{eqnarray*} \boxed{ \begin{aligned} \hbox{}&P(X_{n+1} = i_{n+1}\mid X_{0}=i_{0}, X_{1}=i_{1},\ldots,X_{n-1}=i_{n-1},X_{n}=i_{n}) \\ \hbox{}&=P(X_{n+1}=i_{n+1}\mid X_{n}=i_{n}). \end{aligned} } \end{eqnarray*} \end{document} – user164118 Dec 6 '15 at 12:54
  • @user164118: That's another possibility, of course. But you still use the outdated eqnarray stuff. – user31729 Dec 6 '15 at 17:10

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