Ipe 7 stuff

What is Ipe? Ipe is a CAD-type drawing editor which has built-in support for LaTeX. That is, you can typeset LaTeX text (labels or whole paragraphs) within Ipe. Conversely, it is simple to include Ipe figures in your LaTeX document since you can save (and re-open) your Ipe documents natively to PDF or EPS files.

It features basic drawing tools like polygonal lines, circular arcs, splines. You can add arrows at the end of those objects and you can apply affine transformations (scaling, rotating, shearing, …) to all those objects and hence, for example, draw elliptic arcs as well. Ipe now also can fill objects with complex gradients, clip objects, set transparancy and so on. Like many CAD-type programs you can snap your cursor on a grid, on vertices of objects, on crossing points of objects, and so on.

For further information you may visit Ipe’s website or the Wiki page for more features and examples.

Repository. The following scripts, style sheets and configs are available in the reposity ipestuff.git.

Gentoo ebuilds

I maintain up to date Gentoo ebuilds for Ipe at my Gentoo overlay hosted on this website. Besides Ipe itself it also contains ebuilds for Ipe-related tools like pdftoipe or svgtoipe.

Output precision

The ebuild files for Ipe versions >=7.0.12 provide a use-flag ‘highprec’. If enabled, a patch is applied which makes Ipe to save coordinates with up to 14 decimal digits in its Ipe files. (Currently, only 6 digits are saved which may lead to some numerical inconvenience if you use Ipe files as input for third-party code.) You can get the patch file by simply checking out the git repository listed on my Gentoo overlay site.

ipeify.sh

You may have noticed that I put a shell script called ipeify.sh online. This script uses pdftoipe to convert pdf, eps and svg files to Ipe xml files. However, to convert svg to ipe I use inkscape and then pdftoipe. The tool svgtoipe – which is a python script – uses a direct approach. You may try svgtoipe first. In oder to convert eps files to Ipe you may first call epstopdf, which is shipped with standard LaTeX distributions.

Customization

As the manual of Ipe 7 writes we can customize Ipe using the Lua programming language. You may download my customize.lua and place it at $HOME/.ipe/ipelets to use it. It applies the following settings:

Stylesheets

Ipe now supports the concept of stylesheets. So one could, for example, write a stylesheet for the LaTeX figures made for a thesis or a paper. If the fonts in the LaTeX document are changed, only the stylesheet has to be adapted and the command ‘Update stylesheets’ must be invoked. See also the ‘-sheet’ option of ipe.

You may place the following style sheets in ‘/usr/share/ipe/*/styles/’ or somewhere else:

Ipe style sheet directory in $HOME

One may want to set up a style sheet directory in ones home directory. The goal is that your custom style sheets should be available if you press the ‘Add’ button in the ‘style sheets’ dialog without navigating around the file system. Further we want Ipe to search our directory by default for style sheets if we, for example, update our style sheets via the menu. Note that as far as I know this feature is not documented. The reason may be that if you do not make the system style sheets available in your directory then Ipe refuses to start, see below.

mkdir -p ~/.ipe/styles
echo "put your style sheets into ~/.ipe/styles"
cd ~/.ipe/styles
for f in /usr/share/ipe/7.0.10/styles/*; do ln -s $f; done
IPESTYLES="$HOME/.ipe/styles" ipe

Of course, if you have a different version than 7.0.10 you may adapt the commands from above accordingly. Furthermore, it is crucial that at least basic.isy from /usr/share/ipe/7.0.10/styles/ is available in your custom style sheet directory. Otherwise ipe will not start but print an error message like:

/usr/share/ipe/7.0.10/lua/model.lua:407: fopen error: No such file or directory
stack traceback:
        [C]: in function 'assert'
        /usr/share/ipe/7.0.10/lua/model.lua:407: in function 'newDocument'
        /usr/share/ipe/7.0.10/lua/model.lua:100: in function 'init'
        /usr/share/ipe/7.0.10/lua/model.lua:37: in function 'new'
        /usr/share/ipe/7.0.10/lua/main.lua:243: in main chunk
        [C]: in function 'require'
	[string "require "main""]:1: in main chunk

In order to make the setting of the environment variable IPESTYLES=”$HOME/.ipe/styles” permanent you may place an according export command into your .bashrc or similar.