I'm trying to use Gnuplot and package gnuplottex
to create plots directly in LaTeX. Started with the following simple example
\documentclass[a4paper]{article}
\usepackage[shell]{gnuplottex}
\begin{document}
\begin{gnuplot}[terminal=pdf,terminaloptions={font ",10" linewidth 3}]
plot sin(x), cos(x)
\end{gnuplot}
\end{document}
When I run
pdflatex -synctex=1 -interaction=nonstopmode --enable-shell %.tex
I get the following warning messages:
Package gnuplottex Warning:Shell escape not enabled
Package gnuplottex Warning:Please convert example1-gnuplottex-fig1.gnuplot manually
...
No pages of output.
I'm using MikTeX, TeXmaker and Gnuplot 4.5.
Any help will be much appreciated!
Best Answer
When using MikTeX, you need to load
gnuplottex
with the[miktex]
option.Note that you might be better off using the
pgfplots
package, which generates plots completely within LaTeX (or uses gnuplot as its backend). This integrates the plots much better into the document, since the same font and rendering is used for the text and the plot. It also makes it easier to annotate the plot.Here's an example comparing the result of using
gnuplottex
to that ofpgfplots
(using gnuplot for the calculations):