How can we include the graphics produced by Gnuplot into a TEX document?
# install texlive apt-get install texlive # create 'text.gp' and add set terminal latex set out 'plot.tex' plot [-5:5] [-1.5:1.5] sin(x+pi) title "$\\sin(x+\\pi)$" set out # run it gnuplot test.gp # text editor: create example.tex and put some content in it \documentclass{article} \begin{document} \input{plot.tex} \end{document} # run latex on it to produce some output # ..don't worry about most of this output -- the important part is the Output written on example.dvi line, which says that it was successful. latex example.tex # now you need to view the output file with xdvi # this will pop up a window with the beautifully formatted output in it. Hit `q' to quit this, or you can leave it open and it will automatically update when the example.dvi file is modified (so whenever you run latex to update the output). xdvi ex1.dvi & # to produce a PDF of this you simply run pdflatex instead of latex # ..and you'll have an example.pdf file created instead of the example.dvi file. pdflatex example.tex