Parallel hypertext: Storyspace metamorphosed 1

So far, my explorations of hypertext and Storyspace have been confined to non-fiction. Having recently started a series looking at the best paintings of stories from Ovid’s Metamorphoses, I thought this might be a good opportunity to set some of the finest narrative from the classics into hypertext.

Given the number of myths in Metamorphoses and the length of the original Latin text, it’s going to take me a couple of years at least to complete my series of articles. So why not run a Storyspace project in parallel?

This first article looks at a fundamental issue: the textual content should be provided in both the original Latin and English translation, in parallel hypertext. Before I can even start building my document, I need to work out a good way of implementing that using Storyspace.

Ovid wrote in verse, and when that is rendered into accessible English each line of Latin does not map directly to a line of English. Because I am more interested in the stories which he tells, I’d rather break his text up into writing spaces of several lines, at least. Book 1 is in any case slightly more than 775 lines of Latin, so trying to produce a line-by-line comparison seems foolhardy.

One logical design approach is to divide the Latin into sections of 5-50 lines according to their content and narrative structure, and set those alongside their English translation. The Latin will then be divided into a series of writing spaces in a container, the English likewise in another container, then the reader can browse a web of writing spaces which draw their text from those into composites.



I also need to give the reader some flexibility: a few might wish to read the text in Latin alone, most will probably just want the English, and many will want both together. Giving the reader that choice means that I can’t use simple text inclusion, but I need to make that conditional.

If the composite writing spaces exposed to the reader are formed like

then there’s no choice.

Instead, I need to use
^if($ShowLatin("/me"))^ ^include("/lat/1-4")^ ^endif^
^if($ShowEnglish("/me"))^ ^include("/eng/1-4")^ ^endif^

which uses attributes stored in the me writing space to determine whether to show the Latin and English versions.



Provided that the reader is using Storyspace and understands how to alter key attributes, I could leave it to them to turn $ShowLatin and $ShowEnglish on or off as they wish. But if they are using Storyspace Reader, or don’t want to mess with attribute settings, that is no help. So I also need to provide a couple of ‘buttons’ which they can use to control which versions are shown.

Initially, I create a couple of Prototypes for the two different languages, which differ only in the colours of their writing space tiles: English is blue with dark blue text, Latin green with dark red text. I then create my first writing spaces to contain the respective texts, and drop those into containers named eng and lat.


Because I need to refer to those writing spaces and their containers a lot, I am keeping their names short and systematic: within each container, the writing spaces containing the text are named according to the line numbers of the Latin verse, such as 5-9. This will make it much easier to copy and paste the code to conditionally include text from them.


The me writing space then needs two key user attributes, $ShowLatin and $ShowEnglish, which will each be true when text in that language is to be shown.

The writing spaces to be used as control buttons need to have their own local versions of those attributes, code to run OnVisit, and code to run as a Rule.

The OnVisit code for the Show English writing space then reads
$ShowEnglish = !$ShowEnglish; $ShowEnglish("/me") = $ShowEnglish


When the reader selects that writing space, it toggles the value of $ShowEnglish in that writing space, and in the me writing space. That enables it to function as a toggle switch.


The Rule for the Show English writing space then reads
if($ShowEnglish) {$Color="bright blue"; $Name="Hide English"} else {$Color="warm gray dark"; $Name="Show English"}
which sets the tile colour to blue and its title to Hide English when $ShowEnglish is true, or to grey with the title Show English when it is false.

Thus, when $ShowEnglish is true, the English version of Metamorphoses will be displayed in text writing spaces, the English toggle will be shown as Hide English (the action from clicking the button again), and it will be coloured blue.



The Show Latin switch is set up similarly, but using the $ShowLatin attributes.

One final issue is the matter of giving line numbers for the Latin original, which the reader will need to cite the text. I have placed these inline in the Latin text, shrinking the numbers in size to make them less obtrusive. There are other options, of course; I thought about storing them in user attributes of the latin prototype, but that adds unnecessary complexity.


I hope that you will find this an elegant and practical solution. Here is my hypertext document, readable using Storyspace, Storyspace Reader, or Tinderbox: ovidmetamorphosesbook1

The Latin and English texts used here are taken from Perseus at Tufts, a superb resource for anyone wanting to access classical texts.