Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In my investigation, the outputs are identical as follows.

enter image description here

Version 1:

Using aligned.

\begin{align*}
\framebox[6cm]{Top LHS}\\
\framebox[5cm]{Middle LHS}\\
\framebox[4cm]{Bottom LHS}
    &= \!
         \begin{aligned}[t]
            &\framebox[6cm]{Top RHS 1}\\
            &\framebox[5cm]{Middle RHS 1}\\
            &\framebox[7cm]{Bottom RHS 1}
        \end{aligned}\\
    &= \!
         \begin{aligned}[t]
            &\framebox[6cm]{Top RHS 2}\\
            &\framebox[5cm]{Middle RHS 2}\\
            &\framebox[7cm]{Bottom RHS 2}
         \end{aligned}
\end{align*}

Version 2:

Using \hphantom.

\begin{align*}
\framebox[6cm]{Top LHS}\\
\framebox[5cm]{Middle LHS}\\
\framebox[4cm]{Bottom LHS}
    &=\framebox[6cm]{Top RHS 1}\\
    &\hphantom{{}={}}\framebox[5cm]{Middle RHS 1}\\
    &\hphantom{{}={}}\framebox[7cm]{Bottom RHS 1}\\
    &=\framebox[6cm]{Top RHS 2}\\
    &\hphantom{{}={}}\framebox[5cm]{Middle RHS 2}\\
    &\hphantom{{}={}}\framebox[7cm]{Bottom RHS 2}
\end{align*}

Complete Code:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{align*}
\framebox[6cm]{Top LHS}\\
\framebox[5cm]{Middle LHS}\\
\framebox[4cm]{Bottom LHS}
    &= \!
         \begin{aligned}[t]
            &\framebox[6cm]{Top RHS 1}\\
            &\framebox[5cm]{Middle RHS 1}\\
            &\framebox[7cm]{Bottom RHS 1}
        \end{aligned}\\
    &= \!
         \begin{aligned}[t]
            &\framebox[6cm]{Top RHS 2}\\
            &\framebox[5cm]{Middle RHS 2}\\
            &\framebox[7cm]{Bottom RHS 2}
         \end{aligned}
\end{align*}

\newpage

\begin{align*}
\framebox[6cm]{Top LHS}\\
\framebox[5cm]{Middle LHS}\\
\framebox[4cm]{Bottom LHS}
    &=\framebox[6cm]{Top RHS 1}\\
    &\hphantom{{}={}}\framebox[5cm]{Middle RHS 1}\\
    &\hphantom{{}={}}\framebox[7cm]{Bottom RHS 1}\\
    &=\framebox[6cm]{Top RHS 2}\\
    &\hphantom{{}={}}\framebox[5cm]{Middle RHS 2}\\
    &\hphantom{{}={}}\framebox[7cm]{Bottom RHS 2}
\end{align*}


\end{document}

Any positive suggestions are welcome.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

I clearly prefer the first solution because:

  1. It achieves the desired alignment with the semantics made for alignments (align and aligned). Using hand made white space (the \hphantoms) is only a last resort for me: what purpose do these alignment constructs have when I have to manually adjust stuff with white space?!

  2. It is more robust. Suppose you find out, after typing the second version, that = is the wrong relation, and needs to be replaced with a wider relation like \Coloneqq. Then you have to change all the \hphantoms in the second solution, while the first solution still works.

share|improve this answer
add comment

Your Answer

 
discard

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.