CTAN Comprehensive TeX Archive Network

Directory graphics/gapfill

% for the GaPFilL method ("Graphics as PostScript Filtered for LaTeX"),
% Version 1.1, January 2006; version 1.6, January 2015
% Changes: April 2006, October 2006, August 2009, April 2011, January 2015

Author: H. Moeller
E-Mail: mollerh@math.uni-muenster.de
Homepage: http://www.math.uni-muenster.de/u/mollerh
Address: Department of Mathematics and Computer Science
         University of Muenster
         Einsteinstr. 62
         D-48149 Muenster


Using geometry software or a drawing program ("geometry program") LaTeX picture environments may be constructed in the following way:

  i) Generating the desired figure with the geometry program;
  ii) "Printing" (or exporting) the construction as a PostScript file;
  iii) Applying a Perl filter program to the PostScript text;
  iv) Copying the resulting code or parts of it into a LaTeX document.

On account of this structure the method is called "GaPFilL" (Graphics as PostScript Filtered for LaTeX).

Since the steps i) and ii) and the packages used in the LaTeX document may vary, it is necessary to apply different filter programs.

Therefore the GaPFilL folder in the CTAN may collect open-source Perl filter programs for many combinations of geometry programs, PostScript versions, and LaTeX packages on different platforms.

The first two Perl filter programs in the folder 'Mac_OS_only' are written for the "dynamic" geometry software 'Cabri-g�om�tre II', the PostScript driver 'Virtual Printer', and the LaTeX packages 'ebezier' and 'pict2e'.

Both have been well tested using a Macintosh G4 and Mac OS 9.2. The package pict2e with LaTeX code generated by 'CABpict.pl' could only be used with PDFTeX.

Together with the documentation 'GaPDoc1.pdf' these programs may serve as prototypes for those who will write or modify Perl filter programs for GaPFilL.

Added in 2009: A new Perl filter program 'OOopict.pl' is added for the powerful free drawing software OpenOffice.org 3 Draw which has its own PostScript generator not depending on the operating systems supplied by OpenOffice.org, namely Linux, Mac OS, Unix and Windows.


  i) A geometry program,
  ii) a PostScript driver (http://www.adobe.com/support/downloads/main.html),
  iii) the Perl interpreter (http://www.Perl.com/CPAN/ports/index.html),
  iv) a TeX/LaTeX installation.


  README -- this file,
  GaPDoc1.tex -- tex file of the GaPFilL documentation,
  GaPDoc1.pdf -- pdf version of the GaPFilL documentation,
  Mac_OS_only/CABebez.pl -- Perl filter for Cabri-g�om�tre II and the LaTeX package 'ebezier',
  Mac_OS_only/CABpict.pl -- Perl filter for Cabri-g�om�tre II and the LaTeX packages 'ebezier' and 'pict2e'.
  Added in 2009:
  GaPDoc2.tex -- tex file of the GaPFilL documentation for OpenOffice.org 3 Draw,
  GaPDoc2.pdf -- pdf file of the GaPFilL documentation for OpenOffice.org 3 Draw,
  Various_OSs/OOopict.pl -- Perl filter for OpenOffice.org 3 Draw and the LaTeX package 'pict2e' (2008) or the packages 'ebezier' and 'pict2e' (2003).


Each of the four systems in (2) has its own installation mode depending on the platform. In general with the respective software you get an installer or an explanation how to install it.


If you are familiar with your geometry program, you are able to generate even complicated drawings without using any manual. For the assignment of colors you only need the two tables on pages 4 and 5 of the documentation GaPDoc1.pdf.

Added in 2009: With OOopict.pl you have to use the table of colors on page 6 of the documentation GaPDoc2.pdf.

The Perl filter programs need to be placed where your Perl interpreter can find them.

With Mac OS you may select the PostScript text in your text editor and run the desired filter of the Perl filters list.

The use of Perl filter programs in Unix/Linux and with MS-Windows is explained for example in the README.TXT of CTAN/graphics/pictex/mathspic/Perl.

If there are difficulties between 64-bit Windows 7 and the text editor you may use the command line of Windows with the eps-file as parameter.

April 2006: The German documentation has been substituded by an English translation of it.

October 2006: In the Perl filter Mac_OS_only/CABebez.pl on line 111 "and ($co0 ne $violet)) " has been added.

August 2009: In the Perl filter Mac_OS_only/CABpict.pl the subprocedure 'best' is corrected taking into account that Perl has a greatest integer.

April 2011: In the PostScript file of OpenOffice.org 3 Draw rectangles consist of five lines. These are reduced to the ordinary four ones. The length of arrow shafts is corrected. Dotted lines and curves are shifted half a dot to the left. The letter 'D' in the subprocedure 'best' is replaced by 'd'.

June 2011: The subprocedure 'best' of OOopict.pl is simplified on lines 269 to 300.

January 2015: The Perl filter program OOopict.pl can also be used with the free drawing programs Apache OpenOffice Draw and LibreOffice Draw, which belong to the office suits succeeding OpenOffice.org. To get the correct colors, the "standard" color list must be replaced by the "web" color list: From the menue/submenue "Format/Area..." choose "Colors" and load the color list "standard.soc" clicking the left icon on the lower right side of the window. Save it with the other icon as "standard0.soc". Then, load the color list "web.soc" and replace the numbers in the Name field. Using A for 0, B for 128 and C for 255, the color names should be: black for AAA, navy for AAB, green for ABA, teal for ABB, maroon for BAA, purple for BAB, olive for BBA, blue for AAC, lime for ACA, cyan for ACC, red for CAA and magenta for CAC. Save this list as "standard.soc".


These programs are free software; you can redistribute them and/or modify them under the conditions of the LaTeX Project Public License.

These programs are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Download the contents of this package in one zip archive (512.8k).

gapfill – Generate picture environments from PostScript output of drawing programs

GaPFilL ("Graphics as PostScript Filtered for ") is a method for the generation of picture environments in four steps:

  • Construct the desired figure with a drawing program;
  • Export as a PostScript file;
  • Apply a Perl filter program to the PostScript text;
  • Transfer the resulting code into a document.

LicensesThe Project Public License 1.3
Copyright2006, 2009 H. Möller
MaintainerHerbert Möller
Contained inMiKTeX as gapfill
TopicsGraphics prep
Guest Book Sitemap Contact Contact Author