From 704f04dbe3fb8545dd7a1c0adfe135113ccd9e47 2012-04-30 17:42:52 From: Matthias BUSSONNIER Date: 2012-04-30 17:42:52 Subject: [PATCH] full inkscape path on OS X need to use the full inkscape path on osx to use it as a command line --- diff --git a/nbconvert.py b/nbconvert.py index ac3aa7b..909e75f 100755 --- a/nbconvert.py +++ b/nbconvert.py @@ -23,6 +23,12 @@ import re import subprocess import sys +inkscape = 'inkscape' +if sys.platform == 'darwin': + inkscape = '/Applications/Inkscape.app/Contents/Resources/bin/inkscape' + if not os.path.exists(inkscape): + inkscape = None + # From IPython from IPython.external import argparse from IPython.nbformat import current as nbformat @@ -559,7 +565,7 @@ class ConverterLaTeX(Converter): def _svg_lines(self, img_file): base_file = os.path.splitext(img_file)[0] pdf_file = base_file + '.pdf' - subprocess.check_call(['inkscape', '--export-pdf=%s' % pdf_file, + subprocess.check_call([ inkscape, '--export-pdf=%s' % pdf_file, img_file]) return self._img_lines(pdf_file)