Skip to content
Uwe Schneider edited this page May 7, 2019 · 21 revisions

Welcome to the gams2powerpoint wiki!

GAMS to PowerPoint

Other GAMS interfaces

GAMS2Gnuplot GAMS2Shademap GAMS2Powerpoint GAMS2GAMS GAMS Memory


The tools available here were developed by Uwe A. Schneider, Ingo Huck, and Delf Neubersch. GAMS to powerpoint allows GAMS users to automatically insert large numbers of gnuplot figures and shademap plots obtained from GAMS runs into powerpoint. Please report bugs, improvements, or other comments to uwe.schneider{at}


  • Install GAMS to Gnuplot (Gnuplotxyz) for import of gnuplot figures into powerpoint
  • Install GAMS to ShadeMap for import of geographic maps into powerpoint
  • Fully automatic import: Phyton based program to automatically make ppt slides (Contributed by Delf Neubersch). To use this option, save the following two files in the .\inclib subdirectory of your gams system directory: compileppt.exe, gams_direct.pptx
  • Semi-automatic import: Powerpoint file with macro for loading and emptying gnuplot figures and shaded maps (Contributed by Ingo Huck). This option requires very little effort to import figures.

Gams Syntax

for Gnuplot: $setglobal gp_ppt yes

for Shademap: $setglobal sm_ppt yes

The above command inside your GAMS program saves all graphs produced by $libinclude gnuplotxyz ... / $libinclude shademap ... as picture files in your working directory with automatically different file names. In addition, all file names and file locations will be written into a text file. These text files are named gams_ppt_list.txt and reside in the /inclib subdirectory of your gams system.

By gnuplot default and always for shademap, the picture format will be a memory sparing vector format (EMF). If you want other formats for gnuplot figures (i.e. GIF), you have to use an additional terminal statement. Note that other formats have not been tested and may produce errors.

$setglobal gp_term <terminal name>

$libinclude gnuplotxyz <parameter/variable.suffix>

Adding Slide titles

The title of the plot will be put as text box on each slide. The following text format modifiers can be used to determine the appearance of the slide title:

$setglobal gp_ppt_fontname "Times New Roman"

$setglobal gp_ppt_fontsize 25

$setglobal gp_ppt_boldfont yes

The content of the title is determined through gp_title [and gp_loop1, ..., gp_loop4 if loops are involved] as described on the Gnuplot interface pages.

The option gp_ppt_boldfont only works with the powerpoint macro. Multiple execution of the same plot file

Slide Set Comparison

Sometimes, one executes the same plotting program on different data sets (e.g. restarting from different model solutions) in order to compare plots across different runs. If one uses only $setglobal gp_ppt yes, one could combine the entire set of figures in one ppt file (e.g. slide1, ..., slide10, slide1, ..., slide10, slide1, ..., slide10). However, this order would make a comparison difficult because corresponding slides would not be adjacent. To facilitate comparison across runs, one may want to have the the slides in a specific way, where each slide is repeated for all runs before showing the next slide (e.g. slide1, slide1, slide1, ..., slide10, slide10, slide10). To achieve such an order, the following syntax must be used:

$setglobal gp_ppt_a b

$libinclude gnuplotxyz <parameter/variable.suffix>

where a and b have to be numbers between 1 and 9. a identifies how many comparison runs you have (Note that 2,3,4,6, and 9 runs go well with the print handout option in MS PowerPoint). b identifies the current run. For example, one could have the four following statements for four comparison runs, which should be executed one after another.

First run (perhaps using restart file a1)

$setglobal gp_ppt_4 1

*$setglobal gp_ppt_4 2

*$setglobal gp_ppt_4 3

*$setglobal gp_ppt_4 4

Last run (perhaps using restart file a4)

*$setglobal gp_ppt_4 1

*$setglobal gp_ppt_4 2

*$setglobal gp_ppt_4 3

$setglobal gp_ppt_4 4

The title of each comparison run can be added to the existing plot title of the slide by using

$setglobal gp_ppt_1_name " for population growth"

$setglobal gp_ppt_2_name " for biodiversity decline"

$setglobal gp_ppt_3_name " for climate change"

$setglobal gp_ppt_4_name " for mars people landing"

Automatic PowerPoint Import

The default name of the powerpoint file is gams_slides.pptx and will be created in the project directory.

One can override the default name (and path) by specifying the option ppt_filename

$setglobal ppt_filename <path>myslides.pptx

At the end of the file which produce gnuplot or shademap files, place the following statement:

$libinclude gnuplotxyz compileppt

Manual PowerPoint Import with Macros

To import the pictures from your GAMS run into POWERPOINT, open the Powerpoint file and enable the contained macro!

Enable Macro Dialog

The power point interface uses a small macro compiled in Visual Basics.

Then go to to the View tab, click on Macros, select EnterPictures, and click Run.

Enter Picture Macro

Now you are ready to use the picture adding macro.

Picture Adding Tool

Please check that the file path corresponds to your gams system. You can change and save it through the "Save Filepath and name" button.

Gnuplot figures and shaded maps can be loaded simultaneously

You can click on Insert Pictures to load all gnuplot or shademap pictures of your gams run in power point or you can also delete all slides in your power point file.


If the slides do not load,

a) Examine that the specified file path corresponds to the path to your active gams system

b) Check that all picture files which are specified in the file gams_ppt_list.txt exist and can be viewed. Picture files listed with 0KB may be empty files which will not work.

c) Make sure you have the normal view selected in your ppt file.


1 Combined gnuplot and shademap figures from single run


Note: You must install shademap and gnuplotxyz and extract these files in the gislib subdirectory of your GAMS system directory!

2 Multiple gnuplot figures for 4 comparison runs

Run example_multi_ppt_plot.gms four times and activate each time the corresponding $setglobal gp_ppt_4 statement.

Open the ppt template and execute the contained macro. The slides should look as in this file multirun_slides.ppt

Print slides using handout options with 4 handouts per page multirun_slides.pdf

Clone this wiki locally
You can’t perform that action at this time.