Skip to content

Commit 3dd0bf1

Browse files
author
sfeam
committed
update latex tutorial
1 parent a3473e6 commit 3dd0bf1

File tree

5 files changed

+38
-33
lines changed

5 files changed

+38
-33
lines changed

ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
2010-09-16 Ethan A Merritt <[email protected]>
22

3-
* tutorial/eg2.plt tutorial/eg6.plt tutorial/tutorial.tex:
3+
* tutorial/eg2.plt tutorial/eg6.plt tutorial/test_tikz.plt
4+
tutorial/Makefile.am.in tutorial/header.tex tutorial/tutorial.tex:
45
Update the LaTeX tutorial a bit. More could be done.
56

67
2010-09-15 Ingo Thies <[email protected]>

tutorial/Makefile.am.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ header.tex makefile.dst tutorial.tex eg3.dat
99

1010
CLEANFILES = tutorial.aux tutorial.dvi tutorial.log tutorial.pdf tutorial.ps \
1111
tutorial.toc eg1.tex eg2.tex eg3.tex eg4.tex eg5.tex eg6.tex eg7.tex \
12-
eg7.eps eg7.pdf test.tex
12+
eg7.eps eg7.pdf test.tex test_tikz.tex
1313

1414
DVIPS = dvips
1515
LATEX = @LATEX@
@@ -38,7 +38,7 @@ tutorial.dvi: eg1.tex eg2.tex eg3.tex eg4.tex eg5.tex eg6.tex eg7.tex eg7.eps te
3838
TEXINPUTS=.:$(srcdir):${TEXINPUTS}: $(LATEX) tutorial
3939
TEXINPUTS=.:$(srcdir):${TEXINPUTS}: $(LATEX) tutorial
4040

41-
tutorial.pdf: eg1.tex eg2.tex eg3.tex eg4.tex eg5.tex eg6.tex eg7.tex eg7.pdf test.tex \
41+
tutorial.pdf: eg1.tex eg2.tex eg3.tex eg4.tex eg5.tex eg6.tex eg7.tex eg7.pdf test.tex test_tikz.tex \
4242
tutorial.tex header.tex
4343
@echo "Building LaTeX tutorial (PDF version)"
4444
TEXINPUTS=.:$(srcdir):${TEXINPUTS}: $(PDFLATEX) tutorial

tutorial/header.tex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,15 @@
6969

7070
% Other packages
7171
\usepackage{url}
72+
\usepackage{subfigure}
7273

7374
% Only needed for epslatex driver
7475
\usepackage{graphicx}
7576
\usepackage{color}
7677

78+
% Only needed for the tikz driver
79+
\usepackage{gnuplot-lua-tikz}
80+
7781
% Margins
7882
\sloppy
7983
\setlength{\textwidth}{6.5in}

tutorial/test_tikz.plt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set term tikz
2+
set out "test_tikz.tex"
3+
test

tutorial/tutorial.tex

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
%
2-
% $Id: tutorial.tex,v 1.8 2010/09/17 03:05:25 sfeam Exp $
2+
% $Id: tutorial.tex,v 1.9 2010/09/17 20:58:12 sfeam Exp $
33
%
44
% Tutorial for gnuplot plotting program, for LaTeX users
55
% David Kotz
@@ -33,7 +33,7 @@
3333
{\bf current gnuplot team} \\[0.4cm]
3434
Updates of this tutorial for gnuplot 4.0, March 2004 \\
3535
Update of this tutorial for gnuplot 4.2, August 2006 \\
36-
Update of this tutorial for gnuplot 4.4, August 2010
36+
Update of this tutorial for gnuplot 4.4, September 2010
3737

3838
\vskip2cm
3939

@@ -68,8 +68,7 @@ \section{Introduction and History}
6868
In late 1989 and early 1990 Gnu\TeX\ and a number of other gnuplot
6969
variants were merged together into a new release of gnuplot, 2.0. This
7070
includes, among many other improvements, a \LaTeX\ driver derived from
71-
the one in Gnu\TeX. Former Gnu\TeX\ users are referred to
72-
Section~\ref{oldusers} for information about adapting to gnuplot.
71+
the one in Gnu\TeX.
7372
Anyone interested in using gnuplot with \LaTeX\ should read the next
7473
section, a tutorial, and the primary gnuplot manual.
7574

@@ -89,9 +88,6 @@ \section{Introduction and History}
8988
available for \verb+ftp+ as \verb+pub/gnuplot-latex.shar+ from
9089
\verb+cs.duke.edu+.
9190

92-
NB: There is also a much more recent tikz latex terminal that
93-
is not described in this tutorial.
94-
9591
\section{Using gnuplot for \LaTeX: a Tutorial}
9692

9793
Gnuplot is by nature an interactive program. Users making plots for
@@ -178,13 +174,13 @@ \section{Using gnuplot for \LaTeX: a Tutorial}
178174
\end{verbatim}
179175
\currentspace
180176

181-
\boxfigure{htbp}{\fullboxwidth}{
177+
\begin{figure}[htbp]
182178
\begin{center}
183179
\input{eg2}
184180
\end{center}
185-
\caption{A more fancy example.}
181+
\caption{A fancier example.}
186182
\label{eg2}
187-
}
183+
\end{figure}
188184

189185
We have specified the plot to be 7 cm wide and 5 cm tall with
190186
the {\tt set term latex size ...} command. This is the size of the
@@ -263,7 +259,7 @@ \section{Using gnuplot for \LaTeX: a Tutorial}
263259
each data point. The {\tt points} and {\tt linespoints} styles
264260
produce a different point symbol for each curve on the plot (for up to
265261
twelve symbols, after which they are re-used; see
266-
Figure~\ref{test} for a complete list). The {\tt lines} and {\tt
262+
Figure~\ref{testcomp} for a complete list). The {\tt lines} and {\tt
267263
linespoints} styles use a different line style for each curve on the
268264
plot (in this example the dots have different spacing). The
269265
style {\tt impulses} draws a perpendicular from each point to the
@@ -361,27 +357,19 @@ \section{Using gnuplot for \LaTeX: a Tutorial}
361357
\end{verbatim}
362358
\currentspace
363359

364-
\boxfigure{htbp}{\fullboxwidth}{
360+
\begin{figure}
365361
\begin{center}
366362
\input{eg6}
367363
\end{center}
368364
\caption{An example of many features.}
369365
\label{eg6}
370-
}
366+
\end{figure}
371367

372368
\paragraph{Line and point types:} For reference, we show all of the
373-
line and point types available in Figure~\ref{test}.
374-
375-
\boxfigure{htbp}{\fullboxwidth}{
376-
\begin{center}
377-
\input{test}
378-
\end{center}
379-
\caption{All of the line and point types in the \LaTeX\ driver.}
380-
\label{test}
381-
}
369+
line and point types available in Figure~\ref{testcomp}.
382370

383371
\subsection{Summary --- Use with \LaTeX}
384-
In summary, to use the \LaTeX\ facilities of gnuplot, the first
372+
In summary, to use the most basic \LaTeX\ mode of gnuplot, the first
385373
command to gnuplot should be
386374
\begin{syntax}
387375
set terminal latex
@@ -445,7 +433,8 @@ \section{Use with EEPIC}
445433
\section{What is new for \TeX{} and \LaTeX{} terminals in gnuplot 4.0}
446434

447435
In addition to the \texttt{latex} terminal, the following \LaTeX-friendly
448-
terminals are available:
436+
terminals are available. The gnuplot documentation contains more information
437+
about the options and usage for each of these.
449438

450439
\begin{itemize}
451440
\item \texttt{emtex}: Like the \texttt{latex} terminal, but supports emtex
@@ -463,11 +452,6 @@ \section{What is new for \TeX{} and \LaTeX{} terminals in gnuplot 4.0}
463452

464453
\end{itemize}
465454

466-
See helps of these terminals for more details about their usage.
467-
468-
In addition, the \texttt{postscript eps enhanced} is the most useful for \TeX{}
469-
and \LaTeX{} if you don't insist on using \TeX{} fonts for the graph labels, and
470-
\texttt{pdf enhanced} and \texttt{png enhanced} for pdf\LaTeX{}.
471455

472456
\section{What is new for \TeX{} and \LaTeX{} terminals in gnuplot 4.4}
473457

@@ -476,7 +460,8 @@ \section{What is new for \TeX{} and \LaTeX{} terminals in gnuplot 4.4}
476460
\item \texttt{pslatex and epslatex}: Rewritten version. See the example below.
477461

478462
\item \texttt{tikz}: Much improved graphics compaired to earlier \LaTeX terminals.
479-
Requires a lua interpreter as an intermediate processing step.
463+
Requires a lua interpreter that is called by gnuplot. Compare the output
464+
of the \texttt{test} command to that from the minimal latex terminal.
480465

481466
\end{itemize}
482467

@@ -517,6 +502,18 @@ \section{Sample of epslatex terminal driver}
517502
\label{epslatex_test}
518503
}
519504

505+
\begin{figure}[htbp]
506+
\begin{center}
507+
508+
\subfigure[Line and point types in the latex driver]
509+
{\input{test}}
510+
\subfigure[Line and point types in the tikz driver]
511+
{\input{test_tikz}}
512+
513+
\end{center}
514+
\caption{The exact line and point types available depend on the terminal type.}
515+
\label{testcomp}
516+
\end{figure}
520517

521518
\section{Contact for help}
522519

0 commit comments

Comments
 (0)