In this MWE I get an error. My aim is that the "6" is appearing directly beneath the "2".

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\sqrt{1 & 2345}= \\
& 6
\end{align*}
\end{document}
  • There are a number of ways to achieve this. Do you have a specific goal in mind other than placing one number underneath another? – Werner Nov 8 at 21:14
  • @Werner In principle it's only about placing numbers. My goal is typesetting an algorithm similar to divison. I specified my question now in a new case called "Alignment and phantom". (I know about the package xlop but think this does not help here). – Thales Nov 8 at 23:45
up vote 5 down vote accepted

You cannot use alignment points (&) inside an \sqrt structure. Instead, here I use \phantom to provide the requested buffer.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\sqrt{1  2345}= \\
 6\phantom{345 =}
\end{align*}
\end{document}

enter image description here

If you want the rows closer together, use something like \\[-6pt] as the row separator.

  • Thanks! That helps me. – Thales Nov 8 at 21:20

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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