3

I have a long equation in twocolumn article. The equation has a LaTeX operator like \sqrt{}. I want to split the equation at some position and align it inside the operator ...\sqrt{...&...}...\\&.... This gives me error.

Here is my code:

\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{newtxtext,newtxmath}

\begin{document}

\begin{align}
    \exp(x)+\ln(x)+\sqrt{f(x)+&g(x)+h(x)}+\\
    &\ell(x)+x(x)+y(x)+z(x)
\end{align}

\end{document}

2 Answers 2

5

Avoid long square roots. If you do, you can split the long argument into two lines. Typesetting in narrow columns often requires some compromise.

As another general rule, don't use align for single equations.

\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{newtxtext,newtxmath}

\begin{document}

\begin{multline}
\exp(x)+\ln(x)+\bigl(f(x)+g(x)+h(x) \\
    +\ell(x)+x(x)+y(x)+z(x)\bigr)^{1/2}
\end{multline}

\end{document}

enter image description here

If you instead want that the + in the second line is aligned with one under the square root (which I can't see the need of), here's the trick.

\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{newtxtext,newtxmath}

\newlength{\mylen}

\begin{document}

\begin{equation}
\settowidth{\mylen}{$\displaystyle\sqrt{f(x)+{}}$}%
\begin{split}
\exp(x)+\ln(x)&+\sqrt{f(x)+g(x)+h(x)} \\
    &\hspace{\mylen}+\ell(x)+x(x)+y(x)+z(x)
\end{split}
\end{equation}

\end{document}

enter image description here

3
  • 1
    I think the OP's \sqrt expression doesn't extend to the second row.
    – Mico
    Feb 20 at 16:20
  • @Mico Then the question makes very little sense: I see no reason whatsoever for aligning the second line to something inside the square root.
    – egreg
    Feb 20 at 16:37
  • 1
    @Mico Anyway, I added a simple solution.
    – egreg
    Feb 20 at 16:43
5

I suggest you switch from \sqrt{...} notation to [...]^{1/2} notation.

Incidentally, if there's no natural alignment point across the two rows, you may want to employ a multline environment instead of an align environment.

enter image description here

\documentclass[twocolumn]{article}
\usepackage{newtxtext,newtxmath}

\begin{document}
\hrule % just to illustrate column width

\begin{align}
  \exp(x)+\ln(x)+\bigl[f(x)+{}&g(x)+h(x)\bigr]^{1/2}+{} \notag\\
  &\ell(x)+x(x)+y(x)+z(x)
\end{align}
\begin{multline}
  \exp(x)+\ln(x)+\bigl[f(x)+g(x)+h(x)\bigr]^{1/2}+{}\\
  \ell(x)+x(x)+y(x)+z(x)
\end{multline}

\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .