Monthly Archive: April 2008

Further impressions of KeyJNote

Well, some of my euphoria has worn off now that I’ve given KeyJNote a whirl. It works, but the fancier of the page transitions are a bit jumpy and flickery on my MacBook. And, yeah, it might not be the best equipped for graphics-intensive tasks, but, on the other hand, it does ok with Keynote effects.

In a last-ditch effort to see if I could salvage some Keynote-like effects with Beamer presentations, I thought I’d take a look at the scripting capabilities of Skim, since Skim can use these Core Animation effects.

As mentioned before, Skim only allows you to set a single transition for use through the whole presentation. But it seems to me that after an hour and a half, the rotating cube is going to get old.

Unfortunately, the transition chosen is not one of Skim’s preferences, and it doesn’t stick between openings of the application (nor does it stick to a pdf document). What I had in mind was seeing if I could sneak around behind Skim’s back and surreptitiously change the preference while in the midst of a presentation. I’m not quite sure how I’d have triggered it, but in any event, that isn’t possible.

The best I came up with is an Applescript that uses GUI scripting to change the transition effect. This could in principle be mapped to (a series of) system-wide shortcuts, so that in the midst of the presentation, you can change the transition to something else (in particular). This is not at all elegant, though, because it is just mimicking what happens if you press Ctrl-Cmd-T during the presentation and pick a new transition style. It just goes faster. But you still see the sheet come down and the selection be chosen, which is not cool at all. Still, for the record.

tell application "System Events"
	tell process "Skim"
		set frontmost to true
		keystroke "t" using {command down, control down}
		repeat until sheet 1 of window 1 exists
		end repeat
		tell sheet 1 of window 1
			tell pop up button 1
				tell menu 1
					click menu item "Page Curl"
				end tell
			end tell
			delay 0.5
			click button "OK"
		end tell
	end tell
end tell

LaTeXiT indeed rocks

I tried something I suggested in my previous entry, and tried to draw a tree with LaTeXiT for the purpose of using the tree in Keynote. And it worked like a charm.

I just put this in the preamble:


And then used this to draw a tree:


Et, voilĂ . Hitting the “LaTeX it!” button revealed a tree, which I could then happily drag into Keynote. And resize! And see the background through. This is so much better than dragging just a picture of a tree into Keynote.

Here’s something I don’t understand, though. The above tree only works on a very light background (because it’s black). If I change the color commands to “white”, however, then the bounding box isn’t correct, and the bottom of the movement arc is cut off. It is possible to adjust the bounding box with jTree, so this should be fixable. But why would color matter?

Incidentally, for this to work, one probably needs to set the Composition->Behavior setting to latex+dvipdf (rather than pdflatex).

So, if I give up on beamer as a lecture presentation tool, this is a good way to still set my trees in LaTeX, even if the rest of the lecture is PowerPoint or Keynote.

In fact, I can even drag it to the Finder to create an image file, convert it a png with Preview, then drag it into ecto for a blog post. Like this:


Or the PDF it was made from: latex-image-1.pdf


Now that I’m starting to think seriously about getting classes ready for the Fall, I had to consider whether I would incorporate my new LaTeX machinery into my teaching materials as well. This was originally the plan, but I have a lot of existing PowerPoint presentations, and I was a bit torn between moving to Keynote or moving to something LaTeX-based.

Generally, LaTeX presentations are prepared with something like beamer, which results in a PDF file. Then, you can page through the PDF file with any PDF reader.

However, it does lose some of the magic that you can get from Keynote, and even PowerPoint. Transitions are perhaps silly and distracting, but I haven’t completely sworn off of them.

There are some things you can do in Keynote that are simply impossible to do in anything PDF based, like path-based animation of elements. However, it is possible to embed a movie into a beamer-produced document, so at least some of that can be emulated. And I probably don’t want every minute of every lecture to be animated. (There’s an interesting blog post providing a way to style a beamer presentation like a Keynote presentation, and it also contains some information about embedding movies). See also the beamer documentation itself.

Supposing that I worked with beamer, it does have the ability to put transition instructions into PDF files, which Acrobat Reader should in principle be able to read and follow. Preview doesn’t seem to do much with them, and in fact, Preview doesn’t seem to work all that well for presentations anyway. Skim actually works pretty well, and you can set it up to use any of a set of Core Animation transitions (so pretty much whatever you can get from Keynote), but the downside is that it only allows you to set a single transition for the entire presentation. Acrobat actually has pretty crappy transitions from my initial tests of beamer output, I would rather just page through things with no transitions in Preview.

I was about to give up on this entirely and contemplate living without transitions, when I came across KeyJNote. This seems like exactly what I want. It is a PDF viewer designed for presenting, and allows specification of transitions on a slide-by-slide basis) as well as some other kind of neat things. It uses OpenGL (not Core Animation — it’s not a Mac program, but rather a Python program), but it looks like it will do nicely. It’s a bit slow to start up, but after that everything looks pretty smooth.

Update: KeyJNote has been discontinued under that name for legal reasons, see KeyJNote will be renamed. I’ll post again when I discover what its new home will be.

Installing it is kind of an adventure. I may not have picked the simplest route. However, let me put some of my notes here. So, you get KeyJNote first. It required Python. Leopard has Python. Great.

But it also requires a bunch of other things that are not all available by default. I used a combination of MacPorts and Fink and Python’s own EasyInstall installer to install. It needs PyOpenGL. I thought that Fink had this, it does have something called opengl-py25. I installed that, but after much compilation, it didn’t help. Perhaps it wasn’t in the search path, I don’t know. What did succeed for me was: easy_install PyOpenGL. It recommends xpdf. Sure, ok. I installed that with Fink (fink install xpdf), which triggered a pretty lengthy compilation process. It requires PyGame, which I installed with easy_install pygame, because when I tried it with Fink, many packages were installed, but it ultimately failed to install pyobj-py25 for no reason I can understand. No matter, EasyInstall was much quicker. It requires PIL, which, as far as I could tell, could not be installed either with EasyInstall or with Fink. So, I downloaded the tarball from their site, unpacked it, entered the directory, and invoked sudo python install. Great. Now KeyJNote will run, but it can’t use embedded hyperlinks (which beamer provides for navigation) without pdftk. Fine, ok, I’ll install that. MacPorts has it, so a quick sudo port install pdftk and I was on my way. For a very long time. Because it insisted on installing the entire gcc42 GNU compiler collection in order to compile it. Really, this took half a day to run. And it seems like kind of a waste, couldn’t my existing XCode install have handled this??

At the end of the day, though, I do have KeyJNote running, and I have high hopes for it.

To invoke it, just file.pdf in the Terminal (though there are a lot of command line options that can be specified, I haven’t really looked into them yet). It will think and think and think some more (but during this process it is rendering things so that it will be ready to zip through them during the presentation itself), and then the presentation starts.

There is no freaking way I’m installing KDE just to use this, but there is a GUI for working with KeyJNote called (appropriately) KeyJNoteGUI. If you’re already Linuxized and have KDE installed, it might be useful.

Something I think I will use is gettransitions, which can extract information from LaTeX comments to build the .info files that KeyJNote uses to determine which transitions to use between slides.

I’ll post again once I’ve mastered this, but I was happy enough to see that this exists (and had to jump through enough hoops to get it installed) that it seemed worth posting about the beginning steps.

Also, since I will be doing presentations with my MacBook anyway, I intend to give iRed Lite a try, which claims to be able to use the remote control they come with to do more general things (like work with a presentation, for example, though it can do a lot more).

Maybe one last thing to mention is that it might still be worth considering just using Keynote as it was meant to be used, but inserting trees or other LaTeX entities with something like LaTeXiT (though I have not tried to use this for trees).

Doing experiments

Well, that’s sad. I just typed up an entry here about software that can be used to do experiments, but somehow the contents of the post got eaten. I’ll type it again, though these kinds of things never turn out as well on the second attempt.

What I mainly wanted to point out is that PsyScope lives on, now ported to Mac OS X and with development continuing, under the name PsyScope X. It is Mac-only (like Psyscope was)

It is also worth mentioning that, for simpler experiments, WebExp might be a good choice. It is good for questionnaire-type experiments, and it is written in Java, meaning that it should work relatively well on Mac, Windows, and pretty much anything else. I didn’t succeed in my first attempt at getting it running on my Linux server, but my guess is that the problem can be solved.

Lastly, for doing sentence processing experiments, a good option for anything Unix-like (Linux, Mac OS X, and possibly cygwin on Windows) is Linger. It hasn’t been recently updated, but perhaps it already just works.

Word for Linguists

I just came across quite a nice set of pages put up by Susanna Cumming at UCSB that goes over a bunch of useful things to know when using Microsoft Word for Linguistics. It covers styles, templates, automatic example numbering (the right way, too), special characters, and some other things. Worth a look. She doesn’t cover trees, though.

I got there from the pages of an academic writing course that Uli Sauerland taught. From there were linked a couple of other nifty things, including the Leipzig glossing rules, Travis Bradley’s advice on using Word for Linguistics (but don’t do automatic examples that way, do it the way Susanna Cumming, and I, elsewhere, have suggested), and Ryo Otoguro’s advice on writing a thesis in Word (which leads off by saying “don’t, use LaTeX” but it’s useful and has an interesting method for drawing trees. Plus, if you can’t use LaTeX for some reason, like if you’re submitting somewhere that doesn’t allow it, or you are collaborating with somebody, it’s good to have this information).

Speaking of drawing trees, I would not suggest using the method outlined in either Travis Bradley’s or Ryo Otoguro’s tips (both recommend the line drawing tools in Word). This works, but it is frustrating and slow, and often doesn’t look good. Spend $20 on the Arboreal font from Cascadilla Press. When you get the hang of it, it makes typesetting trees in Word quite fast. I have some settings predefined in an Arboreal example document that I use (basically, it’s just center-justified tabs spaced just right for 3-width branches, so I can rapidly tab into place and hit the 3-width key. Combined with a keyboard shortcut to switch into Arboreal and one to switch back to Times, a simple binary-branching tree can be produced very quickly.) You still have to draw your movement arrows with Word’s drawing tools (or live with the square ones that Arboreal provides), though.