06. [2p] Latex

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
ep/labs/061/contents/tutorial/ex6.txt ยท Last modified: 2019/09/27 06:53 by andreea.alistar
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0