From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: babel for ditaa-eps Date: Thu, 20 Sep 2012 19:20:49 -1000 Message-ID: References: <50509584.30704@kit.edu> <87txv2o63m.fsf@gmx.com> <5051C947.2000505@kit.edu> <877grynexk.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TEvff-0007KT-QL for emacs-orgmode@gnu.org; Fri, 21 Sep 2012 01:21:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TEvfe-0004Mm-CV for emacs-orgmode@gnu.org; Fri, 21 Sep 2012 01:20:59 -0400 Received: from oproxy12-pub.bluehost.com ([50.87.16.10]:59598) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TEvfe-0004ML-3X for emacs-orgmode@gnu.org; Fri, 21 Sep 2012 01:20:58 -0400 In-Reply-To: <877grynexk.fsf@gmx.com> (Eric Schulte's message of "Thu, 13 Sep 2012 09:03:03 -0600") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: emacs-orgmode@gnu.org, "Arne Babenhauserheide (IMK)" Eric Schulte writes: > "Arne Babenhauserheide (IMK)" writes: > >> Hi Eric, >> >> It=E2=80=99s much easier to answer, what this does not share with ob-dit= aa.el :) >> >> If I cut out the obvious renaming (to be able to use a ditaa-exp >> source type), it=E2=80=99s just this diff (and the first half of that on= ly >> defines variables=E2=80=A6): >> > > Hi Arne, > > I re-worked your diff into a patch against ob-ditaa.el which adds an > :eps header argument to ditaa code blocks. Please try this out and let > me know if it works and if it loses any functionality from your original > ob-ditaa-eps.el. > > Should we distribute the DitaaEps.jar with Org-mode in the same manner > as we now distribute ditaa.jar? Is it possible to distribute DitaaEps.jar with Org? Or, does it need to be installed separately? All the best, Tom > > From 643d59bfebc2a917bdd4b5da002df4b663f65be2 Mon Sep 17 00:00:00 2001 > From: Eric Schulte > Date: Thu, 13 Sep 2012 08:58:31 -0600 > Subject: [PATCH] adding :eps header argument to ditaa code blocks > > Use of this header argument will change the back-end engine from > ditaa.jar to a combination of DitaaEps.jar and epstopdf. > > This patch is based off of ob-ditaa-eps.el sent to the mailing list by > Arne Babenhauserheide (IMK). > --- > lisp/ob-ditaa.el | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > > diff --git a/lisp/ob-ditaa.el b/lisp/ob-ditaa.el > index 1c6c712..3fbf50b 100644 > --- a/lisp/ob-ditaa.el > +++ b/lisp/ob-ditaa.el > @@ -57,6 +57,9 @@ > :group 'org-babel > :type 'string) >=20=20 > +(defcustom org-ditaa-eps-jar-path > + (expand-file-name "DitaaEps.jar" (file-name-nondirectory org-ditaa-jar= -path))) > + > (defcustom org-ditaa-jar-option "-jar" > "Option for the ditaa jar file. > Do not leave leading or trailing spaces in this string." > @@ -76,16 +79,24 @@ This function is called by `org-babel-execute-src-blo= ck'." > (cmdline (cdr (assoc :cmdline params))) > (java (cdr (assoc :java params))) > (in-file (org-babel-temp-file "ditaa-")) > + (eps (cdr (assoc :eps params))) > (cmd (concat "java " java " " org-ditaa-jar-option " " > (shell-quote-argument > - (expand-file-name org-ditaa-jar-path)) > + (expand-file-name > + (if eps org-ditaa-eps-jar-path org-ditaa-jar-path))) > " " cmdline > " " (org-babel-process-file-name in-file) > - " " (org-babel-process-file-name out-file)))) > + " " (org-babel-process-file-name out-file))) > + (eps-cmd (when eps > + (concat > + "epstopdf" > + " " (org-babel-process-file-name (concat in-file ".eps")) > + " -o=3D" (org-babel-process-file-name out-file))))) > (unless (file-exists-p org-ditaa-jar-path) > (error "Could not find ditaa.jar at %s" org-ditaa-jar-path)) > (with-temp-file in-file (insert body)) > (message cmd) (shell-command cmd) > + (when eps (message eps-cmd) (shell-command eps-cmd)) > nil)) ;; signal that output has already been written to file >=20=20 > (defun org-babel-prep-session:ditaa (session params) > --=20 > 1.7.12 --=20 Thomas S. Dye http://www.tsdye.com