Before we start...

LaTeX Lab

LaTeX
7 Feb 2012 - Dr Anton Gerdelan - apg@bth.se

MS Word:
word equation
LaTeX:
latex equation

Tex

Get LaTeX

Get Help

Skeleton

gnuplotlab.tex
%% gnuplot lab worksheet by Anton Gerdelan apg@bth.se
\documentclass{article}

% properties of the title
\author{Anton~Gerdelan}
\date{\today}
\title{Visualisation Lab: gnuplot}

\usepackage{graphicx}

\begin{document}
\maketitle % put the title here

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

\end{document}

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

\documentclass[twocolumn]{article}

reserved characters

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

Sections

\section{Apparatus}
Just start typing in plain text...

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

\subsection{Instrumentation}
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$.

sectionspdf

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:
\begin{itemize}
	\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
\end{itemize}

Figures

If you want to read about parametric plots you can do something
like Figure~\ref{fig:3dplot}.
\begin{figure}
	\includegraphics[width=1.0\textwidth]{3d.png}
	\caption{a parametric mode ``splot'' with hidden3d option
	(depth sorting) disabled \label{fig:3dplot}}
\end{figure}

Tips for Figures

Equations

\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}

...as described in equation~\ref{eq:someequation}..

eq

Tables

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

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