Before we start...

LaTeX Lab

7 Feb 2012 - Dr Anton Gerdelan -

MS Word:
word equation
latex equation


Get LaTeX

Get Help


%% gnuplot lab worksheet by Anton Gerdelan

% properties of the title
\title{Visualisation Lab: gnuplot}


\maketitle % put the title here

\section{What is gnuplot?}
gnuplot is a tool for creating graphs and charts.


LaTeX Programmes

  1. latex .tex -> .dvi
    uses .eps images natively
  2. pdflatex .tex -> .pdf
    .pdf includes fonts in the file but does not support .eps
  3. dvipdfm .dvi -> .pdf
    handy to get a pdf with eps images
  4. dvi2ps .dvi -> .ps

Macros and Options


reserved characters

# $ % ^ & _ { } ~ \
\# \$ \% \textasciicircum{} \& \_ \{ \} \~{} \textbackslash{}


Just start typing in plain text...

Leave a blank line to start a new paragraph (indented in single-column mode).

You can type \textit{italics} (foreign words), \textbf{bold face} for emphasis,
or \texttt{monospace} for commands.

You can insert algebraic values or mathematics in dollars $n < n^2$.


Referencing with Bibtex

  1. create a .bib file with all your references (books, articles, papers, etc.)
  2. each .bib entry has a cite_key:
  3. @article{Gerdelan2012,  % journal article with cite key "Gerdelan2012"
        author    = "Gerdelan, A. and Klaus, S.",
        title     = "Downward Facing Dogs",
        journal   = "{International Journal of Petroleum Studies}",
        year      = "2012" % no comma after last entry used
  4. add \usepackage{cite} to preamble
  5. use "...has shown that dogs can not look up~\cite{Gerdelan2012}" in the .tex.
  6. and just before \end{document}:
    \bibliographystyle{plain} % style to use in references section
    \bibliography{mydotbibfile} % if using mydotbibfile.bib

...referencing with Bibtex

Now to build the .pdf with references:
pdflatex mydoc.tex  % "Warning: There were undefined references.", but makes .aux
bibtex mydoc.aux
pdflatex mydoc.tex  % "Warning: Label(s) may have changed. Rerun to get..."
pdflatex mydoc.tex

Bullets, Numbering

The major advantages of gnuplot are:
	\item clean, publication-quality graphs are created
	\item error bars are easy to display
	\item input data is easy to format
	\item data or commands can be piped in from \texttt{stdin}
	\item you have control over every aspect of the display
	\item you can output to a variety of pixel and vector formats


If you want to read about parametric plots you can do something
like Figure~\ref{fig:3dplot}.
	\caption{a parametric mode ``splot'' with hidden3d option
	(depth sorting) disabled \label{fig:3dplot}}

Tips for Figures


\usepackage{amsmath} % put in preamble

\begin{equation} \label{eq:someequation}
f(x) = ax + \frac{bx^{32t}}{\Delta \epsilon}
\pi = \sqrt{12}\sum^\infty_{k=0} \frac{(-3)^{-k}}{2k+1}
\end{equation} described in equation~\ref{eq:someequation}..



\begin{tabular}{ l c r }
  1 & 2 & 3 \\
  4 & 5 & 6 \\
  7 & 8 & 9 \\

Better Tables

Errors and Warnings

Fancy Things

Typical Article Structure

  1. title, authors, institute, emails, date
  2. abstract (siggraph does a banner/teaser image under this)
  3. introduction
    • literature review (thesis) or previous works (paper)
    • state of the art, or latest developments in area
  4. theory or hypothesis
  5. experiment design or method
  6. results
  7. discussion, conclusions, future works
  8. references