Template Mode for Emacs

If you write a lot of R-, Stata-, Gams and/or LaTeX-files templates can make your life more relaxed. Emacs doesn’t have a template system (well there is auto-insert, but I did not find enough information on how to use if for templates). I used to have some templates in a directory and usually I would start with them (and forget that I should save it under another name…). The disadvantage is that you have to jump around in the file to fill out the information you want to have at the top of the file (like project name, topic, file
Read the rest “Template Mode for Emacs”

Update of Gams-Tex

Edson Valle sent me an update for Gams-Tex (see my blog from 28. Januari) where he showed how to add new keywords to the Gams-Tex file (here done for the MPSGE keywords):
 
Just add the following lines to the gams theme file (theme_gams.tex) after the moreKeywords={
$PROD, $DEMAND, $AUXILIARY, $COMMODITIES, $SECTORS, $CONSUMERS, $MODEL, $REPORT,
It’ll become automatically case insensitive due to the options selected.

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).
 
 
 

Gams code in LaTeX documents

Edson Valle recently wrote a style for the package listings from LaTeX. It allows you to format Gams code nicely in your LaTeX documents.
Here is a small example taken from his post to the Gams mailing list:
Scalar X /1/;
Scalar Y;
Y = 2*X;
Display “This is the famous Y”, Y;
In your LaTeX document this would look like:
The only thing you have to do is write a file gams.tex with the style and include this file in your LaTeX document before \begin{document}.
Information on the package Listings can be found here: listings
The gams.tex file should
Read the rest “Gams code in LaTeX documents”

Using the Gams Manuals in Gams-Mode

You can call the help and solver files from within Gams.mode hitting C-c Enter. Be sure that the directory for the help files is properly set (choose Customize Gams mode for Emacs from the Gams menu) and search for the following entry in the buffer:
 
If you hit enter, the gams manual is shown in your PDF viewer, but you can also search for another file. For example: type path and hit tab for completion: Gams-mode will show you two completions for ‘path’: PATH-Solver and PATH-LP-Solver.
You should also set the path of the PDF file
Read the rest “Using the Gams Manuals in Gams-Mode”