1

On compiling the tex file I'm getting an error

errorf.tex, line 103, Tex capacity exceeded, sorry [parameter stack size=10000]. \gplbacktext

when trying to compile the next file:

\documentclass[a4paper,12pt,final]{article} % to tamplate
\usepackage{mystyle}
\usepackage{gnuplottex}
\begin{document}
New figure from epslatex terminal:
\begin{figure}
 \input{./img/errorf.tex}
\end{figure}
\end{document}

where errorf.tex is a one of two files (together with "errorf.eps") generated by Gnuplot with help of the next commands:

set terminal epslatex size 1,1.5 color colortext
set xrange [-3:3]
set yrange [-1:1]
set label 1 at -2, 0.5 "$erf(x) = \\frac{2}{\\sqrt{\\pi}}\\int_0^x\\, dt e^{-t^2}$" centre
set output 'errorf.tex'
plot erf(x)

Here is errorf.tex file:

% GNUPLOT: LaTeX picture with Postscript
\begingroup
  \makeatletter
  \providecommand\color[2][]{%
    \GenericError{(gnuplot) \space\space\space\@spaces}{%
      Package color not loaded in conjunction with
      terminal option `colourtext'%
    }{See the gnuplot documentation for explanation.%
    }{Either use 'blacktext' in gnuplot or load the package
      color.sty in LaTeX.}%
    \renewcommand\color[2][]{}%
  }%
  \providecommand\includegraphics[2][]{%
    \GenericError{(gnuplot) \space\space\space\@spaces}{%
      Package graphicx or graphics not loaded%
    }{See the gnuplot documentation for explanation.%
    }{The gnuplot epslatex terminal needs graphicx.sty or graphics.sty.}%
    \renewcommand\includegraphics[2][]{}%
  }%
  \providecommand\rotatebox[2]{#2}%
  \@ifundefined{ifGPcolor}{%
    \newif\ifGPcolor
    \GPcolortrue
  }{}%
  \@ifundefined{ifGPblacktext}{%
    \newif\ifGPblacktext
    \GPblacktextfalse
  }{}%
  % define a \g@addto@macro without @ in the name:
  \let\gplgaddtomacro\g@addto@macro
  % define empty templates for all commands taking text:
  \gdef\gplbacktext{}%
  \gdef\gplfronttext{}%
  \makeatother
  \ifGPblacktext
    % no textcolor at all
    \def\colorrgb#1{}%
    \def\colorgray#1{}%
  \else
    % gray or color?
    \ifGPcolor
      \def\colorrgb#1{\color[rgb]{#1}}%
      \def\colorgray#1{\color[gray]{#1}}%
      \expandafter\def\csname LTw\endcsname{\color{white}}%
      \expandafter\def\csname LTb\endcsname{\color{black}}%
      \expandafter\def\csname LTa\endcsname{\color{black}}%
      \expandafter\def\csname LT0\endcsname{\color[rgb]{1,0,0}}%
      \expandafter\def\csname LT1\endcsname{\color[rgb]{0,1,0}}%
      \expandafter\def\csname LT2\endcsname{\color[rgb]{0,0,1}}%
      \expandafter\def\csname LT3\endcsname{\color[rgb]{1,0,1}}%
      \expandafter\def\csname LT4\endcsname{\color[rgb]{0,1,1}}%
      \expandafter\def\csname LT5\endcsname{\color[rgb]{1,1,0}}%
      \expandafter\def\csname LT6\endcsname{\color[rgb]{0,0,0}}%
      \expandafter\def\csname LT7\endcsname{\color[rgb]{1,0.3,0}}%
      \expandafter\def\csname LT8\endcsname{\color[rgb]{0.5,0.5,0.5}}%
    \else
      % gray
      \def\colorrgb#1{\color{black}}%
      \def\colorgray#1{\color[gray]{#1}}%
      \expandafter\def\csname LTw\endcsname{\color{white}}%
      \expandafter\def\csname LTb\endcsname{\color{black}}%
      \expandafter\def\csname LTa\endcsname{\color{black}}%
      \expandafter\def\csname LT0\endcsname{\color{black}}%
      \expandafter\def\csname LT1\endcsname{\color{black}}%
      \expandafter\def\csname LT2\endcsname{\color{black}}%
      \expandafter\def\csname LT3\endcsname{\color{black}}%
      \expandafter\def\csname LT4\endcsname{\color{black}}%
      \expandafter\def\csname LT5\endcsname{\color{black}}%
      \expandafter\def\csname LT6\endcsname{\color{black}}%
      \expandafter\def\csname LT7\endcsname{\color{black}}%
      \expandafter\def\csname LT8\endcsname{\color{black}}%
    \fi
  \fi
    \setlength{\unitlength}{0.0500bp}%
    \ifx\gptboxheight\undefined%
      \newlength{\gptboxheight}%
      \newlength{\gptboxwidth}%
      \newsavebox{\gptboxtext}%
    \fi%
    \setlength{\fboxrule}{0.5pt}%
    \setlength{\fboxsep}{1pt}%
\begin{picture}(1440.00,2160.00)%
    \gplgaddtomacro\gplbacktext{%
      \csname LTb\endcsname%
      \put(726,440){\makebox(0,0)[r]{\strut{}$-1$}}%
      \put(726,804){\makebox(0,0)[r]{\strut{}$-0.5$}}%
      \put(726,1168){\makebox(0,0)[r]{\strut{}$0$}}%
      \put(726,1531){\makebox(0,0)[r]{\strut{}$0.5$}}%
      \put(726,1895){\makebox(0,0)[r]{\strut{}$1$}}%
      \put(858,220){\makebox(0,0){\strut{}$-3$}}%
      \put(889,220){\makebox(0,0){\strut{}$-2$}}%
      \put(920,220){\makebox(0,0){\strut{}$-1$}}%
      \put(950,220){\makebox(0,0){\strut{}$0$}}%
      \put(981,220){\makebox(0,0){\strut{}$1$}}%
      \put(1012,220){\makebox(0,0){\strut{}$2$}}%
      \put(1043,220){\makebox(0,0){\strut{}$3$}}%
      \put(889,1531){\makebox(0,0){\strut{}$erf(x) = \frac{2}{\sqrt{\pi}}\int_0^x\, dt e^{-t^2}$}}%
    }%
    \gplgaddtomacro\gplfronttext{%
      \csname LTb\endcsname%
      \put(56,1722){\makebox(0,0)[r]{\strut{}erf(x)}}%
    }%
    \gplbacktext
    \put(0,0){\includegraphics{errorf}}%
    \gplfronttext
  \end{picture}%
\endgroup
1

You're misusing gnuplottex. Run pdflatex -shell-escape on this example:

\documentclass[a4paper,12pt,final]{article} % to tamplate
\usepackage{gnuplottex}
\usepackage{amsmath}

\DeclareMathOperator{\erf}{erf}
\begin{document}
In figure~\ref{fig:erf} we see a plot done by \texttt{gnuplot}.

\begin{figure}[htp]
\centering
\begin{gnuplot}
set xrange [-3:3]
set yrange [-1:1]
set label 1 at -1, 0.5 "$\\displaystyle\\erf(x) = \\frac{2}{\\sqrt{\\pi}}\\int_0^x e^{-t^2}\\,dt$" centre
plot erf(x)
\end{gnuplot}

\caption{The $\erf$ function}\label{fig:erf}
\end{figure}
\end{document}

enter image description here

On the other hand, running pdflatex on the following example, after having run gnuplot on your sample code,

\documentclass[a4paper,12pt,final]{article} % to tamplate
\usepackage{amsmath,xcolor,graphicx}

\DeclareMathOperator{\erf}{erf}

\begin{document}
In figure~\ref{fig:erf} we see a plot done by \texttt{gnuplot}.

\begin{figure}[htp]
 \input{errorf.tex}
 \caption{The error function}\label{fig:erf}
\end{figure}

\end{document}

produces

enter image description here

It is clear that some setting is wrong; on the other hand, I get no error.

  • It fails for me. There is no any figure in the final pdf. I got a message in the log: gnuplottex.sty, warning: Shell escape not enabled. As for my initial problem I'm sure that gnuplottex is not necessary to be included. This package provides another way of interaction with Gnuplot differed the way I use. – Artem Zefirov Sep 4 '16 at 21:31
  • Well, now I'm not sure about gnuplottex, but my problem has the same view whether I use this package or not. – Artem Zefirov Sep 4 '16 at 22:15
0

The problem was solved. The error pointed at the head of this question is a result of using quotes in gnuplot command. One should use apostrophe instead of quotes:

 set label 1 at -2, 0.5 '$erf(x) = \\frac{2}{\\sqrt{\\pi}}\\int_0^x\\, dt e^{-t^2}$' centre

The second problem shown by egreg results from incorrect size settings in the gnuplot file:

set terminal epslatex size 1,1.5 color colortext

Here one should fit the size which corresponds to the image size in .tex file. For not to adjust the size manually one can use size autofitting in Tex while inserting an image:

 \resizebox{\linewidth}{!}{\input{./img/errorf.tex}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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