From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: org-exp-block patch and Graphviz Demo Date: Thu, 28 May 2009 06:44:14 -0700 Message-ID: References: <20090527190924.GS10324@thinkpad.adamsinfoserv.com> <240CD10F-57E8-4AEB-B2D1-E03A9851DB41@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M9fuJ-0004i6-Kf for emacs-orgmode@gnu.org; Thu, 28 May 2009 09:44:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M9fuE-0004XF-MQ for emacs-orgmode@gnu.org; Thu, 28 May 2009 09:44:30 -0400 Received: from [199.232.76.173] (port=36211 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9fuE-0004W2-2e for emacs-orgmode@gnu.org; Thu, 28 May 2009 09:44:26 -0400 Received: from mail-px0-f179.google.com ([209.85.216.179]:34337) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M9fuC-0008BQ-4o for emacs-orgmode@gnu.org; Thu, 28 May 2009 09:44:24 -0400 Received: by pxi9 with SMTP id 9so5454053pxi.14 for ; Thu, 28 May 2009 06:44:18 -0700 (PDT) In-Reply-To: <240CD10F-57E8-4AEB-B2D1-E03A9851DB41@gmail.com> (Carsten Dominik's message of "Thu, 28 May 2009 09:48:51 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Russell Adams , Org Mode List Carsten Dominik writes: > On May 27, 2009, at 9:09 PM, Russell Adams wrote: > >> I updated org-exp-block.el to support other Graphviz output types (ie: >> neato, fdp, twopi, and circo.), and created a test document to >> demonstrate each type. >> >> Attached is a tar file containing the demo, diff, and updated >> org-exp-block.el. It could use some tuning before being permanently >> applied, see the comments within. >> >> I considered posting this to Worg, but was concerned that it would >> bomb without the updated block support. After its added to core, I'd >> be happy to post this into Worg. >> Hi Russel, Thanks for the update, and for the clear exposition in the org demo file. I think that rather than changing the specification of the dot block (which will break existing org files) we should create new block files. Either create a single graphviz file, which will accept an argument indicating which command to use, or create a new block type for each command. I'm not sure which of these approaches would be preferred... They should both require only small changes to your existing code. If we were starting from scratch my preference would be a single graphviz block type, however in order to maintain functionality for existing org-mode documents, in this case I would lean towards generating a block type for each command. I suppose we could support both options. any suggestions? I certainly agree that a change along these lines should be added to the version of org-exp-block.el distributed with org mode. Also, sorry about the delayed reply, I was waiting until I found the time to actually look over your attached files. >> >> >> My next question relates to using Graphviz between HTML and Latex >> export. When I do HTML I don't mind using PNG, however with Latex it >> is better to export to EPS. That way you export to a vector format >> that looks superb in the final PDF. This requires a postprocessing >> step that I'm not sure how to integrate. >> >> From one of my Makefiles, I use this line to fix the EPS so that Latex >> can import it: >> >> sed -i -e 's/PS-Adobe-2.0/PS-Adobe-2.0 EPSF-1.2/1' $@ > > Maybe this needs a bug report to the Graphviz people??? > +1 > > I guess the best solution would actually be to allow a lisp > function to do the formatting, and it should return the > link to be used. then you can implement whatever is needed. > > Eric, would that make sense? > Yes, Although I'm not sure how best to automatically associate a lisp (or shell) function as a post processing step, and to then pass the file path used in this block to said function... Possibly a something along the lines of a #+postprocessing: line immediately preceding the block. However that would be a general solution. If our goal is just to allow post processing in this instance, I believe that using defadvice would be the easiest hack. Make sure that the last statement in `org-export-blocks-format-dot' returns the file path, and then try something like the following... --8<---------------cut here---------------start------------->8--- (defadvice org-export-blocks-format-dot (around fix-eps-org-export-blocks-format-dot activate) "Fix graphviz eps output." (let ((file ad-do-it)) (shell-command (format "sed -i -e 's/PS-Adobe-2.0/PS-Adobe-2.0 EPSF-1.2/1' %s" file)))) --8<---------------cut here---------------end--------------->8--- Cheers -- Eric > > - Carsten