...
 
Commits (14)
......@@ -2,4 +2,7 @@
pdftoipe/pdftoipe
figtoipe/figtoipe
ipe5toxml/ipe5toxml
build
*.AppImage
AppImageKit
Ipe.AppDir
......@@ -2,7 +2,7 @@ ipe-tools
=========
These are various tools and helper programs to be used
with the Ipe drawing editor (http://ipe7.sf.net)
with the Ipe drawing editor (http://ipe.otfried.org).
svgtoipe.py
......
annotate.py
==========
This Python script takes a PDF file and creates an Ipe document that
shows the pages of the PDF page by page, allowing you to annotate the
PDF document, for instance using ink mode on a tablet or by simply
creating new text objects.
To run it, you will need the *PyPDF2* library from
https://github.com/mstamy2/PyPDF2. The easiest way to install
*PyPDF2* is using PIP - on Linux it will suffice to say
```
apt-get install python3-pip
pip3 install PyPDF2
```
(Or, if using Python~2, install `python-pip` and call `pip`.)
Run it with a PDF file as an argument:
```
python3 annotate.py doc.pdf
```
It will create the new file `annotate-doc.ipe`.
When opening `annotate-doc.ipe` using Ipe, you will need to have the
original PDF file `doc.pdf` available for Ipe. You either have to
copy it into Ipe's Latex directory (e.g. `~/.ipe/latexrun`), or you
have to set the `TEXINPUTS` environment variable.
#
# Create an Ipe file including pages of given PDF document
#
import sys, os
import PyPDF2 as pdf
# --------------------------------------------------------------------
def create_ipe(pdffile):
i = pdffile.rfind("/")
if i >= 0:
outfile = pdffile[i+1:]
else:
outfile = pdffile
if outfile.endswith(".pdf"):
outfile = outfile[:-4]
outfile = "annotate-" + outfile + ".ipe"
doc = pdf.PdfFileReader(pdffile)
numPages = doc.numPages
out = open(outfile, "w")
out.write("""<ipe version="70205">
<preamble>\\usepackage{graphicx}
</preamble>
<ipestyle name="basic">
</ipestyle>
""")
for i in range(numPages):
out.write("""<page>
<layer name="alpha"/>
<layer name="pdf" edit="no"/>
<text pos="0 0" layer="pdf">\includegraphics[page=%d]{%s}</text>
</page>\n""" % (i+1, pdffile))
out.write("</ipe>\n")
out.close()
os.system("ipescript update-styles %s" % outfile)
# --------------------------------------------------------------------
if len(sys.argv) != 2:
sys.stderr.write("Usage: python annotate.py <document.pdf>\n")
sys.exit(9)
pdffile = sys.argv[1]
create_ipe(pdffile)
# --------------------------------------------------------------------
[Desktop Entry]
Type=Application
Name=Ipe
GenericName=drawing program
Icon=ipe.png
Exec=startipe.sh
Terminal=false
Categories=Graphics;
This diff is collapsed.
# Ipe AppImage recipe
This is a recipe for building an [AppImage](http://appimage.org/) for
Ipe, based on the [fantastic work of Thomas
Leitz](https://github.com/unruhschuh/Ipe.AppImage) - I only tinkered
with a few details and added the Voronoi ipelet and pdftoipe.
Ipe requires `pdflatex` to be installed in order to render text
elements. It is not included in the AppImage so you need to have a
LaTeX distribution installed on your system. You can find informations
about LaTeX and how to install it at
[www.tug.org](https://www.tug.org/).
## Download
* [Download](https://bintray.com/otfried/generic/ipe#files/ipe) the
latest AppImage for Ipe
* Make the AppImage executable, e.g. in the terminal run
`chmod a+x ipe-x.y.z-x86_64.AppImage`
## How to use the Ipe AppImage
* To start Ipe, just click on the AppImage file.
* You can also start Ipe from the command line by executing the AppImage:
```
$ ./ipe-7.2.6-x86_64.AppImage
```
* If you want to use the Ipe command line tools, such as `ipetoipe`, `iperender`, `ipescript`, just prefix the command with the AppImage:
```
$ ./ipe-7.2.6-x86_64.AppImage ipetoipe -pdf ~/test.ipe
```
* If you want to start Ipe with a command line argument, proceed as for the tools:
```
$ ./ipe-7.2.6-x86_64.AppImage ipe -sheet presentation ~/mytalk.pdf
```
Note that you will have to use **absolute filenames** in the arguments
to the command line tools, because the AppImage changes directory
before executing the code.
## How to create an AppImage for Ipe
The AppImage for Ipe is created inside a fresh installation of CentOS
6.7. In order to build the AppImage follow these steps
* Install CentOS 6.7 either on a PC or inside VirtualBox or any other
virtualization program.
* Start the Terminal and run `git clone https://github.com/otfried/ipe-tools`
* Change directory with `cd ipe-tools/appimage`
* Download and compile the needed tools and libraries with
`./setup.sh`.
* Start Ipe compilation and packaging process with `./recipe.sh`.
This creates `ipe-7.x.y-x86_64.AppImage` inside the current directory.
-- Special settings for the Ipe appimage
prefs.browser = "unset XDG_DATA_DIRS && unset LD_LIBRARY_PATH && xdg-open %s"
#!/bin/bash
# Halt on errors
set -e
#scl enable devtoolset-2
source /opt/rh/devtoolset-2/enable
BASE=`pwd`
IPE=ipe-7.2.6
APP_DIR=$BASE/Ipe.AppDir
APP_IMAGE=$BASE/$IPE-x86_64.AppImage
# Cleanup
rm -fr build
rm -fr $APP_DIR $APP_IMAGE
######################################################
# create AppDir
######################################################
mkdir $APP_DIR
mkdir -p $APP_DIR/usr/bin/platforms
mkdir -p $APP_DIR/usr/lib/qt5
# Change directory to build. Everything happens in build.
mkdir -p build
######################################################
# Build Ipe
######################################################
cd $BASE/build
if [ "x$1" == "xlocal" ]; then
echo "Using local copy of Ipe sources"
cp $HOME/$IPE-src.tar.gz .
else
echo "Downloading Ipe sources"
wget https://dl.bintray.com/otfried/generic/ipe/7.2/$IPE-src.tar.gz
fi
tar xfvz $IPE-src.tar.gz
#mkdir $IPE
#rsync -trvz --delete --exclude=.git --exclude=build/obj --exclude=build/Ipe.app $SOURCE_HOST:Devel/ipe/ $IPE/
cd $IPE/src
export QT_SELECT=5
export MOC=moc-qt5
# use libpng16
export PNG_CFLAGS="-I\/usr\/local\/include\/libpng16"
export PNG_LIBS="-lpng16"
export LUA_CFLAGS="-I/usr/local/include"
export LUA_LIBS="-L/usr/local/lib -llua -lm"
export QHULL_CFLAGS="-I/usr/local/include/qhull"
export QHULL_LIBS="-lqhullstatic"
export IPEPREFIX=$APP_DIR/usr
export IPEQVORONOI=1
make IPEAPPIMAGE=1
make install IPEAPPIMAGE=1
######################################################
# Build pdftoipe
######################################################
cd $BASE/build
cp -r $BASE/../pdftoipe .
cd pdftoipe
make
install -m 0755 pdftoipe $APP_DIR/usr/bin
######################################################
# Build exec wrapper (for calling subprocesses)
######################################################
#cd $BASE/build
#git clone git://anongit.kde.org/scratch/brauch/appimage-exec-wrapper.git
#cd appimage-exec-wrapper
#make
#install -m 0755 exec.so $APP_DIR/usr/lib/
######################################################
# Populate Ipe.AppDir
######################################################
cd $BASE
cp AppImageKit/AppRun $APP_DIR
cp ipe.png $APP_DIR
cp Ipe.desktop $APP_DIR
cp startipe.sh $APP_DIR/usr/bin
cp appimage.lua $APP_DIR/usr/ipe/ipelets
cp -R /usr/lib64/qt5/plugins $APP_DIR/usr/lib/qt5/
cp $APP_DIR/usr/lib/qt5/plugins/platforms/libqxcb.so $APP_DIR/usr/bin/platforms/
set +e
ldd $APP_DIR/usr/lib/qt5/plugins/platforms/libqxcb.so | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' $APP_DIR/usr/lib
ldd $APP_DIR/usr/bin/* | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' $APP_DIR/usr/lib
find $APP_DIR/usr/lib -name "*.so*" | xargs ldd | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' $APP_DIR/usr/lib
set -e
cp /usr/local/lib/libjpeg.so.8 $APP_DIR/usr/lib
cp /usr/local/lib/libpng16.so.16 $APP_DIR/usr/lib/
cp $(ldconfig -p | grep libEGL.so.1 | cut -d ">" -f 2 | xargs) $APP_DIR/usr/lib/ # Otherwise F23 cannot load the Qt platform plugin "xcb"
# this prevents "symbol lookup error libunity-gtk-module.so: undefined symbol: g_settings_new" on ubuntu 14.04
rm -f $APP_DIR/usr/lib/qt5/plugins/platformthemes/libqgtk2.so || true
rmdir $APP_DIR/usr/lib/qt5/plugins/platformthemes || true # should be empty after deleting libqgtk2.so
rm -f $APP_DIR/usr/lib/libgio* || true # these are not needed if we don't use gtk
# Removed unused parts of Qt
rm -f $APP_DIR/usr/lib/libQt5PrintSupport.so.5 || true
rm -f $APP_DIR/usr/lib/libQt5Network.so.5 || true
rm -f $APP_DIR/usr/lib/libQt5Sql.so.5 || true
# Delete potentially dangerous libraries
rm -f $APP_DIR/usr/lib/libstdc* $APP_DIR/usr/lib/libgobject* $APP_DIR/usr/lib/libc.so.* || true
# The following are assumed to be part of the base system
rm -f $APP_DIR/usr/lib/libgtk-x11-2.0.so.0 || true # this prevents Gtk-WARNINGS about missing themes
rm -f $APP_DIR/usr/lib/libdbus-1.so.3 || true # this prevents '/var/lib/dbus/machine-id' error on fedora 22/23 live cd
rm -f $APP_DIR/usr/lib/libGL.so.* || true
rm -f $APP_DIR/usr/lib/libdrm.so.* || true
rm -f $APP_DIR/usr/lib/libxcb.so.1 || true
rm -f $APP_DIR/usr/lib/libX11.so.6 || true
rm -f $APP_DIR/usr/lib/libcom_err.so.2 || true
rm -f $APP_DIR/usr/lib/libcrypt.so.1 || true
rm -f $APP_DIR/usr/lib/libdl.so.2 || true
rm -f $APP_DIR/usr/lib/libexpat.so.1 || true
rm -f $APP_DIR/usr/lib/libfontconfig.so.1 || true
rm -f $APP_DIR/usr/lib/libgcc_s.so.1 || true
rm -f $APP_DIR/usr/lib/libglib-2.0.so.0 || true
rm -f $APP_DIR/usr/lib/libgpg-error.so.0 || true
rm -f $APP_DIR/usr/lib/libgssapi_krb5.so.2 || true
rm -f $APP_DIR/usr/lib/libgssapi.so.3 || true
rm -f $APP_DIR/usr/lib/libhcrypto.so.4 || true
rm -f $APP_DIR/usr/lib/libheimbase.so.1 || true
rm -f $APP_DIR/usr/lib/libheimntlm.so.0 || true
rm -f $APP_DIR/usr/lib/libhx509.so.5 || true
rm -f $APP_DIR/usr/lib/libICE.so.6 || true
rm -f $APP_DIR/usr/lib/libidn.so.11 || true
rm -f $APP_DIR/usr/lib/libk5crypto.so.3 || true
rm -f $APP_DIR/usr/lib/libkeyutils.so.1 || true
rm -f $APP_DIR/usr/lib/libkrb5.so.26 || true
rm -f $APP_DIR/usr/lib/libkrb5.so.3 || true
rm -f $APP_DIR/usr/lib/libkrb5support.so.0 || true
# rm -f $APP_DIR/usr/lib/liblber-2.4.so.2 || true # needed for debian wheezy
# rm -f $APP_DIR/usr/lib/libldap_r-2.4.so.2 || true # needed for debian wheezy
rm -f $APP_DIR/usr/lib/libm.so.6 || true
rm -f $APP_DIR/usr/lib/libp11-kit.so.0 || true
rm -f $APP_DIR/usr/lib/libpcre.so.3 || true
rm -f $APP_DIR/usr/lib/libpthread.so.0 || true
rm -f $APP_DIR/usr/lib/libresolv.so.2 || true
rm -f $APP_DIR/usr/lib/libroken.so.18 || true
rm -f $APP_DIR/usr/lib/librt.so.1 || true
rm -f $APP_DIR/usr/lib/libsasl2.so.2 || true
rm -f $APP_DIR/usr/lib/libSM.so.6 || true
rm -f $APP_DIR/usr/lib/libusb-1.0.so.0 || true
rm -f $APP_DIR/usr/lib/libuuid.so.1 || true
rm -f $APP_DIR/usr/lib/libwind.so.0 || true
rm -f $APP_DIR/usr/lib/libz.so.1 || true
# patch hardcoded '/usr/lib' in binaries away
find $APP_DIR/usr/ -type f -exec sed -i -e 's|/usr/lib|././/lib|g' {} \;
######################################################
# Create AppImage
######################################################
# Convert the AppDir into an AppImage
$BASE/AppImageKit/AppImageAssistant.AppDir/package $APP_DIR/ $APP_IMAGE
#!/bin/bash
#
# Download and install all prerequisites for making the Ipe AppImage
#
# Halt on errors
set -e
######################################################
# install packages
######################################################
# epel-release for newest Qt and stuff
sudo yum -y install epel-release
sudo yum -y install readline-devel zlib-devel cairo-devel
sudo yum -y install cmake binutils fuse glibc-devel glib2-devel fuse-devel gcc zlib-devel # AppImageKit dependencies
sudo yum -y install poppler-devel
# Need a newer gcc, getting it from Developer Toolset 2
sudo wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
sudo yum -y install devtoolset-2-gcc devtoolset-2-gcc-c++ devtoolset-2-binutils
# /opt/rh/devtoolset-2/root/usr/bin/gcc
# now holds gcc and c++ 4.8.2
#scl enable devtoolset-2
source /opt/rh/devtoolset-2/enable
######################################################
# Install Qt
######################################################
#wget http://download.qt.io/official_releases/online_installers/qt-unified-linux-x86-online.run
#chmod +x qt-unified-linux-x86-online.run
#./qt-unified-linux-x86-online.run --script qt-installer-noninteractive.qs
# wget http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-linux-x64-5.5.1.run
# chmod +x qt-opensource-linux-x64-5.5.1.run
# ./qt-opensource-linux-x64-5.5.1.run --script qt-installer-noninteractive.qs
sudo yum -y install qt5-qtbase-devel qt5-qtbase-gui
# qt5-qtlocation-devel qt5-qtscript-devel qt5-qtwebkit-devel qt5-qtsvg-devel qt5-linguist qt5-qtconnectivity-devel
######################################################
# build libraries from source
######################################################
# Change directory to build. Everything happens in build.
mkdir build
cd build
# libjpeg
wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz
tar xfvz jpegsrc.v8d.tar.gz
cd jpeg-8d
./configure && make && sudo make install
cd ..
# lua
wget http://www.lua.org/ftp/lua-5.3.3.tar.gz
tar xfvz lua-5.3.3.tar.gz
cd lua-5.3.3/src
#sed -i 's/^CFLAGS=/CFLAGS= -fPIC /g' Makefile
cd ..
make linux CFLAGS="-fPIC"
sudo make install
cd ..
# libpng
wget http://download.sourceforge.net/libpng/libpng-1.6.21.tar.gz
tar xfvz libpng-1.6.21.tar.gz
cd libpng-1.6.21
./configure
make check
sudo make install
cd ..
# qhull
wget http://www.qhull.org/download/qhull-2015-src-7.2.0.tgz
tar xfvz qhull-2015-src-7.2.0.tgz
cd qhull-2015.2
make
sudo install -d /usr/local/include/qhull
sudo install -m 0644 src/libqhull/*.h /usr/local/include/qhull
sudo install -m 0755 lib/libqhullstatic.a /usr/local/lib
cd ..
######################################################
# Build AppImageKit (into top level)
######################################################
cd ..
git clone https://github.com/probonopd/AppImageKit.git
cd AppImageKit/
git checkout master
cmake .
make clean
make
######################################################
#!/bin/bash
CMD=$1
if [ "x${CMD}x" == "xx" ]; then
ipe -style fusion "$@"
else
shift
$CMD "$@"
fi
ipe-tools (1:7.2.7-1) unstable; urgency=medium
* Team upload.
* New upstream version (added epoch to enable real versioning)
* Add Vcs fields
* cme fix dpkg-control; cme fix dpkg-copyright
* debhelper 10
* Replace python-imaging by python-pil
Closes: #866435
* Enhance descriptions
* DEP5
* Standards-Version: 4.1.3
* hardening=+all
* Add watch file
-- Andreas Tille <tille@debian.org> Mon, 08 Jan 2018 18:42:33 +0100
ipe-tools (20150406-3) unstable; urgency=medium
[ Alexander Bürger ]
......
Source: ipe-tools
Section: graphics
Priority: extra
Maintainer: Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Uploaders: Steve M. Robbins <smr@debian.org>
Build-Depends: debhelper (>= 9), libz-dev, dh-python, python,
pkg-config, libpoppler-private-dev
Standards-Version: 3.9.6
Section: graphics
Priority: optional
Build-Depends: debhelper (>= 10),
libz-dev,
dh-python,
python,
pkg-config,
libpoppler-private-dev
Standards-Version: 4.1.3
Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/ipe-tools.git
Vcs-Git: https://anonscm.debian.org/git/debian-science/packages/ipe-tools.git
Homepage: https://github.com/otfried/ipe-tools
Package: figtoipe
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Recommends: ipe, netpbm
Breaks: ipe (<<6.0pre30-1)
Replaces: ipe (<<6.0pre30-1)
Depends: ${shlibs:Depends},
${misc:Depends}
Recommends: ipe,
netpbm
Description: convert FIG files to XML files for ipe
Ipe is a drawing editor for creating figures, provided in package ipe.
.
Figtoipe is a program that reads FIG files (as generated by xfig) and
generates an XML file readable by Ipe.
Package: ipe5toxml
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Depends: ${misc:Depends},
${shlibs:Depends}
Recommends: ipe
Description: converts Ipe5 figures to an XML file readable by Ipe
Description: converts Ipe5 figures to an XML file readable by Ipe
Converts figures that were made with Ipe 5 to the format understood
by Ipe 6. You can then run ipe6upgrade (from package ipe) to convert
them to Ipe 7 format. Ipe is a drawing editor for creating figures,
......@@ -30,14 +39,24 @@ Description: converts Ipe5 figures to an XML file readable by Ipe
Package: pdftoipe
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Depends: ${shlibs:Depends},
${misc:Depends}
Recommends: ipe
Description: converts arbitrary PDF file to XML file readable by Ipe
Ipe is a drawing editor for creating figures, provided in package ipe.
.
This package contains a tool to convert drawings in PDF format to
XML that can be used by ipe editor.
Package: svgtoipe
Architecture: all
Depends: python, ${misc:Depends}, ${python:Depends}
Recommends: ipe, python-imaging
Depends: python,
${misc:Depends},
${python:Depends}
Recommends: ipe,
python-pil
Description: converts SVG figures to an XML file readable by Ipe
Ipe is a drawing editor for creating figures, provided in package ipe.
.
This package contains a tool to convert drawings in SVG format to
XML that can be used by ipe editor.
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: ipe-tools
Upstream-Contact: Otfried Cheong <otfried@ipe.airpost.net>
Source: https://github.com/otfried/ipe-tools
Files: figtoipe/* gpl.txt README.md
Files: *
Copyright: 1993-2008, Otfried Cheong <otfried@ipe.airpost.net>
2007-2015, Alexander Bürger <acfb@users.sf.net>
License: GPL-2+
See /usr/share/common-licenses/GPL-2
Files: ipe5toxml/*
Copyright: 2005, Otfried Cheong <otfried@ipe.airpost.net>
......@@ -35,8 +34,6 @@ License: GPL-3+
Files: matplotlib/*
Copyright: 2014, Otfried Cheong <otfried@ipe.airpost.net>
2014, Soyeon Baek
Comment:
not included in debian package
License: SimpleXMLWriterLicense
By obtaining, using, and/or copying this software and/or its
associated documentation, you agree that you have read, understood,
......@@ -59,9 +56,13 @@ License: SimpleXMLWriterLicense
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE.
Comment:
not included in debian package
Files: debian/* .gitignore
Copyright: 2005-2011 Steve Robbins <smr@debian.org>
2008-2015, Alexander Bürger <acfb@users.sf.net>
License: GPL-2+
License: GPL-2+
See /usr/share/common-licenses/GPL-2
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
%:
dh $@ --with python2
......
# Lintian bug #779676
ipe-tools source: dep5-copyright-license-name-not-unique
version=4
https://github.com/otfried/ipe-tools/releases .*/archive/v@ANY_VERSION@@ARCHIVE_EXT@
......@@ -29,7 +29,7 @@ should then not expect a reply.
Alexander Bürger, acfb@users.sourceforge.net
Otfried Cheong, otfried@ipe.airpost.net
Ipe webpage: http://ipe7.sf.net
Ipe webpage: http://ipe.otfried.org
--------------------------------------------------------------------
......
__pycahce__/
out/
tmp.py
*.pyc
......@@ -17,7 +17,7 @@ Use it as an external backend from matplotlib like this:
# --------------------------------------------------------------------
from __future__ import division, print_function
from __future__ import division, print_function, unicode_literals
import os, base64, tempfile, urllib, gzip, io, sys, codecs, re
......@@ -45,7 +45,7 @@ negative_number = re.compile(u"^\u2212([0-9]+)(\.[0-9]*)?$")
rcParams.validate['ipe.textsize'] = validate_bool
rcParams.validate['ipe.stylesheet'] = validate_path_exists
rcParams.validate['ipe.preamble'] = lambda (s) : s
rcParams.validate['ipe.preamble'] = lambda s : s
# ----------------------------------------------------------------------
# SimpleXMLWriter class
......@@ -147,8 +147,7 @@ class XMLWriter:
if attrib or extra:
attrib = attrib.copy()
attrib.update(extra)
attrib = attrib.items()
attrib.sort()
attrib = sorted(attrib.items())
for k, v in attrib:
if not v == '':
k = escape_cdata(k)
......@@ -216,7 +215,7 @@ class XMLWriter:
# can be omitted.
def element(self, tag, text=None, attrib={}, **extra):
apply(self.start, (tag, attrib), extra)
self.start(*(tag, attrib), **extra)
if text:
self.data(text)
self.end(indent=False)
......@@ -255,15 +254,15 @@ class RendererIpe(RendererBase):
version=u"70005",
creator="matplotlib")
pre = rcParams.get('ipe.preamble', "")
if pre <> "":
if pre != "":
self.writer.start(u'preamble')
self.writer.data(pre)
self.writer.end(indent=False)
sheet = rcParams.get('ipe.stylesheet', "")
if sheet <> "":
if sheet != "":
self.writer.insertSheet(sheet)
self.writer.start(u'ipestyle', name=u"opacity")
for i in range(10,100,10):
self.writer.element(u'opacity', name=u'%02d%%'% i,
value=u'%g'% (i/100.0))
......@@ -494,8 +493,10 @@ class FigureCanvasIpe(FigureCanvasBase):
# Provide the standard names that backend.__init__ is expecting
class FigureManagerIpe(FigureManagerBase):
pass
def __init__(self, *args):
FigureManagerBase.__init__(self, *args)
FigureCanvas = FigureCanvasIpe
FigureManager = FigureManagerIpe
def new_figure_manager(num, *args, **kwargs):
......@@ -517,7 +518,7 @@ def _cleanup():
LatexManager._cleanup_remaining_instances()
# This is necessary to avoid a spurious error
# caused by the atexit at the end of the PGF backend
LatexManager.__del__ = lambda (self) : None
LatexManager.__del__ = lambda self : None
atexit.register(_cleanup)
......
......@@ -2,13 +2,14 @@
# Run all the tests in tests subdirectory
# and save plots in ipe and svg format
#
from __future__ import division, print_function, unicode_literals
import os, sys
def fix_file(f):
data = open("tests/%s" % f, "rb").readlines()
data = open("tests/%s" % f, "r").readlines()
os.rename("tests/%s" % f, "tests/%s.bak" % f)
out = open("tests/%s" % f, "wb")
out = open("tests/%s" % f, "w")
for l in data:
ll = l.strip()
if ll == "import matplotlib as mpl": continue
......@@ -30,13 +31,13 @@ def runall(form):
def run(form, f):
sys.stderr.write("# %s\n" % f)
t = open("tmp.py", "wb")
t = open("tmp.py", "w")
t.write("""# %s
import matplotlib as mpl
""" % f)
if form=="ipe":
t.write("mpl.use('module://backend_ipe')\n")
t.write(open("tests/%s.py" % f, "rb").read())
t.write(open("tests/%s.py" % f, "r").read())
t.write("plt.savefig('out/%s.%s', format='%s')\n" % (f, form, form))
t.close()
os.system("python tmp.py")
......
......@@ -16,9 +16,11 @@ else ifdef IPECROSS
LDFLAGS += -static
TARGET = pdftoipe.exe
else
CPPFLAGS += $(shell pkg-config --cflags poppler)
LIBS += $(shell pkg-config --libs poppler)
TARGET = pdftoipe
POPPLER_CFLAGS ?= $(shell pkg-config --cflags poppler)
POPPLER_LIBS ?= $(shell pkg-config --libs poppler)
CPPFLAGS += $(POPPLER_CFLAGS)
LIBS += $(POPPLER_LIBS)
TARGET = pdftoipe
endif
CXXFLAGS += -Wno-write-strings
......
......@@ -32,7 +32,7 @@ direct Email.
KAIST
Daejeon, South Korea
Email: otfried@ipe.airpost.net
Ipe webpage: http://ipe7.sourceforge.net
Ipe webpage: http://ipe.otfried.org
--------------------------------------------------------------------
......
# Ipe in a snap
Linux users suffer from the problem that Linux distributions provide
packages for rather old versions of Ipe. For instance, Ubuntu 16.04
still provides Ipe 7.1.10 (from late 2015). Distributions tend to be
conservative to ensure the stability of the system.
[**Snappy**](http://snapcraft.io) is a new system that provides apps
in *encapsulated blocks* called **snaps**. A bug in a snap does not
affect the robustness of the remaining sytem, and so users can freely
upgrade individual snaps at will. From now on, Ipe will provide an
up-to-date snap for each Ipe release, such that Linux users, like
Windows and OSX users, can upgrade easily and immediately.
Snappy is available on recent Linux distributions such as Ubuntu
16.04, etc. You install the system by installing the **snapd**
package. On Ubuntu or Debian, you would use
```
sudo apt-get install snapd
```
See http://snapcraft.io/docs/core/install for how to install Snapcraft
on other Linux distributions such as Fedora,
## Installing Ipe in a snap
Once you have the **snap** command on your system, you can install the
most recent version of Ipe by saying
```
sudo snap install ipe --edge
```
You can now start Ipe by simply saying `ipe` (which calls
`/snap/bin/ipe`). Note that the other Ipe commands are available as
`ipe.ipetoipe`, `ipe.iperender`, etc.
## How Ipe uses Pdflatex
Snappy isolates each snap to ensure the robustness of the system when
a snap misbehaves. This implies some severe restrictions: Ipe does
not have access to your system's files (with the exception of the
files in your home directory that do not start with a dot). In
particular, Ipe does not have access to the Latex installation on your
system!
To allow Ipe to run *pdflatex*, the Ipe snap contains a *small Texlive
installation*. You will need to remember this when Ipe fails to find
a Latex style or package. In this case, you will need to install the
Latex package **inside** the snap.
Note that the following commands are exposed by the snap to help you
find Latex problems: `ipe.pdflatex`, `ipe.lualatex`, `ipe.kpsewhich`.
## Installing additional Latex packages
You cannot actually add additional Latex packages to the Texlive
installation inside a snap, as snaps reside entirely in read-only
memory. However, Ipe's Latex installation can use a *user tree* where
you can add additional styles and fonts. To install into this user
tree, you run the *texlive manager* `tlmgr` contained in the snap.
For technical reasons, it has to be run from outside the snap, like
this:
```
/snap/ipe/current/bin/tlmgr install dante-logo
```
## What doesn't work?
* The Ipe icon is not shown on the desktop (apparently a bug in
snappy).
* Opening the manual from the Ipe Help menu currently doesn't work
(apparently a bug in snappy). You can read the manual by opening
the file `/snap/ipe/current/ipe/doc/manual.html`.
* Declaring an external editor doesn't work. This is currently a
fundamental limitation of snappy (Ipe has no access to running an
editor program that lives outside the snap).
## Anything else?
If you want to customize Ipe, you will need to know that some files
are in locations different from a classic Linux setup. Use *Show
configuration* in the Help menu to find the right place. For
instance, Ipe runs Latex in `~/snap/ipe/current/latexrun` (rather than
`~/.ipe/latexrun`), and the ipelet directory is
`~/snap/ipe/common/ipelets` rather than `~/.ipe/ipelets`.
#!/bin/sh
SNAP="/snap/ipe/current"
COMMAND=$1
shift
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu"
exec $SNAP/bin/$COMMAND $@
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
import os
from subprocess import Popen, PIPE
import snapcraft
from snapcraft.plugins import dump
extras = [ "xcolor", "tcolorbox", "pgf", "ms", "environ", "pgfplots",
"metalogo", "trimspaces", "etoolbox" ]
class TexLivePlugin(snapcraft.plugins.dump.DumpPlugin):
def build(self):
super(dump.DumpPlugin, self).build()
# Install TexLive with the standard installer
env = self._build_environment()
p1 = Popen(['echo', '-n', 'I'], env=env, stdout=PIPE)
p2 = Popen(['{}/install-tl'.format(self.builddir), '-portable', '-scheme', 'basic'], env=env, stdin=p1.stdout, stdout=PIPE)
output = p2.communicate()[0]
self.run(['{}/texlive/bin/x86_64-linux/tlmgr'.format(self.installdir),
'install'] + extras, env=env)
def _build_environment(self):
env = os.environ.copy()
env['TEXLIVE_INSTALL_PREFIX'] = os.path.join(self.installdir, 'texlive')
return env
[Desktop Entry]
Name=Ipe
Exec=ipe
Type=Application
name: ipe
version: 7.2.6
summary: Ipe http://ipe.otfried.org/
description: Drawing editor for creating figures in PDF format.
Ipe supports making small figures for inclusion into LaTeX
documents as well as making multi-page PDF presentations.
Ipe's main features are
* Entry of text as LaTeX source code. This makes it easy to enter
mathematical expressions, and to reuse the LaTeX-macros of the main
document. In the display text is displayed as it will appear in
the figure.
* Produces pure Postscript/PDF, including the text. Ipe converts the
LaTeX-source to PDF or Postscript when the file is saved.
* It is easy to align objects with respect to each other (for
instance, to place a point on the intersection of two lines, or to
draw a circle through three given points) using various snapping
modes.
* Users can provide ipelets (Ipe plug-ins) to add functionality to
Ipe. This way, Ipe can be extended for each task at hand.
* The text model is based on Unicode, and has been tested with Korean,
Chinese, and Japanese.
grade: devel
confinement: strict
parts:
ipe:
source: https://dl.bintray.com/otfried/generic/ipe/7.2/ipe-7.2.6-src.tar.gz
source-subdir: src
plugin: make
make-parameters:
- IPESNAPCRAFT=1
- IPEQVORONOI=1
- QT_SELECT=5
- IPESTRICT=1
build-packages:
- libcairo2-dev
- libfreetype6-dev
- liblua5.3-dev
- libjpeg8-dev
- libpng12-dev
- make
- qtbase5-dev
- qtbase5-dev-tools
- zlib1g-dev
- libqhull-dev
after: [desktop-qt5]
wrapper:
plugin: dump
source: ./wrapper
organize:
wrapper.sh: bin/wrapper.sh
tlmgr.sh: bin/tlmgr
texlive:
plugin: texlive
source: http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
build-packages:
- wget
snap:
- -texlive/texmf-dist/doc
- -texlive/texmf-dist/source
- -texlive/texmf-dist/tex/context
- -texlive/texmf-dist/tex/plain
- -texlive/texmf-var/web2c/luatex/dvi*
- -texlive/texmf-var/web2c/luatex/luatex.*
- -texlive/texmf-var/web2c/luajittex/
- -texlive/texmf-var/web2c/tex/
- -texlive/texmf-var/web2c/metafont
- -texlive/texmf-var/web2c/pdftex/etex.*
- -texlive/texmf-var/web2c/pdftex/latex.*
- -texlive/texmf-var/web2c/pdftex/mptopdf.*
- -texlive/texmf-var/web2c/pdftex/pdfetex.*
- -texlive/texmf-var/web2c/pdftex/pdftex.*
- -texlive/bin/x86_64-linux/xdvi*
- -texlive/bin/x86_64-linux/luajittex
- -texlive/bin/x86_64-linux/g*
- -texlive/bin/x86_64-linux/dvi*
apps:
ipe:
command: desktop-launch wrapper.sh ipe
plugs: [x11, home]
ipetoipe:
command: wrapper.sh ipetoipe
plugs: [home]
ipeextract:
command: wrapper.sh ipeextract
plugs: [home]
iperender:
command: wrapper.sh iperender
plugs: [home]
ipescript:
command: wrapper.sh ipescript
plugs: [home]
ipe6upgrade:
command: wrapper.sh ipe6upgrade
plugs: [home]
pdflatex:
command: wrapper.sh pdflatex
plugs: [home]
lualatex:
command: wrapper.sh lualatex
plugs: [home]
bibtex:
command: wrapper.sh bibtex
plugs: [home]
kpsewhich:
command: wrapper.sh kpsewhich
plugs: [home]
sh:
command: wrapper.sh sh
plugs: [home]
#!/bin/bash --posix
# This should be run outside the snap,
# as the Perl in the snap is incomplete and cannot execute tlmgr.pl
findSnap() {
local source="${BASH_SOURCE[0]}"
while [ -h "$source" ] ; do
local linked="$(readlink "$source")"
local dir="$(cd -P $(dirname "$source") && cd -P $(dirname "$linked") && pwd)"
source="$dir/$(basename "$linked")"
done
(cd -P "$(dirname "$source")/.." && pwd)
}
export SNAP="$(findSnap)"
export TEXMFHOME=$HOME/snap/ipe/common/texmf
TLMGR="$SNAP/texlive/bin/x86_64-linux/tlmgr"
#echo "SNAP is $SNAP"
#echo "TEXMFHOME is $TEXMFHOME"
if [ ! -d "$TEXMFHOME" ]; then
echo "Creating personal texlive tree..."
mkdir -p "$TEXMFHOME"
perl $TLMGR init-usertree --usermode
fi
perl $TLMGR $@ --usermode
#!/bin/sh
export PATH="$SNAP/texlive/bin/x86_64-linux:$PATH"
export TEXMFHOME="$SNAP_USER_COMMON/texmf"
export IPELATEXDIR="$SNAP_USER_DATA/latexrun"
export IPELETPATH="$SNAP_USER_COMMON/ipelets:_"
export IPESTYLES="$SNAP_USER_COMMON/styles:_"
exec "$@"
......@@ -38,11 +38,11 @@ direct Email.
KAIST
Daejeon, South Korea
Email: otfried@ipe.airpost.net
Ipe webpage: http://ipe7.sourceforge.net
Ipe webpage: http://ipe.otfried.org
--------------------------------------------------------------------
Copyright (C) 2009-2014 Otfried Cheong
Copyright (C) 2009-2016 Otfried Cheong
svgtoipe is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
......@@ -64,6 +64,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Changes
=======
* 2016/12/09
Command line argument to generate Ipe selection format, ability to
read/write stdin/stdout (thanks to Christian Kapeller).
* 2013/11/07
Bugs in path parsing and Latex generation fixed by Will Evans.
......
......@@ -5,19 +5,45 @@ svgtoipe \- Convert a SVG file to Ipe 7 format
.SH SYNOPSIS
.B svgtoipe
\fIfigure.svg [ figure.svg ]\fR
\fI[\-h] [\-c] figure.svg [figure.ipe] \fR
.SH DESCRIPTION
\fBsvgtoipe\fR converts a SVG file to an XML file understood by Ipe
version 7. If the output filename is not specified, it will be derived
version 7.
.PP
If the output filename is not specified, it will be derived
either by replacing \fI.ipe\fR at the end of the input filename with
\fI.svg\fR, or by appending \fI.ipe\fR if the input filename does not
end with with \fI.svg\fR.
Images are converted if python-imaging is available.
If either input or output filename is '\-\-', then stdin, resp. stdout
is used to read or write data.
.TP
\-h
display a short help text
.TP
\-c
operate in clipboard mode. Data is output as ipe clipboard content.
This allows pasting svg data from inkscape to ipe:
(1) Copy elements Inkscape to clipboard,
(2) run: 'xsel | ./svgtoipe.py -c -- | xsel -i',
(3) paste clipboard content into ipe.
.SH Supported SVG Features
The following SVG elements are converted: path, image, rect, circle, ellipse,
line, polygon, and polyline
The following SVG elements are converted: group, clipPath, linearGradient,
andradialGradient
Image conversion is only supported if \fIpython-imaging\fR is available. Text
is only converted, if it has coordinates specified as attribute of the svg text
element.
.SH AUTHOR
Otfried Cheong
Christian Kapeller
.SH "SEE ALSO"
\fBipe\fR(1)
This diff is collapsed.