0

I am trying to plot a curve as shown below:

%&lualatex
% !TeX program = lualatex
\documentclass[border=5pt]{standalone}
\usepackage{pgfplots}

\pgfplotsset{compat=newest}
\begin{document}
    \begin{tikzpicture}
    \begin{axis}
    \addplot [red] {-sqrt(x^3+7)};
    \end{axis}
    \end{tikzpicture}
\end{document}

The problem is that the solution works pretty well in pdflatex, however, when I try to compile this MWE (given in the answer) with lualatex, I get a series of errors like:

> ! Undefined control sequence. \sa@placebox ->\newpage \global
> \pdfpagewidth 
>                                               =\wd \sa@box \global \pdfpageh... l.13 \end{document}
>                   The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g.,
> `\hobx'), type `I' and the correct spelling (e.g., `I\hbox').
> Otherwise just continue, and I'll forget about whatever was undefined.
> 
> ! You can't use a prefix with `the character ='. <to be read again> 
> = l.13 \end{document}
>                   I'll pretend you didn't say \long or \outer or \global or \protected.
> 
> ! Missing number, treated as zero. <to be read again>  \global  l.13
> \end{document}
>                   A number should have been here; I inserted `0'. (If you can't figure out why I needed to see a number, look up `weird
> error' in the index to The TeXbook.)
> 
> ! Illegal unit of measure (pt inserted). <to be read again>  \global 
> l.13 \end{document}
>                   Dimensions can be in units of em, ex, in, pt, pc, cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one! I'll assume
> that you meant to say pt, for printer's points. To recover gracefully
> from this error, it's best to delete the erroneous units; e.g., type
> `2' to delete two letters. (See Chapter 27 of The TeXbook.)
> 
> ! Undefined control sequence. \sa@placebox ...wd \sa@box \global
> \pdfpageheight 
>                                                   =\ht \sa@box \global \pape... l.13 \end{document}
>                   The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g.,
> `\hobx'), type `I' and the correct spelling (e.g., `I\hbox').
> Otherwise just continue, and I'll forget about whatever was undefined.
> 
> ! You can't use a prefix with `the character ='. <to be read again> 
> = l.13 \end{document}
>                   I'll pretend you didn't say \long or \outer or \global or \protected.
> 
> ! Missing number, treated as zero. <to be read again>  \global  l.13
> \end{document}
>                   A number should have been here; I inserted `0'. (If you can't figure out why I needed to see a number, look up `weird
> error' in the index to The TeXbook.)
> 
> ! Illegal unit of measure (pt inserted). <to be read again>  \global 
> l.13 \end{document}
>                   Dimensions can be in units of em, ex, in, pt, pc, cm, mm, dd, cc, nd, nc, bp, or sp; but yours is a new one! I'll assume
> that you meant to say pt, for printer's points. To recover gracefully
> from this error, it's best to delete the erroneous units; e.g., type
> `2' to delete two letters. (See Chapter 27 of The TeXbook.)
> 
> 
> Overfull \hbox (30.56pt too wide) in paragraph at lines 13--13
> []\TU/lmr/m/n/10 ==[]   []

Could anyone tell me where it is going wrong?

Disclaimer: I am using the MikTex-2.9.6300 and standalone was packaged on 21-Jul-2015.

1 Answers1

1

The error message indicates that your standalone package is outdated. So run in the miktex console (admin and user mode) the update tool.

If you don't want to update use this https://tex.stackexchange.com/a/315027/2388.

Ulrike Fischer
  • 327,261