LaTeX

This site is about the document markup language LaTeX and I want to show you some tweaks and tricks I have learned.


Beamer Class: Using Bibliographical References in Footnotes

Now I will show you how you can put bibliographical references on a slide when using the beamer class. I used the package biblatex for this and for each citation I used a different style. The citestyle is the style used in the footnote, where the author and the name of the paper is shown. At the end of the document in my bibliography, the bibliographic references are shown in a numbered style but these numbers have no reference with the footnote marks.

example.tex

\documentclass[hyperref={pdfpagelabels=false}]{beamer}

\usepackage[utf8x]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{csquotes}
\usepackage[citestyle=authortitle,bibstyle=numeric]{biblatex}

\bibliography{example.bib}

\usetheme{Boadilla}
\usecolortheme{seahorse}

\beamertemplatenavigationsymbolsempty

\title{Test}
\author{Sebastian}
\date{\today}

\begin{document}

\begin{frame}
\frametitle{Bibtex Test}

This is a test, nothing more nothing less.\footcite{aglave_2007_uh}
\end{frame}

\begin{frame}
\frametitle{Bibliography}

\printbibliography
\end{frame}

\end{document}

And here is the code of the Bibtex example.

example.bib

@PHDTHESIS{aglave_2007_uh,
  author = {{Ravindra Aglave}},
  title = {{CFD Simulation of Combustion Using Automatically Reduced Reaction Mechanisms : A Case for Diesel Engine}},
  school = {{Universit"at Heidelberg}},
  year = {2007},
  url = {http://archiv.ub.uni-heidelberg.de/volltextserver/volltexte/2007/7251/}
}

And this is how it looks: example.pdf

When I compile this example it will produce a compatibility error.

Package biblatex Error: Incompatible package 'ucs'.

I am using texlive 2011 and maybe this error is not produced when using older texlive versions.


Using Gnuplot and LaTeX

Gnuplot is a very nice program to create any kind of plot.

You start Gnuplot in the shell like this:

$ gnuplot

You can load your data files using (for 2D plots):

> plot "data_file.dat"

For 3D plots you use:

> splot "data_file.dat"

To get started with Gnuplot I suggest you read the documentation about the program.

If I want to embed the graphs in my LaTeX document, I add a line in my Gnuplot script (a text file containing all the commands for generating your graph).

Add this line in your Gnuplot script to export your graph as graph.eps:

> set output "graph.eps"

Before you load your Gnuplot script, you need to set your Gnuplot terminal type to postscript like this:

> set term postscript eps color solid

You load a script with this command:

> load "gnuplot_script.gnu"

Without the color option your graphs would just be black. Also, you should use linewidth 2 in your Gnuplot script if you want to put it then in your LaTeX document. Now load your Gnuplot script in the postscript terminal and Gnuplot saves your graph as .eps file.

Now it depends, if your using TeX or LaTeX because TeX can load .eps files, but LaTeX can load .pdf files. As LaTeX user you need to run this last command on your graph.eps:

$ epstopdf graph.eps

You can believe me when I say that a graph generated by Gnuplot looks really really nice in your LaTeX document!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s