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

Is there any way to 'phantom' text within the align environment?

I have the following code:

a & = b \\
& = c

Apparently, if there a tab alignment character in the argument of the phantom command, compilation will stop. I was trying to make the text within the align environment appear as blank text. Curiously, if I have a cases environment with the tab alignment character inside it, phantom will work when it surrounds the cases environment.


share|improve this question
you could \phantom each individual 'cell' – cmhughes Aug 27 '12 at 1:20
you could pack the alignment in a minipage with the \phantom wrapped around that, but unfortunately it would foul up the vertical spacing. – barbara beeton Aug 27 '12 at 12:57
up vote 11 down vote accepted

If you "hide" the tab alignment & from align, it will fail to work as expected. This is only because & is read as part of the argument to \phantom, which knowns nothing about & and its use. As such, you either have to spread the \phantom across the aligned components, or use an altogether different approach:

enter image description here

\usepackage{amsmath}% http://ctan.org/pkg/amsmath
  a & = b + c \\
  \phantom{a} & \phantom{{} = b} + c \\ % Hides some components of above line
    & = d + e \\
    & \phantom{{}= d} + e % Hides some components of above line

In the above example, some components were left untouched to indicate how some spacing correction is sometimes required when using \phantom (for example, when hiding the relation =).

The reason why \phantom around an entire cases structure works is because the tab alignment character is buried within the environment where it makes sense.

share|improve this answer

It's probably easier to use textcolor with white:


You need the color package.

share|improve this answer
Unusual approach, however I don't consider it good in this case. There are two reasons: (1) unnecessary usage of colours, (2) the hidden text is still copy-pastable, which might be an issue, especially if it's hidden to achieve correct spacing, because then the text does not belong to the output but still would get copied. – yo' Aug 27 '12 at 6:18

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.