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

1 Answers1

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

  • 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. – Stanislav Sviridenko Oct 27 '15 at 19:14