Ipe tricks

On this page, we collect some tricks for working with Ipe. Also you can find some style sheets here.

Warning The material on this page is meant for use with Ipe 7.1.7 or newer. It may not work with older versions.

Gradients

Ipe supports gradients, but they cannot be edited from the user interface (except if you use an ipelet). Instead, they need to be entered by hand in style files. Here is a style file with the gradient definitions for the cushion-style gradients used in this paper. To use it, draw a 16x16 rectangle in the lower-left corner of the paper, fill it, and set the gradient to one of the seven available colors. Alternatively use our example file.

Clipping paths

Clipping paths allow you to restrict the visible area of one object to an arbitrary area. Here is a tutorial about how to use them.

Using Fira Sans for labels

This section explains how to get Fira Sans working in Ipe. There are two basic approaches (xetex and pdftex). We recommend the xetex approach, as that produces nicer output, but this method does not work with older Ipe versions.

Fira Sans is our default font for presentations, but these instructions should work for other fonts as well.

With xetex (recommended)

Download Fira Sans and make sure that it is installed by putting it in C:\Windows\Fonts (Windows) or ~/.fonts (Linux).

Install XeTeX and the packages mathspec and mathastext. In the Ipe document properties (Edit > Document properties) set the LaTeX engine to xetex, and put the following in the Ipe preamble:

\usepackage{mathspec}
\setmainfont{Fira Sans}
\setmathfont(Digits,Latin,Greek,Symbols){Fira Sans}
\setmathrm{Fira Sans}
\usepackage{mathastext}

Now, all labels should be in Fira Sans. Here is an example:

Note You may be wondering why we are including both mathastext and mathspec. For some reason, this gives much better results for math mode than including just one of the two. (By the way, if you are not interested in math mode, just including fontspec and doing \setmainfont{Fira Sans} should do the trick already. The additional lines are just for getting math mode to render correctly.)

Troubleshooting

We experienced an issue (with TeX Live on Windows) where LaTeX rendering in Ipe would become extremely slow (> 30 seconds) when trying to load the fontspec / mathspec package, during which the Ipe interface hangs. As stated here, this can be solved by running c:\texlive\2016\bin\win32\fc-cache.exe from a terminal like this:

c:\texlive\2016\bin>win32\fc-cache.exe
Note that it needs some time to create caches,
especially if there are many large font files.
Wait with patience.

As the output says, this can take a while. However, afterwards, Ipe should render much faster.

With pdftex (for older Ipe versions)

Older Ipe versions (< 7.2.1) do not support xetex; for those versions this alternative method can be used. It does not work for Greek letters, but otherwise seems to give similar output to the xetex method.

Install the packages fira and mathastext. In the Ipe document properties (Edit > Document properties) set the LaTeX engine to pdftex, and put the following in the Ipe preamble:

\usepackage[T1]{fontenc}
\usepackage[sfdefault, lining]{FiraSans}
\usepackage{mathastext}

Disabling selection in the translate mode

Assume that you are in the translate mode, and you want to move the currently selected object. If you start dragging at a position far away from the selected object, and near some other object, Ipe will instead select and move that other object. This can be undesirable, if you are starting the drag operation far away from the selected object on purpose, because you want to use that position as the translation origin.

To disable this behavior, in prefs.lua, set the key prefs.close_distance (which is set to 48 by default) to something large, for example

prefs.close_distance = 1e100

Useful ipelets

Ipelets are scripts written in Lua that extend Ipe's functionality. A list of ipelets is available here. We particularly encourage you to check out polyfillet, tangentline and the linear gradient ipelet.

For ipelet developers

If you are developing an ipelet yourself, set the following preference in prefs.lua:

prefs.developer = true

While developing you can now reload your ipelet without restarting Ipe entirely: use Help > Developer > Reload ipelets.

Using Ipe figures in PowerPoint

PowerPoint 2019, and the (newer) version of PowerPoint included with Office 365, are able to read SVG figures as vector graphics. As Ipe is able to create SVG files, this creates a way to get Ipe figures in PowerPoint, in such a way that they can still be edited in PowerPoint (as PowerPoint shapes).

Step 1: Ipe to SVG

Unfortunately, Ipe doesn't let you export SVG files from its interface, but there is a terminal command iperender to do it. The syntax is

$ iperender -svg -page <page_number> -view <view_number> <input>.ipe <output>.svg

On Windows, you'll need to replace iperender by the full path name of iperender.exe. As this is cumbersome, it is easier to make a batch file like this:

D:/Downloads/ipe-7.2.9/bin/iperender.exe -svg -page 1 -view 1 %1 %~d1%~p1%~n1.svg

Replace the path to iperender.exe, and save the batch file as ipetosvg.bat. Now you can drag-and-drop an .ipe file onto the icon of this batch file, and the figure will be converted to an .svg file in the same directory.

Warning If you're on Windows and iperender.exe doesn't seem to be working properly, check if you have Ipe 7.2.8 or newer. Earlier Windows builds had an issue causing the -svg option to be missing.

Step 2: SVG to PowerPoint

An SVG file can simply be dragged onto PowerPoint to insert it. At that point, it is a non-editable object. To be able to edit it from PowerPoint, you need to convert it to PowerPoint shapes. This can be done by right-clicking the figure and selecting Convert to Shape. This will bring up a dialog warning that this may lose formatting; just click Yes. The figure is now ready to be edited in PowerPoint (you may need to ungroup it first).

Tips

Using Blender figures in Ipe

Blender is a 3D editor that is able to render realistic 3D figures. It has several ways to render an image. Most of the time, scenes are rendered to a raster image. However, Blender includes a renderer that renders lines, called Freestyle, which can export to SVG. This creates a nice way to import the figure into Ipe, so that it can be edited manually. What is more, we can import the raster version of the render as a background image in Ipe, so that you get the shading as well, for a cartoon-like look.

This section assumes basic Blender knowledge.