From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: best ways to generate simple diagrams? Date: Wed, 08 May 2019 06:06:05 +0200 Message-ID: <877eb1mvyq.fsf@mbork.pl> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:43794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hODrj-0004QM-S9 for emacs-orgmode@gnu.org; Wed, 08 May 2019 00:07:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hODri-00023y-81 for emacs-orgmode@gnu.org; Wed, 08 May 2019 00:07:35 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:35320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hODri-0001yz-1M for emacs-orgmode@gnu.org; Wed, 08 May 2019 00:07:34 -0400 In-reply-to: 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" To: Matt Price Cc: Org Mode On 2019-05-06, at 20:17, Matt Price wrote: > So, I'm finding more and more that I want to include simple diagrams in my > course materials. At present I am generating them as svg's using Inkscape, > but that feels really tiresome to me. I would much rather make them > programmatically, preferably including the source code as an org-mode block. > > I thought ditaa would be the tool for this, but I cannot figure out how to > do this work efficiently in ditaa. So for instance, I have this simple svg > file (attached). It consists of two text-containing symmetrical rectangles > separated by a bit of whitespace and connected by two curved arrows (one > pointing from each of the rectangles to the other). > > Trying to replicate this in ditaa did not prove easy. Editing feels > extremely labourious. Am I missing something? Is there a really good > tutorial somehwere that I'm just not finding? Or is there maybe another > tool I should be using instead? Eric beat me to mentioning TikZ, which I've been using to create all sorts of drawings for the past ten years or so. Another TeX-related tool is METAPOST. TikZ is apparently inspired by it a lot, and it has some very nice features (like solving systems of linear equations given in a declarative style to get intersection points of straight lines - very handy). There is another macro system built on top of it, called METAFUN (https://wiki.contextgarden.net/MetaFun). Since you mentioned exporting to HTML, d3.js came to my mind immediately. I don't have a lot of experience with it, and its main aim is something different, but it's definitely worth knowing about. Last but not least, I guess writing directly in SVG format might or might not be what you want. (I remember ye olden days when they said that XML was something to be written and read by humans... And in some cases this is in fact true!) Hth, -- Marcin Borkowski http://mbork.pl