6

i am trying to generate pdf file from latex document with formula below

\documentclass[border=2pt]{standalone}
\usepackage{amsmath}
\usepackage{varwidth}
\begin{document}
\begin{varwidth}{\linewidth}
\begin{equation}
-\frac{\sqrt{2{{x}^{2}}-5x+2}}{3}\le x<0 \Leftrightarrow \left\{ \begin{align}
&   x<0  ,\\
&   -3x\le \sqrt{2{{x}^{2}}-5x+2}
\end{align} \right. \Leftrightarrow \left\{ \begin{align}
&   x<0  ,\\
&   9{{x}^{2}}\le 2{{x}^{2}}-5x+2
\end{align} \right. \Leftrightarrow \left\{ \begin{align}
&   x<0  ,\\
&   7{{x}^{2}}+5x-2\le 0
\end{align} \right. \Leftrightarrow
\end{equation}
\end{varwidth}
\end{document}

and got error message

! Package amsmath Error: Erroneous nesting of equation structures; (amsmath) trying to recover with `aligned'.

See the amsmath package documentation for explanation. Type H for immediate help. ...

l.10 \end{align} \right. \Leftrightarrow \left{ \begin{align}

any other formulas work fine. Please help

2
  • Don't use align inside equation. Use aligned instead.
    – user11232
    Oct 27, 2015 at 15:56
  • Or rather the starred variant. Having a varwidth environment is a bit useless, ase you are using standalone
    – Johannes_B
    Oct 27, 2015 at 15:58

1 Answer 1

3

Don't use align inside equation. Use aligned instead. Also there is no need for varwidth. The standalone class provides that option itself.

\documentclass[border=5pt,varwidth]{standalone}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
-\frac{\sqrt{2{{x}^{2}}-5x+2}}{3}\le x<0 \Leftrightarrow \left\{ \begin{aligned}
&   x<0  ,\\
&   -3x\le \sqrt{2{{x}^{2}}-5x+2}
\end{aligned} \right. \Leftrightarrow \left\{ \begin{aligned}
&   x<0  ,\\
&   9{{x}^{2}}\le 2{{x}^{2}}-5x+2
\end{aligned} \right. \Leftrightarrow \left\{ \begin{aligned}
&   x<0  ,\\
&   7{{x}^{2}}+5x-2\le 0
\end{aligned} \right. \Leftrightarrow
\end{equation*}
\end{document}

enter image description here

1
  • Harish, thank you for your answer. But i got this document from third side and cannot change content. Perhaps i can change but it means that i am must parse file before generate pdf. Oct 27, 2015 at 19:14

You must log in to answer this question.

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