# Alignment and phantom

The MWE shows in the result the alignment as I need it in the first step. My questions are:

1. Now after the "1" there should appear again a "4", exactly beneath the "4" of the very first line. How can I do this?
2. Is there a more elegant solution in general (so that question 1 can be solved more easily)?

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\begin{aligned}
&&\sqrt{05\;47\;56} = 2 \\
&-&4\phantom{\sqrt{05\;47\;56}} \\
&&\rule{1cm}{0.4pt} \phantom{\sqrt{05\;47}} \\
&&1\phantom{\sqrt{05\;47\;56}}
\end{aligned}
\end{equation*}
\end{document}


You can use \mathmakebox and array. In the first column, the radical is placed as if it had the width of the radical sign (and no vinculum).

\documentclass{article}
\usepackage{amsmath,mathtools,calc}

\begin{document}

\begin{equation*}
\setlength{\arraycolsep}{0pt}
\begin{array}{r r @{\;} r @{\;} r c l}
\mathmakebox[\widthof{$\sqrt{\vphantom{0}}$}][l]{\sqrt{\phantom{05\;47\;56}}} &
05 & 47 & 56 & {}={} & 2 \\
-&   4 \\
\cline{2-2}
&   1
\end{array}
\end{equation*}

\end{document}


The complete scheme:

\documentclass{article}
\usepackage{amsmath,mathtools,calc}

\begin{document}

\begin{equation*}
\setlength{\arraycolsep}{0pt}
\begin{array}{r r @{\;} r @{\;} r c l}
\mathmakebox[\widthof{$\sqrt{\vphantom{0}}$}][l]{\sqrt{\phantom{05\;47\;56}}} &
05 & 47 & 56 & {}={} & 234 \\
\cline{6-6}
-&   4 &    &    &       & 43\cdot3=129 \\
\cline{2-2} \cline{6-6}
&   1 & 47 &    &       & 464\cdot4=1856 \\
-&   1 & 29 \\
\cline{2-3}
&     & 18 & 56 \\
-&     & 18 & 56 \\
\cline{2-4}
&     &    &  0
\end{array}
\end{equation*}

\end{document}


• Perfect. Nice that you put the complete scheme. You know what I am thinking about ;-) Commented Nov 9, 2018 at 10:28

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{align*}
\sqrt{05\;47\;56} & = 2 \\
-\enspace 4\phantom{\;47\;56} & \\[-3ex]
\rule{1.1cm}{0.4pt} \phantom{\;56} & \\[-1.5ex]
1\mathrlap{\;4}\phantom{\;47\;56} &
\end{align*}

\end{document}


• I' guess yout want to type "1\mathrlap{\;47}\phantom{\;47\;56} &" Commented Nov 9, 2018 at 4:00
• @pzorba75: Not particularly – the O.P. asked only for a $4$ after $1$ in the last row. Commented Nov 9, 2018 at 9:42