1

I want to use gnuplottex, but even example from documentation don't work.

\documentclass[a4paper]{article}

    \usepackage{gnuplottex}
    \begin{document}
    \begin{figure}%
        \centering%
        \begin{gnuplot}[terminal=latex, terminaloptions=rotate]
            set key box top left
            set key width 4
            set sample 1000
            set xr [-5:5]
            set yr [-1:1]
            set xlabel ’$x$-label’
            set ylabel ’$y$-label’
            plot sin(x) w l lc 1 t ’$\sin(x)$’,\cos(x) w l lc 2 t ’$\cos(x)$’,\
            tan(x) w l lc 3 t ’$\tan(x)$’,\
            tanh(x) w l lc 4 t ’$\tanh(x)$’
        \end{gnuplot}
        \caption{This is a simple example using the latex-terminal.}%
        \label{pic:latex}%
    \end{figure}%
    \end{document}

log file with [miktex]{gnuplottex}

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) (preloaded format=pdflatex 2016.4.25)  26 MAY 2016 15:17
entering extended mode
**234234.tex
(C:\Users\MASAMUTRE\Documents\texi\234234.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for loaded.
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo"
File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\gnuplottex\gnuplottex.sty"
Package: gnuplottex 2015/12/13 v0.9.1 gnuplot graphs in LaTeX

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\keyval.sty"
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks14
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\trig.sty"
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg"
File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
)
Package graphics Info: Driver file: pdftex.def on input line 91.

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX

("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
\Gread@gobject=\count87
))
\Gin@req@height=\dimen103
\Gin@req@width=\dimen104
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\moreverb\moreverb.sty"
Package: moreverb 2008/06/03 v2.3a `more' verbatim facilities

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\tools\verbatim.sty"
Package: verbatim 2003/08/22 v1.5q LaTeX2e package for verbatim enhancements
\every@verbatim=\toks15
\verbatim@line=\toks16
\verbatim@in@stream=\read1
)
\tab@position=\count88
\tab@size=\count89
\listing@line=\count90
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\ifthen.sty"
Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\catchfile.sty"
Package: catchfile 2011/03/01 v1.6 Catch the contents of a file (HO)

("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\etexcmds.sty"
Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)

("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty"
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
Package etexcmds Info: Could not find \expanded.
(etexcmds)             That can mean that you are not using pdfTeX 1.50 or
(etexcmds)             that some package has redefined \expanded.
(etexcmds)             In the latter case, load this package earlier.
))
\verbatim@out=\write3
runsystem(echo t > "w18-test-2016526917.tex")...executed.

runsystem(del "w18-test-2016526917.tex")...executed.

Package gnuplottex Info: Automatically converting gnuplot files. on input line 
110.
\c@fignum=\count91
)
(C:\Users\MASAMUTRE\Documents\texi\234234.aux)
LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.

("C:\Program Files (x86)\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count92
\scratchdimen=\dimen105
\scratchbox=\box26
\nofMPsegments=\count93
\nofMParguments=\count94
\everyMPshowfont=\toks17
\MPscratchCnt=\count95
\MPscratchDim=\dimen106
\MPnumerator=\count96
\makeMPintoPDFobject=\count97
\everyMPtoPDFconversion=\toks18
) Opening gnuplot stream 234234-gnuplottex-fig1.gnuplot
runsystem(gnuplot 234234-gnuplottex-fig1.gnuplot)...executed.



Package gnuplottex Warning: Conversion of 234234-gnuplottex-fig1.gnuplot failed
.


Package gnuplottex Warning: Please convert 234234-gnuplottex-fig1.gnuplot manua
lly.

Opening gnuplot stream 234234-gnuplottex-fig2.gnuplot
runsystem(gnuplot 234234-gnuplottex-fig2.gnuplot)...executed.



Package gnuplottex Warning: Conversion of 234234-gnuplottex-fig2.gnuplot failed
.


Package gnuplottex Warning: Please convert 234234-gnuplottex-fig2.gnuplot manua
lly.

(C:\Users\MASAMUTRE\Documents\texi\234234.aux) ) 
Here is how much of TeX's memory you used:
 1349 strings out of 495352
 18819 string characters out of 3182689
 66498 words of memory out of 3000000
 4548 multiletter control sequences out of 15000+200000
 3640 words of font info for 14 fonts, out of 3000000 for 9000
 14 hyphenation exceptions out of 8191
 34i,1n,21p,255b,69s stack positions out of 5000i,500n,10000p,200000b,50000s

No pages of output.
PDF statistics:
 0 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

which gives log file

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9) (preloaded format=pdflatex 2016.4.25)  26 MAY 2016 08:57
entering extended mode
**234234.tex
(C:\Users\MASAMUTRE\Documents\texi\234234.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for loaded.
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo"
File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\gnuplottex\gnuplottex.sty"
Package: gnuplottex 2015/12/13 v0.9.1 gnuplot graphs in LaTeX

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\keyval.sty"
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks14
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\graphics\trig.sty"
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg"
File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
)
Package graphics Info: Driver file: pdftex.def on input line 91.

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX

("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty"
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
\Gread@gobject=\count87
))
\Gin@req@height=\dimen103
\Gin@req@width=\dimen104
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\moreverb\moreverb.sty"
Package: moreverb 2008/06/03 v2.3a `more' verbatim facilities

("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\tools\verbatim.sty"
Package: verbatim 2003/08/22 v1.5q LaTeX2e package for verbatim enhancements
\every@verbatim=\toks15
\verbatim@line=\toks16
\verbatim@in@stream=\read1
)
\tab@position=\count88
\tab@size=\count89
\listing@line=\count90
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\ifthen.sty"
Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
)
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\catchfile.sty"
Package: catchfile 2011/03/01 v1.6 Catch the contents of a file (HO)

("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\etexcmds.sty"
Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)

("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty"
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
Package etexcmds Info: Could not find \expanded.
(etexcmds)             That can mean that you are not using pdfTeX 1.50 or
(etexcmds)             that some package has redefined \expanded.
(etexcmds)             In the latter case, load this package earlier.
))
\verbatim@out=\write3
runsystem(touch w18-test-2016526537.tex)...executed.

runsystem(rm -f w18-test-2016526537.tex)...executed.

runsystem(rm -f "234234.gnuploterrors")...executed.



Package gnuplottex Warning: Shell escape not enabled.
(gnuplottex)                You'll need to convert the graphs yourself..

\c@fignum=\count91
) (C:\Users\MASAMUTRE\Documents\texi\234234.aux)
LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 4.
LaTeX Font Info:    ... okay on input line 4.

("C:\Program Files (x86)\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count92
\scratchdimen=\dimen105
\scratchbox=\box26
\nofMPsegments=\count93
\nofMParguments=\count94
\everyMPshowfont=\toks17
\MPscratchCnt=\count95
\MPscratchDim=\dimen106
\MPnumerator=\count96
\makeMPintoPDFobject=\count97
\everyMPtoPDFconversion=\toks18
) Opening gnuplot stream 234234-gnuplottex-fig1.gnuplot

Package gnuplottex Warning: Please convert 234234-gnuplottex-fig1.gnuplot manua
lly.

Opening gnuplot stream 234234-gnuplottex-fig2.gnuplot

Package gnuplottex Warning: Please convert 234234-gnuplottex-fig2.gnuplot manua
lly.


! Package catchfile Error: File `234234.gnuploterrors' not found.

See the catchfile package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.16 \end{document}

Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

)
Runaway argument?
\ifx \gnuploterrors@ \@empty \else \PackageWarningNoLine {gnuplottex}\ETC.
! File ended while scanning use of \gnuploterrors@eatpar.
<inserted text> 
                \par 
<*> 234234.tex

I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Emergency stop.
<*> 234234.tex

*** (job aborted, no legal \end found)


Here is how much of TeX's memory you used:
 1347 strings out of 495352
 18740 string characters out of 3182689
 66486 words of memory out of 3000000
 4548 multiletter control sequences out of 15000+200000
 3640 words of font info for 14 fonts, out of 3000000 for 9000
 14 hyphenation exceptions out of 8191
 34i,0n,21p,255b,67s stack positions out of 5000i,500n,10000p,200000b,50000s
!  ==> Fatal error occurred, no output PDF file produced!

I wrote pdflatex.exe --shell-escape foo.tex and use true example but errors there is enter image description here I got that errors.I got error about .gnuploterrors even if wrote nothing. enter image description here

I put --shell-escape but it didn't take any effect. serghersdhdrhdtyhn

  • You're using the wrong quotes –  May 25 '16 at 17:31
  • Copying code from PDF often goes wrong. Better type it yourself. This way you also learn more. – Henri Menke May 25 '16 at 17:35
  • 1
    Apart from the wrong quotes, the error messages seem to be telling that the -shell-escape option is not really enabled. Can you show the first ten lines of the log file? – egreg May 25 '16 at 17:47
  • @Christian Hupfer,@Henri Menke,@egreg- this code wont complike even with normal quotes. I show log. – JHZTME UIBNA May 25 '16 at 18:51
  • 1
    Do you have GNUPlot installed? (I note you are on Windows so this may not be the case) – Joseph Wright May 25 '16 at 20:03
  • @ Joseph Wright,Yes,i tried to specife the path to gnuplot like this https://i.imgur.com/Oisnf4W.png but it didn't take any effect. – JHZTME UIBNA May 25 '16 at 20:08
  • The log file shows that gnuplottex is trying to use Unix-style commands, which fail on Windows. Add the [miktex] option: \usepackage[miktex]{gnuplottex}. For me, the log then shows it uses del and echo for the same tasks, which work. – Joseph Wright May 26 '16 at 06:24
  • @Joseph Wright♦, if i use [miktex]{gnuplottex} then i get clear list but with no errors.Added new log file. – JHZTME UIBNA May 26 '16 at 10:50
  • @JHZTMEUIBNA Probably for some reason gnuplot is not working: it's certainly being called by TeX. The log doesn't tell us what goes wrong, so you'll need to run it by hand. From the Command Prompt, go to the folder containing your .tex file and run gnuplot 234234-gnuplottex-fig1.gnuplot. What's the result? It should make 234234-gnuplottex-fig1.tex. – Joseph Wright May 26 '16 at 10:56
  • After that i got pdf file with true graph!But then i use it for 234234-gnuplottex-fig2.gnuplot i got tex file.I don't know what to say – JHZTME UIBNA May 26 '16 at 11:18

1 Answers1

5

Inspecting the ' quotes in the OP they seem to be wrong. I replaced them using ordinary ASCII ' quote characters.

In addition, --shell-escape must be enabled, i.e. run pdflatex --shell-escape foo.tex

% arara: pdflatex: { shell: yes }
\documentclass[a4paper]{article}

    \usepackage{gnuplottex}
    \begin{document}
    \begin{figure}%
        \centering%
        \begin{gnuplot}[terminal=latex, terminaloptions=rotate]
            set key box top left
            set key width 4
            set sample 1000
            set xr [-5:5]
            set yr [-1:1]
            set xlabel '$x$'
            set ylabel '$y$'
            plot sin(x) w l lc 1 t '$\sin(x)$',\
            cos(x) w l lc 2 t '$\cos(x)$',\
            tan(x) w l lc 3 t '$\tan(x)$',\
            tanh(x) w l lc 4 t '$\tanh(x)$'
        \end{gnuplot}
        \caption{This is a simple example using the latex-terminal.}%
        \label{pic:latex}%
    \end{figure}%
    \end{document}

enter image description here

Note

\usepackage[utf8]{inputenc} does not cure the problem.

  • % arara: pdflatex: { shell: yes } would be a nice addition. – Henri Menke May 25 '16 at 17:33
  • @HenriMenke: Thanks, added. (First time I use arara really -- don't tell Paulo ;-)) –  May 25 '16 at 17:36
  • @ChristianHupfer It's not only a problem of quotes; I get the same exact errors as the OP when I run pdflatex without -shell-escape. – egreg May 25 '16 at 17:39
  • @egreg: According to the screen-shot, --shell-escape seems to be enabled –  May 25 '16 at 17:41
  • I wrote pdflatex --shell-escape foo.tex in commands and tried to compile your code and got same errors. – JHZTME UIBNA May 25 '16 at 18:48
  • @JHZTMEUIBNA: Then something else is wrong. As you can see from my screenshot it's working. If your document is not called foo.tex, then use another name (of course ;-)) –  May 25 '16 at 19:03
  • @Christian Hupfer,ow, i thought fov was part of command.if i use \usepackage[miktex]{gnuplottex} then i don't get errors but picture not compiled. – JHZTME UIBNA May 25 '16 at 19:28
  • @JHZTMEUIBNA: No, foo.tex is our code name for the actual file name. Replace it with your real file name. –  May 25 '16 at 19:49
  • Also,i did test in online compiler sharelatex.com:with \usepackage{gnuplottex} graph produces normally,as on your screenshot and with \usepackage[miktex]{gnuplottex} produce clear list with caption – JHZTME UIBNA May 25 '16 at 19:50
  • @JHZTMEUIBNA: I am not using MikTeX, I can't test for \usepackage[miktex]{gnuplottex} –  May 25 '16 at 19:51
  • @Christian Hupfer, Well,probably that is why i can't compile file with \usepackage{gnuplottex}. – JHZTME UIBNA May 25 '16 at 19:53
  • @JHZTMEUIBNA Please edit in to the question the .log file you get: this example works for me with an up-to-date MiKTeX, --shell-escape and gnuplot downloaded today (64-bit version). – Joseph Wright May 25 '16 at 20:11
  • @Joseph Wright♦, i installed gnuplot 5.1 patchlevel 0 from here http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/,i dowloaded gnuplottex through miktex package manager,what else should i install?. I tried to do like in this topic http://tex.stackexchange.com/questions/45366/adding-gnuplot-capability-to-latex but it again didn't take any effect/. I added full log file – JHZTME UIBNA May 26 '16 at 04:04
  • @JHZTMEUIBNA: The linked site is in Japanese -- I don't speak Japanese nor can I read it. Did you run wgnuplot.exe (or whatever it's called) -- Is it really installed. And you should use www.gnuplot.info as download source, in my point of view –  May 26 '16 at 08:32
  • @Christian Hupfer, no, this is english site and he is right in www.gnuplot.info,in section Downloads tatsuromatsuoka.com/gnuplot/Eng/winbin/ . I downloaded gnuplot 5 patchlevel 3 from sourceforge,it work fine, but not in texstudio.I think that my editor can't call gnuplot but i don't know how to fix it. – JHZTME UIBNA May 26 '16 at 09:57
  • @JHZTMEUIBNA: No, the page is not available for me and it shows a page with Japanese characters, but that's not really important. In my point of view, you should just use gnuplot directly, create the figure and import with \includegraphics -- see the screen shot of my example -- I don't find it very convincing given the high quality graphics that are produced by gnuplot in direct call –  May 26 '16 at 10:02
  • @Christian Hupfer,i just want to understand how to make this work right in latex. – JHZTME UIBNA May 26 '16 at 10:17
  • @JHZTMEUIBNA: I've used my version of the document in TeXStudio (although I hate such editors) and it worked out of the box. --shell-escape is the key point, of course –  May 26 '16 at 10:27
  • @JHZTMEUIBNA Why do you want to use the latex terminal? Please try [terminal=cairolatex] instead of [terminal=latex, terminaloptions=rotate] , the quality should be a lot better. The miktex option is actually meant for all windows users due to historical reasons, so you should use that. Be aware, as said above, that you use ' instead of as quotes. – John May 27 '16 at 13:38
  • I think it has to do with write permissions, but I am unsure which folder it affects. – olidem Nov 18 '20 at 21:01