wingologA mostly dorky weblog by Andy Wingo2007-07-11T16:56:42Ztekutihttps://wingolog.org/feed/atomAndy Wingohttps://wingolog.org/fold, xml, presentationshttps://wingolog.org/2007/07/11/fold-xml-presentations2007-07-11T16:56:42Z2007-07-11T16:56:42Z

Good afternoon, world. I have a bit to write about; we'll see how much of it manages to escape my brain into this page.

fold, xml, presentations

To recap a bit, I've been trying to avoid powerpoint-style applications, especially OpenOffice. OpenOffice is good for some people but it hurts my brain.

After poking about for a while, I decided to make presentations with SVG graphics, with each layer being one slide. I made presentations in Inkscape, and then wrote a tool (in Guile) to split the SVG file into layers, and then make a PDF out of that.

However, the process was not satisfying: it was too hard to enter in the text, and I always had to think about alignment. I wanted to be able to make an SVG presentation programmatically. It turns out that the what has become the standard Scheme XML manipulation combinator, pre-post-order, is not well-suited to performing layout operations.

This is because pre-post-order effectively maps across XML child elements instead of single-threadedly passing a layout seed through the operation. So I started looking how to recast pre-post-order as an extended tree fold (foldts from Oleg's SSAX paper). I wrote up the results in a paper that I submitted to SFP 2007, Applications of Fold to XML Transformation. We'll see if it gets accepted, it's a bit of an odd endeavor.

Of course, the next time I gave a presentation, I would have to figure out how to use the algorithms that I had worked on, otherwise it would be wasted effort. The occasion was the Jornades del Programari Lliure last week in Girona. Following a recommendation by a kind commenter, I decided to write the presentation in Emacs' Org Mode, then transform its XML export into the presentation language that I defined, then use the algorithms that I presented to transform that into SVG. After the presentation, I cleaned up the scripts I had, and packaged them into a library that I just released, Guile-Present.

Guile-Present is OK. You can write your presentation in Emacs, with all of the fluidity that comes with plain text:

# -*- mode: org; fill-column: 34 -*-
#+TITLE: Medios de (re)producción: GStreamer

* Plan

GStreamer: Multimedia para todos

@fluendo.com: Qué es lo que
estamos haciendo

* GStreamer

** ¿Qué es GStreamer?

 * Una librería multimedia y un
   conjunto de plugins

Then, just run org-to-pdf-presentation on your org file, and you have a PDF ready to present (example; example in english). The PDF output is clean but not pretty. I hope to improve that in the future (read: the next time I give a presentation). I also need to fix some rendering bugs in the HTML documentation, but time is with me these days.

Andy Wingohttps://wingolog.org/fosdem, presentations, foohttps://wingolog.org/2007/03/07/fosdem-presentations-foo2007-03-07T14:09:35Z2007-03-07T14:09:35Z

post-fosdem

Allow me to free-associate about FOSDEM: packed hallways, rainy sidewalks, buttery croissants... actually about food I could go on for quite a while.

People-wise it was pretty good, although with a pervasive feeling of oddness. The free software community has its perceived social hierarchies, and for many people, these conference events are attempts to transfer those hierarchies to real life. So until someone knows what position that you occupy in their mental pecking order, they treat you with lots of distance, and depending on where they put you, potentially lots of distance afterwards.

The GNOME-FR people, on the other hand, were refreshingly exuberant. Very positive people, the Vincents and Guillaumes and the apparently unlinkable Christophe Fergeaus. Of course there were many other excellent folks there, and also of course, not enough time.

presentation

I presented a talk on writing GNOME applications in Scheme. It's available on the interwob as an incorrectly-rendered PDF, or as a tarball of SVGs to be presented with inkview. I was shocked, I had the title slide up for a good 5 minutes or so, but still about 40 people stayed in the room.

Of course with just the slides, you are missing my charm. For better?

meta-presentation

I got loads of wonderful comments on my last writing product, concerned with the mechanics of presentations. Especially useful was the tip that inkscape comes with a slide-show-like wrapper, inkview. Thanks Andy!

Also fascinating was Jos Hirth's XSVG, rendering SVG inside the browser (probably Firefox-only). Pretty cool, that. Maybe next time.

I should mention that I considered using some LaTeX package, but decided not to because I wanted to be able to easily tweak the presentation. That notwithstanding, several people mentioned latex-beamer as being quite good.

In the end I used my ghetto scripts, although the text-to-svg process was more work than it should have been. I looked at doing it with my existing XML processing tools, but it turns out that using functional programming techniques to do text layout is an underexplored area. I'm still poking at that.

other thangs, delimited by ⁋

My new year's vow to be more communicative is not going so well.

Interesting paper: Control Delimiters and Their Hierarchies by Dorai Sitaram and Matthias Felleisen. Summary: "Continuations in Scheme are cool but potentially expensive; we have a way of restricting them slightly but making them cheaper."

The library has rendered unto me an album by Miriam Makeba, which is providing much delight. (It's a collection, although I prefer her early-US stuff.)

I lit a fire on my terrace for the first time this year. Delicious global warming ensued.

My grandmother's not doing so well; I'm going home next week to visit.

I started yoga a little more than a month ago, at an Iyengar school. It's interesting, and way harder than I thought it would be.

Andy Wingohttps://wingolog.org/presentations and svghttps://wingolog.org/2007/02/19/presentations-and-svg2007-02-19T19:16:15Z2007-02-19T19:16:15Z

50 ways to leave your presentation software

I've recently had occasion to make a couple of presentations, and have grown intolerant of OpenOffice. Presentations have two immediate purposes: to convey information and to affect people's emotions. OpenOffice gets in the way of both.

OpenOffice facilitates bullet-point-style presentations, in which all slides look the same. I don't think this is so good for memory retention, because the brain quickly gets the pattern ("next slide: more of the same"), and starts to think about other things. At that point, the listener feels that she's finished listening to your presentation, having already drawn her conclusions.

To keep the listener engaged, the presenter needs to be able to affect emotions, something that a bullet-point firing squad won't do. But every time I try to do something mildly different with OpenOffice, it throws up a panoply of dialog boxes, screen-tall context menus, and obscure editing modes to block my way. I just don't understand OO.o's fundamental idea, its structure. I'm left floundering and frustrated, falling back on a bullet-point form I know isn't going to work well.

So off I went on a search for something, anything different. My goal was something that let me control the what my presentation would look like, and have a result that was different from everybody else's work. Maybe that way I could hold an audience's interest for half an hour, that and my charm. Realizing that my charm is not universally acknowledged, I redoubled my search efforts.

inkscape, yes yes

While Inkscape is an artist's tool, I've used it in the past for technical drawings, preferring it over the Dias and XFigs of the free software landscape. Inkscape is very understandable and powerful, and also produces quality output. I wanted to use it for presentations.

While I was investigating Inkscape's possibilities, Jan told me about Rusty Russell's presentation at LCA 2007, done with SVG in firefox, with javascript to move through slides via toggling layers' visibility. Pretty interesting. I hear it wasn't perfect in any sense, though, and I don't feel like re-learning javascript. A PDF of the slides would be better.

After experimenting with various options, I accidentally happened upon Inkscape's XML editor, which showed me that the svg structure is actually rather simple. It's easy to open up an SVG file in your text editor and e.g. remove a layer from it. I decided to write a tool to split a layered SVG into many files, one per layer.

My result is svg-split, a script written in Guile, using guile-lib (Debian/Ubuntu package: guile-library). The solution was complicated by the presence of XML namespaces; specific comments are in the source.

I was left with the smaller problem of turning a set of SVG files into one PDF. rsvg-convert will do this, but exhibits some rendering bugs regarding text spacing. Because of some problems in rsvg, you have to make inkscape strip XML namespacing from the individual pages via inkscape -l. My script to turn a layered SVG to a PDF is here.

I also tried Inkscape's PostScript output, combined with psmerge from psutils, but psmerge shrunk the bounding box for each page to the drawing size instead of the page size, which was worse than the rsvg rendering bugs.

For doing the actual presentation, it turns out that Inkscape has a slideshow mode, which allows me to avoid the rendering bugs. You just pass all of the svg's to inkscape -s and it runs through them all without any interface. My script to do a presentation with a layered SVG is here. I got the window to go fullscreen via devilspie, writing the following into ~/.devilspie/inkscape-slideshow.ds:

(if (is (window_name) "Inkscape slideshow")
    (fullscreen))

Inkscape's slideshow mode is true ghetto. It responds to all key presses, even alt when you are trying to alt-tab away from it. However it does render correctly.

Christian tells me that the W3C SVG print specification might solve the svg-to-multipage-pdf problem, but that the free software toolchain does not yet support it.

conclusions and further work

My current presentation-making process involves lots of work with pen and paper, ending up with an outline of what all of my slides should do. At that point I type everything into emacs, and start the work of making all of the slides in Inkscape, one layer per slide. I put some alignment lines and hints visible on the bottom layer so that I keep some consistency within the presentation. At the end I run my script on the SVG, which gives me a PDF for posterity; I run inkscape -s when actually giving the presentation.

One problem with this process is that Inkscape is not a publishing program. It doesn't understand paragraphs, for example. This is less of a problem than one might think -- presentations shouldn't have too many words -- but it is a minor irritation.

The slides-making process is still too painful. I think that the initial import procedure (from emacs to svg) should be easier; given that the basic SVG I'm generating is simple, I can make the first pass automatically generated from some source. I suspect a custom XML/SXML language would be most appropriate for the kinds of solutions I am interested in. It would be nice if someone with Emacs-fu could hack something to translate outline-mode's format to an s-expression structure.

That idea generalizes as "transforming structured text to SVG", which is valid for many forms of structured text. One interesting possibility would be Tomboy, the GNOME note-taking application. It stores its notes as XML, which can be translated to SVG via some kind of formatting transformer (am currently working up some ideas). You could make your whole presentation in Tomboy, and have a script walk the links in your notes, creating a presentation structure.

I am satisfied enough with the layered-svg solution that I'll continue to poke at it in the future when making presentations. Those of you that want to laugh at me as my strategy crashes and burns should drop by the GNOME room at FOSDEM on Saturday, where you can catch it in person. Comments welcome, and see you at FOSDEM!