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
Read the rest “Using Gams, R and LaTeX I”

Using the identifier-list in Gams-mode

Gams-mode has lots of features and I am still amazed how powerful it is. I just discovered the use of the identifier-list (C-c C-a). I have a rather complex model with lots of include files and easily forget all the parameter names I use. Was it scale_mrd or mrd_scale? What was the name of the set HH or HHG? Here is where the identifier list comes in handy. Just hit C-c C-a and all the parameters, sets, variables appear as a new buffer.
 
 
 
 
You can change the way this information is listed. For example hit in
Read the rest “Using the identifier-list in Gams-mode”

Adding Gams file extensions in gams-mode

In Gams-Mode all files with the extension “gms” are recognized as gams-files and all keywords are highlighted properly. You can add other extensions that should be recognized by setting the variable gams-file-extension.
An easy way to find this in Emacs is by going to “Options” – “Customize Emacs”  Settings matching regexp” where you search for gams-file-extension (it is in the group “gams”).
 
Just click INS and add your extension (I added inc as extension).
 
Do not forget to save your settings.

New update of Gams-Mode (3.6)

There is a update for Gams-mode. It contains some bug fixes and a nice new feature: If you hit C-u C-c C-. you can search for an identifier. It finds the parameter and has several options like jump to the next occurrence, jump to the file, split the screen and also show the file where gams-mode found the parameter. All these possibilities are described at the bottom-line and are self-explaining (“decl” shows the declaration of the identifier).
 
 
 

Formatted code in Word using Emacs

Sometimes I have to write some documentation using Word instead of LaTeX. In LaTeX you have some nice options for typesetting code be it R, Stata or Gams. In Word, however, there is no easy way to format your code. I found a nice way to get my code nicely formatted (in color) using Emacs: I installed the Windows version of Emacs and there I can “Quick Print” – “Preview with Web Browser”. This opens the file as htm in my browser. I now just save this file somewhere on my computer and open it in Word. The text is
Read the rest “Formatted code in Word using Emacs”