TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to have the entire last line in a box, but when I compile, it only boxes the first equation and doesn't even print the second equation. Does anyone know how to fix this?

Here's my MWE.



    \left| x \right. & \left. - 2 \right| & &=1 &\\
    x - 2 &= 1& &\text{ or } & x - 2 &= -1\\
    \Aboxed{x &= 3& &\text{ or }& x &= 1}


I was going to include an image of what it produces, but it won't let me since I'm a new user. :)

share|improve this question
up vote 3 down vote accepted

It possible to create a box of the correct width to span across the entries in the last row manually:

enter image description here

\usepackage{amsmath}% http://ctan.org/pkg/amsmath

  \left| x \right. & \left. - 2 \right| & &=1 &\\
  x - 2 &= 1& &\text{ or } & x - 2 &= -1\\
  \rlap{\kern\dimexpr-\fboxsep-\fboxrule\relax\fbox{\phantom{$x=3\text{ or\ \ }x - 2 = 1$}}}% Phantom box
  x &= 3& &\text{ or }& x &= 1


The approach here is to create a box with fake (or \phantom) content that matches the output generated via alignat*. Minor \kerning allows for appropriate placement due to \fbox separation (\fboxsep) and rule width (\fboxrule).

share|improve this answer
Werner, thank you. I'd prefer something less "manual-formatty", but this works! – Keila Sep 10 '12 at 22:24
@Keila: Less manual could require an overlay using something like tikz. – Werner Sep 10 '12 at 22:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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