Bibliography with abstracts in LaTeX

If you ever have written a scientific paper, you probably know how hard it is to remember what was in the papers you cited. Usually you cite them once and forget about them, but if you want to discuss your paper with other scientist, it would be nice to have at least an idea of what you exactly cited.
In LaTeX you have a nice way of producing a bibliography with abstracts. It is quite easy. You only have to use biblatex, an improved bibtex. Information on biblatex can be found at the CTAN repository (just google it). There are also two good articles in German from http://biblatex.dominik-wassenhoven.de/dtk.shtml.
 
Here is an example. Your LaTeX file looks like this, where the file jabref is my bib-file with all my citations (for which I use jabref):
 
 
The results looks like:
 
 
If you have some annotations, they also will be reproduced.

Using Gams, R and LaTeX I

Wow, I just discovered how easy it is to produce nice LaTeX tables from your Gams results. Usually I capture my model results in some parameters that are exported (using gdx or gdxxrw) to excel. Then I make my tables in Excel and use an excel add-in to export the table to LaTeX (I have written about this add-in in this blog). This works fine, but is tedious because as soon as my results are in excel, I can’t do things automatically and have to click my way to get my LaTeX tables.
Today, I was working on the parking model and wanted to automate my LaTeX tables. I already wrote on how to produce nice plots using R Statistics, but that might have been too geeky for a lot of you (“I don’t do network modelling and Excel or Gnuplot produces plots that will do…”). However, what I show you today is worth trying to start working with R if you are doing your modeling with Gams.
My workflow now looks like this:
  1. Run my model and produce some parameter with results and export the parameters to a gdx file
  2. Read the parameters from the gdx file with R using the R package (gdxrrw).
  3. Recast the data using “cast” and “mold” from the package reshape (see for an excellent introduction (http://www.jstatsoft.org/v21/i12/paper)
  4. Use the R package “xtable” (see http://cran.r-project.org/web/packages/xtable/xtable.pdf) to produce for each table a separate tex file.
  5. Write my paper and include the tex files with tables.
Let us have a look at the code for every step.
1. Run my model and produce some parameter with results  and export the parameters to a gdx file
Most of this is straight forward. Note that I save my gdx files in my R directory. In this directory I have my R-scripts.
2. Read the parameters from the gdx file with R using the R package (gdxrrw).
Gams Corporation is working on a R-package that allows you to transfer data from R to Gams and the other way around. The package is called gdxrrw (the “rrw” stands for R read and write)  is still work-in-progress, but you can already use it (just download it from (http://support.gams.com/doku.php?id=gdxrrw:interfacing_gams_and_r).
When you have it installed, you can use it as follows:
The gams parameter is now a R data frame with the following structure:
3. Recast the data using “cast” and “mold” from the package reshape
I want to produce two different tables: one for the model statistisc and one for the road results. I saved all this results in one parameter, so now I have to take a subset of the results for every table.
I defined a subset “modelstatistics” and use them to subset my dataframe using %in%. This gives us the following dataframe
I want to have a table with the parameter as columns and the scenarios as rows. For this I first rename the columns and then I use the cast command:
If I combine this with the xtable command, I already have my LaTeX table:
4. Use the R package “xtable” to produce for each table a separate tex file.
Now we are almost ready: I set some options for saving the LaTeX table (table title, label and filename) and save the file using the print command on the table:
5. Write my paper and include the tex files with tables.
I jump in my paper tex file and add the following line for including the table:
and produce my LaTeX file:
In your xtable-code in the R-script you can a lot of additonal options to format your table.
The great thing is that I can do it all now without having to adjust my tables every time I run a different or addtional scenario. I just add in gams the following line to run the R-script:
And for the Emacs fans: I didn’t have to leave Emacs at all: I run my Gams model, my R code and my LaTeX from within Emacs (and for those with the good eyes: I can even clock this task…)
In a next post, I will write more on the use of cast: you can use this R command for lots of interesting stuff (building tables with the sum, mean, min, max, etc.).

Biblatex and folder contents

I was looking for a way to make nice index for my folders using LaTeX. I usually have lots of papers saved in a folder and I was looking for a way to use my paper references stored in JabRef (an open source bibliography reference manager which integrates neatly with AucTexi in Emacs, see http://jabref.sourceforge.net/). The problem is that I want to have the title of the author, year and the title of the paper (who remembers something like Arrow 1955?), so I looked for a way to print the paper titles. BibTex and all the citation packages don’t seem to manage, but then I stumbled on bibllatex (see http://ctan.org/pkg/biblatex).
On the homepage you find the following description of biblatex:
“Biblatex is a complete reimplementation of the bibliographic facilities provided by LaTeX in conjunction with BibTeX. It redesigns the way in which LaTeX interacts with BibTeX at a fairly fundamental level. With biblatex, BibTeX is only used (if it is used at all) to sort the bibliography and to generate labels. Formatting of the bibliography is entirely controlled by TeX macros (the BibTeX-based mechanism embeds some parts of formatting in the BibTeX style file. Good working knowledge in LaTeX should be sufficient to design new bibliography and citation styles; nothing related to BibTeX’s language is needed.”
 
Biblatex allows you to cite the title using \citetitle{bibtexkey}. Using this and, after some surfing, a little bit more LaTeX code, I managed to use LaTeX to produce something like:
 
Looks nice!