Lecture Notes with LENO

Kurt Nørmark ©     normark@cs.aau.dk
Department of Computer Science, Aalborg University


In this chapter of the LAML tutorial you will learn how to make a teaching material with LENO. LENO is based on an XML-in-LAML authoring format, derived from an XML DTD. LENO produces HTML-based slides, annotated slides, and an aggregated view of the material. The authoring of these view are based on single-sourcing principles. With some extra efforts - and a secondary source - it is also possible to produce more traditional teaching material, which can be printed via the PDF format. LENO supports a sound track, in which the author can make a self-paced slide show augmented with the author's spoken comments. As a guiding principle, no piece of source material exists in more than one copy. Whenever the same piece of material is to be used more than once in the material, it is transferred from a single source to possibly multiple targets. This holds for trails of existing material, illustration of computer source programs, the thematic view in relation to the primary source, and for more direct reuse of LENO note page constituents.


1     Introduction

In this part of the tutorial we will explore LENO - the largest and most elaborate LAML style we have created. We will stick to the XML-in-LAML version of the system. Thus, we will not discuss the original version of LENO (which is still operational for sake of supporting old materials, but is obsolete for new development).

All the LENO examples discussed in this part of the tutorial are available in the directory examples/tutorial/leno/ of the LAML distribution.


2     Single lecture materials

A single lecture material is typically a set of slides - with or without annotations. It is relatively easy to make such a material in LENO. In this section we will explain how to do it.

2.1     Making single lecture materials
2.2     Defining note pages
2.3     Graphic images
2.4     Source programs
2.5     Other sources of information

2.1     Making single lecture materials

I will assume that you use Emacs for authoring of LAML documents. The Emacs Leno and LAML modes are very helpful when you are writing a LENO document. It is probably worth the investment to learn the basic Emacs stuff if you are going to use LENO in the future.

The first thing to do is to make a new directory for your new LENO material. From Emacs, use the menu item Tools > Laml > Make New LENO Lecture note ... or just issue the underlying command:

  M-x make-lecture-notes

You will be asked about the directory, in which to organize LENO source stuff - the LENO source directory. You just pass the directory which you have just created. You will also be asked about the name of the Leno source file (without extension). The file can, for instance, have the same name as the directory in which it resides. Concretely, in this tutorial example, we want to create a Leno file named 'single'. Now the make-lecture-notes command creates a few files and directories for you. Before we look at them, process the LENO source buffer single.leno with LAML. Simply use C-c C-o from Emacs, which will run the command laml-process-current-buffer. Underneath, the command will interpret (execute) the file single.leno in Scheme.

Let us now take a look at LENO source directory after we have created a new LENO material, as described above:

  drwxrwxr-x    3 normark  normark       512 Nov 18 11:17 graphics
  drwxrwxr-x    9 normark  normark      1024 Nov 18 11:17 html
  drwxrwxr-x    2 normark  normark       512 Nov 18 11:17 images
  drwxrwxr-x    2 normark  normark       512 Nov 18 11:17 includes
  drwxrwxr-x    2 normark  normark       512 Nov 18 11:17 internal
  -rw-rw-r--    1 normark  normark       113 Nov 18 11:17 post-notes.scm
  -rw-rw-r--    1 normark  normark      1834 Nov 18 11:17 single.html
  -rw-rw-r--    1 normark  normark       973 Nov 18 11:17 single.leno

We see - of course - the Leno source file, single.leno. The file single.html is generated by the LAML processing - it is a convenient starting point for the author when he or she wants to browse the HTML files, which are generated by LENO. Notice, however, that when the basic informations (such as author and title) are not defined, the resulting HTML pages look very strange. When we come to section 2.2 the generated HTML pages will make more sense.

The leno-front-matters clause defines a bunch of parameters of the LENO material. Please take a look the reference manual documentation for details. (Notice that you can easily navigate to the reference manual, from this frame just by clicking the slightly green names, or from the rightmost frame. Try it out!)

The graphics directory is supposed to contain graphic images, as used by the image form of LENO. You will learn to make graphic images in section 2.3

The images directory is supposed to contain supplementary LENO icons. Novice LENO users will not need to care about such images.

The directory includes is empty. I use it for source files, which are used in the LENO material, such a program source files handled by the LENO source-program clause. Notice, however, that such source files can be located in whatever directory you wish. You will see an example of source program insertions in section 2.4 .

The html directory is the HTML target directory, in which LENO writes all the HTML files, gif files, etc. As an important property, the html directory is (almost) self contained. All the necessary graphics and image files are copied from the LENO source directory and the LENO software directories to the html directory. You can copy the html directory to another directory - to a CD for instance; All the necessary pieces will be there. As an exception, sound files are not contained in the html directory. More about this in section 5. You a not supposed to edit files in the LENO target directory. (As of now, there is one exception, applets, if you use them in your material).

The internal directory contains a number of internal files, which LENO generates and uses during processing. Normally, you should not care about this files. Just never delete them.

The file post-notes.scm is the so-called Scheme suffix file. It is loaded when the LENO software has been loaded. In this file you are invited to organize Scheme functions, which help you in your authoring process. Initially, post-notes.scm is empty.

With this understanding we are ready to begin the LENO authoring process.

2.2     Defining note pages

Let us now define a couple of note pages, each with a number of LENO clauses. We will start using the simple LENO stuff first. We chose to leave single.leno intact. It means that we now start over with a file called single-with-content.leno. Keep an eye on the author's index of the generated HTML files while we explain the authoring process. The root document - from a reader's perspective - is also relevant, of course.

We first fill in the front-title, front-author, front-affiliation, and front-abstract details of the leno-front-matters clause in single-with-content.leno.

LENO note pages are inserted between (begin-notes) and (end-notes). You are encouraged to use the Emacs LENO menu in the top bar of the Emacs window - or the Emacs LENO commands: M-x leno-insert-.... As it appears in the menu, there are convenient keyboard shortcuts for several of the frequently used LENO commands.

We make a section page first-section using the command M-x leno-insert-notesection. We also make a normal LENO page first-page with M-x leno-insert-notepage or the similar menu item Leno > Insert note page.

In the note page first-page we insert an items clause and a point clause.

As an important thing to notice, LENO asks us to reprocess the leno source file the first time we process it:


The reason is that LENO is a single pass processor, which collects information about the page sequence while going along. This information is used for forward linking purposes in the next run of LENO. The information is stored in the aux file of the internal directory. You will see the message every time you change the sequencing of the note pages. Users of LaTeX will recognized this aspect of the processing.

We insert some additional simple note page subclauses in first-page. Besides point and items this is concept-list and opposing. Be sure to look at the following generated HTML pages:

  1. The slide view of the first page
  2. The annotated slide view of the first page
  3. The aggregated view

[If you prefer, you can use your browsers trick (such as holding down the shift key) to redirect the referred LENO pages to a new window]. Also, familiarize yourself with the mutual navigation in between these pages.

It is worth understanding the kinds of functions involved in the expressions of a LENO note page. Let us again concentrate on first-page. More specifically, let us take a look at the expression

    "We have now started the" (em "real authoring process") _ "."
    "We did this by" (b "M-x") (kbd "leno-insert-point,") 
    "or from the LENO Emacs menu: '" (kbd "Insert Point") "'"

The outer functions such as point, main-text and annotation are all LENO related XML-in-LAML mirrors mirror functions. Thus, they fulfill the XML-in-LAML rules, as described in the XML-in-LAML section of this tutorial.

The functions used at the inner level, such as em and kbd, are HTML mirror functions. In the ideal case, they should be XML-in-LAML XHTML functions. But they are not! They are more primitive functions. They all generate text, not XML-in-LAML abstract syntax trees, as described in the the XML-in-LAML tutorial. The HTML mirror functions used in LENO belong to the so-called HTML4.0 loose, non-validating mirror. Technically speaking, the LAML mirror libraries HTML4.0 loose basic, surface, and convenience are all available inside LENO XML-in-LAML expressions. As a pleasant observation, we notice that the HTML4.0 loose mirror use almost the same mirror conventions as used in XML-in-LAML.

More overall, it can be concluded that you can use all HTML4 mirror functions at the detailed authoring level, inside LENO element instances. Both the LENO and the HTML4 functions obey the standard mirror rules, as they are explained in the HTML mirror part of this tutorial. The LENO structure is validated on the fly - while processing the document. But the HTML text, emitted inside the LENO elements, is not validated.

From a practical authoring point of view we recommend that you use the embed Emacs command, from the LAML menu, when you are need to nest a substring into some Scheme function. It is bound to the keyboard shortcut C-c C-x C-e if you rely on the hygienic keybindings. The embed command takes care of all LAML technicalities in a very nice way. Please try it out yourself on some of the LENO example files in examples/tutorial/leno/.

2.3     Graphic images

It is important to be able to have pieces of graphical images in your LENO material. We will now show how it is done. You will probably feel that the handling of graphics is primitive - at least if you are used to integrated environments in which you can edit both text and graphics. If you have a LaTeX background, you know the rules of the game already...

Take a look at second-page, which generates a HTML page like this. The first image clause refers to the file first-image.gif. You are responsible of creating it, and you can use your favorite drawing tool to do it.

To make things a little bit more complicated, you should actually make two versions of the graphics file. One in 'full size' in the graphics sub directory the of the LENO source directory. 'Full size' means a size appropriate to the slide view, as shown in the slide view page. The other version should be reduced (appr. half size) and placed in graphics/small. Many browsers are not capable of making good reduced images - therefore we have decided - in LENO - to provide two versions of each piece of graphics.

The second image clause in second-page makes use of a number of image attributes. Please consult the reference manual description of these. You can click on image - both here and in the right frame to get to the reference manual.

Again, take a look at the resulting HTML page, shown here as an annotated slide view.

2.4     Source programs

In our teaching materials, we often discuss pieces of programs in various programming languages. For this purpose, the powerful source-program LENO element is superb.

In the SchemeDoc part of this tutorial, we discuss LAML interface documentation. We will include a couple of program examples directly from the Scheme source programs in this part of the tutorial. You should notice that we address the source programs directly in the LAML example directory, in which they originally are located. We do not manually make any copy of the programs. This is very important for management and consistency purposes!

Take a look at third-page. The first source-program clause addresses the file scheme-doc/prog3.scm, also available in this elucidator as prog3 We select the negate function, using the source-program attributes from-mark and to-mark. The color-decorations attribute superimposes colors on the extracted piece of program. Please take a look at the generated page, for instance in slide view .

Take another look at third-page and notice the use of the function in-tutorial-dir, which is used in the src attribute of the source-program clauses. This function is defined in post-notes.scm - the so-called Scheme suffix file discussed in section 2.1. Please navigate to in-tutorial-dir in post-notes.scm. It is almost always important to keep down the complexity of URL addresses. It is therefore useful to make functions through which to address concrete web resources. Notice also the use of the variable laml-tutorial-dir which is used in in-tutorial-dir . If you need to introduce ad hoc markup, as described in section 5 of the SchemeDoc part you can put these functions in the Scheme suffix file too.

Let us include a couple of other Scheme definitions from prog3, namely fac and fib. Both of these pieces of Scheme program are include in third-page of single-with-content.leno, right after the function negate. We include the interface comment of fac. Notice the use of the repetition attribute of color-decoration. Also notice the effect of the slide-mode and book-mode attributes in source-program to control inlining/non-inlining of the source program in the different view. Again, take a look at the slide view and the aggregated view of the generated resulting HTML pages.

2.5     Other sources of information

We have now shown how to use LENO for making a single lecture teaching material with LENO. There are many other aspects which could be discussed. We will refer you to the The LENO Reference Manual however, to learn more.

Alternatively, you should consult the Meta Lecture Note material, where we for each LENO element shows how to produce it. For each LENO element there exists a single meta note page in this material. These pages makes really good use of the source-program feature to show those part of the LENO source, which produces the actual page. I am confident that you will be able to learn a lot from the Meta Lecture Notes!

3     Multi lecture materials

A real teaching material is typically structured in a number of lectures. It is slightly more difficult to manage such a material than the stuff discussed in section 2.1. In this section we will go through the most important aspect of setting up and authoring a multi lecture material.

3.1     Making a multi lecture material
3.2     Re-organizing the multi lecture material

3.1     Making a multi lecture material

It requires a bit more setup at the LAML/Scheme level to make a LENO teaching material with multiple lecture. Here we will carefully explain how it is done.

The extra setup is done in the so-called scheme prefix file. This file is loaded before the LENO software. Recall from section 2.1 that the scheme suffix file is loaded after the LENO software. Both the Scheme prefix and suffix files are specified in the leno-front-matters clause.

We proceed as follows when we make a multi lecture teaching material with LENO:

  1. First make a new source directory. You name it as you want. In this tutorial we call it ' multi-lecture '. Notice that all Leno and Scheme files related to this examples make use of a light blue background color in this elucidator.

  2. Make the first lecture in the new directory by M-x make-lecture-notes, or use the Tools > Laml > Make new LENO lecture notes menu command in Emacs. We call it multi-1.leno .

  3. In the front-matters clause of multi-1.leno add the attribute 'scheme-prefix "pre-notes.scm" .

  4. Now make the additional lecture notes. It should not be done by M-x make-lecture-notes. Rather, you can just copy multi-1.leno a number of times, in our example to multi-2.leno and multi-3.leno. We make the necessary changes in the two copies (the titles, primarily).

Now have to make the Scheme prefix file pre-notes.scm, which we referred to above. Be sure that both multi-1.leno, multi-2.leno and multi-3.leno have a scheme-prefix attribute with the value "pre-notes.scm".

The most important definition in pre-notes.scm is lecture-sections. In this variable, we list all the lectures of the multi-lecture material. The names in the list must correspond to the proper file names of the leno source files from above. [It would have been natural to give specifications of the lecture sections in XML. The list of lecture sections do not, however, belong to any of the lectures. It should be located in a separate file. As of version 24 of LAML, we do not support such a central XML setup file. We use the pre-notes.scm file and formulations in Scheme for such purposes].

The variable notes-title is the title of the multi lecture material. note-abstract is the abstract of the entire material. The variable current-lecture will normally be an integer corresponding to the number of lectures. It can, however, be smaller than that. In case current-lecture is smaller than (length lecture-sections) only current-lecture lectures are linked into the material. Thus, as an example, if current-lecture is 1, only the first lecture will actually be linked into the material. You can use this feature if the lectures are being developed during the course, and if you do not want to have links to incomplete or non-existing material.

It may be convenient to add the attribute process-all-lectures with the value "true" to (at least) one of the lectures. We add it to the front-matters part of multi-1.leno . With this attributes, all lectures are processed when multi-1.leno is processed (but never more than demanded by current-lecture ).

Do not forget to process the material with C-o in Emacs. If you use process-all-lectures, you should only process multi-1.leno. The others will be processed automatically. You should process twice to take the generated aux information into account.

You should study the HTML result of the multi lecture notes carefully. You may notice that we have added a few trivial note pages to each of the lectures.

You should notice that all the lectures in a LENO multi lecture material share the same html target directory. Thus, all the generated HTML files co-exists in the same 'flat' directory. The naming scheme of the HTML files allows files from multiple lectures to coexist.

3.2     Re-organizing the multi lecture material

There is one serious drawback of the organization of the multi lecture material from section 3.1 .

We want to make a minor refactoring, in which we extract the common leno-front-matters attributes, and put them into a file of its own. The refactored source files are all light pink in the elucidator.

This leads us to the creation of the new file shared-front-matters-stuff.scm. In this file we also define a couple of variables, multi-author and multi-affiliation such that the author name(s) and the affiliation should be defined only once. Notice that the important variable shared-front-matters-attributes is just a property list, which can be referred elegantly and in a simple way from better-multi-1.leno, better-multi-2.leno, and better-multi-3.leno.

We have refined the content of the note pages slightly, as compared with the similar note pages of the lectures from section 3.1 .

Again you can look at the HTML result of the multi lecture notes. It is quite similar to the results from section 3.1 .

4     Making a trail of LENO slides
In this section we will see how to make a trail of a set of LENO slides.
4.1     Why trails?
4.2     Leno Trails
4.3     Full trivial trails

4.1     Why trails?

We will assume that we have produced a LENO teaching material with a number of note pages (slides) in several lectures. In typical real-life situations we have hundreds of pages in between 10 and 20 lectures. Often, it is necessary to select a subset of this material and/or to change the presentation order of the material (primarily in the slide view).

In general, it is bad idea to make a copy of the source - in our case the leno source files. If you make copies, it is much harder to do future maintenance of the material, because you will have to carry out changes in two or more copies.

This is the motivation behind trails in LENO. Intuitively, a LENO trail consist of sequence of of note pages, selected from the lectures of a single material. The figure below illustrates this.

We see three lectures A, B, and C with 5, 4, and 4 pages respectively. The trail selects note page (A,1), (B,1), (B,2), (C,2), (C,3), (A,3), and (B,4). The trails forms a new kind lecture, with a selection of stuff from existing lectures. We will now see how to make this with LENO. We will use the three lectures from section 3.2 as the starting point. It turns out that the number of lectures and the number of pages of the material in section 3.2 correspond to the setup in the figure above.

4.2     Leno Trails

We are now working in the context of the three lectures from section 3.2. In order not to disturb the earlier tutorial demos, we have actually copied them to another example directory, called leno/multi-lecture-trail/ within the examples/tutorial directory of the LAML distribution. In this elucidator the trail-related pages are shown on a grey background.

We now ask LENO to generate and derive a secondary trail source file. This is done by adding the attribute trail-source with the value "new" to the leno-front-matters clause of one of the lectures, such as trail-multi-1.leno. When we process this lecture, it will generate a file trail.leno. (This is a fixed name. You are welcome to rename it, however. If the attribute value is "new" files named trail-1.leno, trail-2.leno will be generated, however. If the value is "overwrite" the file named trail.leno will be overwritten.)

The intention is that we now refine and edit this secondary source file. When it is processed, it generates the wanted trail, which we sketched graphically above. The automatically generated trail file calls for generation of a full trail of all pages in all lectures, relative to the lecture setup in the Scheme prefix file. We will, of course, select some of them - see below.

Before we go on we should remember to set the value of the trail-source attribute to "none". We can also comment it out or delete it, in which case the default value "none" applies. We only want to derive the secondary trail source once.

We now edit trail.leno, thus deriving trail-edited.leno. We load the shared front matter stuff from shared-front-matters-stuff.scm, primarily to get access to the variables multi-author and multi-affiliation. Next we fill in the front-title, front-abstractas well as the attributes trail-id, scheme-prefix, scheme-suffix, and course-home-url.

The trail-id attribute is of particular importance, because it controls the name of the trail in the HTML target directory.

Next we carry out the actual selection of the pages in the trail. This is easy, because we just have to delete the pages, which are not going to be part of the trail. It is easier to eliminate the clauses that we don't want, than inserting (from scratch) the clauses we want to be part of the trail.

Please take a close look at the resulting LENO trail. Please also make sure that you understand that the trail actually corresponds to the selection made by the red thick line in the figure above. First you should navigate from the index page to page 1 in the trail. Use the red navigation icons to navigate along the trail - the red line through the note pages in the image above.

Underlying - at the HTML - each trail page is represented as an HTML frameset, in which the red navigation icons are located in a narrow, border-less frame to the left. The right, large frame just addresses the original note page in slide view. In that way, no actual copying of lecture note substance is involved. Whenever we update one of pages, which is part of the trail, the trail contents is updated too.

4.3     Full trivial trails

The organization of navigational icons in a frame, which is separate from the main content frame - all inside a frameset - is quite flexible. You can navigate freely in the rightmost frame, and very easily come back on track. The reason is that you can press the red square icon to reestablish the original content of the main frame (to the right).

Of that reason LENO allows you in a very easy way to embed the slide view of all note pages in a trail. We will now show how it can be done. It is almost trivial!

You just add the attribute trail-of-lecture to the leno-front-matters clause, and give it the value true. Thats all. Then regenerate the material by LAML processing it. The author's index reflects the added trail pages.

The original yellow navigational icons in the top bar of the page are redundant. We therefore eliminate these by setting the value of the slide-header attributes to minimal or none (we use minimal in the example). Normally, the value of this attribute is normal .

The readers index of the resulting trail is also available.

5     Making sound tracks of LENO materials

We have made several LENO-based materials which includes the lecturer's sound track. We explains how to do this in this section.

5.1     Introduction to sound tracks
5.2     A LENO material with audio

5.1     Introduction to sound tracks

Earlier in this tutorial - in section 2.3 - we saw how to deal with graphic elements in LENO. We create pieces graphical images with some external drawing tool, and organize the resulting gif or jpg files appropriately relative to the leno source files. The same idea applies to audio files. Below we will give an introductory overview. In section 5.2 we go through a concrete example.

In the starting point, we will assume that we have developed a LENO material, such as the material from section 2. We will now augment it with audio, and we will make an automatically progressing slide show, which plays the audio files while it goes along.

The author records a number of sound files. These files are renamed to conform to the LENO naming conventions for audio files. There exists a tool which makes these renamings. As another concern, the LENO author must care about the actual sequencing and timing of the audio files relative to the LENO material. The details of all this are addressed and discussed in section 5.2 .

It is important to understand the overall structuring of an LENO audio lecture relative to the structure of note pages and note page constituents. The illustration below helps is supposed to give an overview of this:

To the left we see three note pages in a single lecture (big yellow boxes). The middle of these contain two source programs (small orange boxes), which are shown externally (via program link from the generated slide view pages). As indicated to the left, we associate sound files (green circles) to note page 1 and 3 in a straightforward way. We also associate sound files to both the external source programs of note page number 2. In addition, we associate three sound files to note page 2 itself. These sound files of note page 2 serve the following purposes:

To the right we show the resulting audio note pages. Page two has been replicated three times to accommodate the need of three different audio associations. All together, we end up with seven LENO audio note pages, each with an associated sound file. The green arrow show, intuitively, the associations of the sounds. LENO is able to play the audio note pages automatically in the sense that one page ends (and the next begins) when the sound file has finished playing.

You should take a look at a real example of LENO-based material with a sound track. The best example is Functional Programming in Scheme - a web-oriented approach. Click on the load speaker icons to initiate the automatically progressing audio note pages

5.2     A LENO material with audio

We create three note pages, single-audio.leno, the middle of which has two source program clauses. This is similar to the note page structure of the illustration in section 5.1. We work on the files in the directory leno/single-lecture-audio within examples/tutorial of the LAML distribution. As usual, you can access the files in examples/tutorial/leno/. You can also access the generated HTML files of single-audio.leno

We now set the audio relevant attributes of the leno-front-matters clause in single-audio.leno :

  'show-and-speak "true" 
  'show-and-speak-author-mode "true"
  'default-showing-time "2"    
  'additional-showing-time "2" 
  'sound-source "wave-file" 
  'speak-url-prefix "../sound/"
  'speak-file-prefix "sound/"

The first one enables 'show and speak' facilities. The second enables some help for the LENO author: In annotated slide view mode you will be told which sound files to record for each note page (see also below). The speak-file-prefix tells where the sound files are located relative to the LENO source files. A closely coupled attribute, speak-url-prefix, tells the browser where to locate the sound files relative to the HTML target directory. (Recall that the html target directory - in this example - is a sub-directory of the note source directory. Therefore we go out one level before to enter the sound directory). The additional-showing-time attribute adds a constant amount of seconds to the showing time - to compensate for download time of large sound files. For more details about these attributes, see the leno-front-matters reference manual information.

Equally, important, we add a show-and-speak clause to each note page. The show-and-speak clause of the second note page is the most interesting one:

   (slide-part 'number "1" 'seconds "1" )
   (program-part 'number "1" 'seconds "1")
   (slide-part 'number "2" 'seconds "1" )
   (program-part 'number "2" 'seconds "1")
   (slide-part 'number "3" 'seconds "1" )

We ask for three slide parts with the program parts 1 and 2 in between. We also state that each sound file plays one second. This may be changed later on, when we know the playing time of each sound file.

It is now time to do the actual recording of the audio files. You can use your favorite audio recording tool. In the example, the sounds are very brief, just mentioning the numbers from 'one' to 'seven'. Use the audio author help information just below the lecture title in 'annotated slide view'. It gives you the names of the files to use for the recording. In the example, we should make the sound files '1.wav', '2.wav', ... '7.wav'. As it appears, 'sound source file names: 2,3,4,5,6' belongs to the second page. Thus, sound 3 and 5 should comment on the source programs. We will assume that we use the Windows wav file format.

We organize these files in the directory sound/sources of the LENO source directory. A LENO utility tool will help us to move and rename the files from sound/sources to the directory sound, which is the final destination of the sound files.

You find the LENO audio utility tool in 'styles/xml-in-laml/lecture-notes/util/new-sound-copy.laml' of the LAML distribution. Copy it to the directory with the source files, and modify new-sound-copy.laml according to the actual context. We give the name of the lecture, lecture-id, the note source directory note-source-directory, and the kind of sound files we use in term of its file extension sound-extension.

We now have the sound/sources directory with the following contents:

  used 151 available 4502789
  drwxrwxr-x    2 normark  normark       512 Nov 26 09:08 .
  drwxrwxr-x    3 normark  normark       512 Nov 26 09:09 ..
  -rw-rw-r--    1 normark  normark     21466 Nov 25 22:38 1.wav
  -rw-rw-r--    1 normark  normark     21446 Nov 25 22:39 2.wav
  -rw-rw-r--    1 normark  normark     21020 Nov 25 22:39 3.wav
  -rw-rw-r--    1 normark  normark     29374 Nov 25 22:40 4.wav
  -rw-rw-r--    1 normark  normark     22400 Nov 25 22:41 5.wav
  -rw-rw-r--    1 normark  normark     13612 Nov 25 22:42 6.wav
  -rw-rw-r--    1 normark  normark     15170 Nov 25 22:43 7.wav
  -rw-rw-r--    1 normark  normark      2701 Nov 25 15:15 new-sound-copy.laml

We now run the new-sound-copy LAML script, with the following feedback:

  LAML Emacs Processing
  Welcome to MzScheme version 101, Copyright (c) 1995-99 PLT (Matthew Flatt)
  Moving and renaming files to parent directory
  Process LAML finished

As a result, the files are moved into the parent directory, and more importantly, the audio files are renamed in such a way that LENO recognizes them. When we list the sound directory of the LENO source directory we get the following contents:

  used 146 available 4502792
  drwxrwxr-x    3 normark  normark       512 Nov 26 09:09 .
  drwxrwxr-x    8 normark  normark       512 Nov 25 15:19 ..
  -rw-rw-r--    1 normark  normark     21466 Nov 26 09:09 single-audio-first-slide-part-1.wav
  -rw-rw-r--    1 normark  normark     21020 Nov 26 09:09 single-audio-second-program-part-1.wav
  -rw-rw-r--    1 normark  normark     22400 Nov 26 09:09 single-audio-second-program-part-2.wav
  -rw-rw-r--    1 normark  normark     21446 Nov 26 09:09 single-audio-second-slide-part-1.wav
  -rw-rw-r--    1 normark  normark     29374 Nov 26 09:09 single-audio-second-slide-part-2.wav
  -rw-rw-r--    1 normark  normark     13612 Nov 26 09:09 single-audio-second-slide-part-3.wav
  -rw-rw-r--    1 normark  normark     15170 Nov 26 09:09 single-audio-third-slide-part-1.wav
  drwxrwxr-x    2 normark  normark       512 Nov 26 09:09 sources

Now reprocess the LENO source file single-audio.leno and you are done. You should probably turn the show-and-speak-author-mode off now. (We have not done so, however). Try play the sound track of the lecture. Activate the loud speaker icons in the generated HTML files

In case you - at a later point in time - want to add some sound, turn show-and-speak-author-mode on again, and find out the number of the new sound file. Record the sound, and save it in the sound/sources directory. Then rerun the script new-sound-copy - it will bring the new sound into position in the parent directory.

6     Making a printable, thematic presentation

The thematic view of a LENO material is more difficult to deal with than the slide view, the annotated slide view, and the aggregated view. The reason is that the thematic view contains more information than the others. The extra information is organized in a 'secondary source file', along the lines of the trail source discussed in section 4. In this section we will explain how to make a thematic view of a material.

6.1     The idea of themes
6.2     A thematic LENO presentation.
6.3     Additional details about thematic views

6.1     The idea of themes

As of now we have generated slide material, and annotated slides material in various compositions. We now want to generate more traditional book-like material. We do this by making a new, derived source which refers to all note page constituents by means of a (leno-element ...) clause. This clause addresses a particular element of a particular type, on a particular page, in a particular lecture.

The main idea is to put ordinary text, the theme-text clauses, in between the elements from the note pages, as addressed by leno-element clauses. This mix of note page elements and 'in between text' is structured in chapters. In the starting point, a chapter begins each time a note section page is met. That is, each time a note-page with a section-title is encountered.

The author can re-order the leno-element clauses, delete some, and add some. The author can also join themes, or create new themes. In that way the thematic view of the material may drift away from the original structures.

The final edition can be printed quite well. We do that by a slight brush up in MS Word (handling page breaks and similar matters). From MS Word we generate PDF files. LENO is able to organize these PDF files for each lecture, by setting the leno-front-matters attribute make-print-page to true. It takes a certain amount of manual work to create these PDF files.

Taken as a whole, it is quite demanding to make a good thematic presentation of a LENO material.

Before we proceed, let us mention that the best existing example of a thematic presentation of teaching material made with LENO is Functional Programming in Scheme - a web-oriented approach. There is also a Danish material on C programming. You can access the printable PDF material, which is directly derived from the material referred above, via the printer icon on top of the page.

6.2     A thematic LENO presentation.

In this section we will adapt the multi lecture material from section 3.2. As always, we make a fresh copy, and afterwards a few changes. It turns out to be important to have good sectional divisions in the original note pages, obtained through pages with a section-title clause. We add a few of these. It is also necessary to add an id attribute to each non-title subelement of the note page clauses. The relevant files for this part of the tutorial can be found in leno/multi-lecture-themes/ of the examples/tutorial directory in in the LAML distribution.

We change the setup, as presented in themes-front-matters-stuff.scm. More specifically, we add the following attributes:

The theme-view attribute enables the thematic view. theme-source provides for automatic derivation of a secondary theme source file (see below). In that respect, the theme-source attribute is quite similar to trail-source attribute which we discussed in section 4.2. theme-auto-process allows to automatically process the secondary theme-source, once it makes sense.

With these attributes, we process themes-multi-1.leno, which because of the process-all-lectures attribute will process the other two lectures themes-multi-3.leno and themes-multi-3.leno as well. This processing causes the creation of the secondary theme source files: themes-multi-1_themes-1.leno, themes-multi-2_themes-1.leno, and themes-multi-3_themes-1.leno. (We have renamed these slightly to make them co-exist with latter versions). The next step is to fill in setup details and content details in these secondary themes source files.

We first handle the setup, as reflected by themes-front-matters-stuff.scm. We refactor the front matters attribute, such that the attributes which make sense in both the primary documents and the secondary documents are only represented once, in common-shared-front-matters-attributes. The theme relevant front matters attributes are named shared-themes-front-matters-attributes. The original front-matters attributes are still named shared-front-matters-attributes. Notice the way we append common-shared-front-matters-attributes to shared-themes-front-matters-attributes and shared-front-matters-attributes.

We next edit the derived theme source files slightly. We end up with the edited versions themes-multi-1_themes.leno, themes-multi-2_themes.leno, and themes-multi-3_themes.leno. Compared with the naked theme files referred above, we have loaded the shared-front-matter-stuff, and we have put shared-themes-front-matters-attributes in the leno-themes-front-matters clauses of each of the three theme source files.

The crucial additions are the theme-text clauses, which add new stuff to the thematic views, compared with slide view, annotated slide view, and the aggregated view. By adding theme text at appropriate places we can end up with a quite traditional text, in between which we include note page elements, as referred by the automatically generated leno-element clauses.

You should take a look at the demo tutorial trail, as generated by processing themes-multi-1_themes.leno. Notice the yellow 'T and 'L' icons, via which the reader can shift between Theme view and the ordinary Lecture views.'

6.3     Additional details about thematic views

Programs, tables, image, sections, chapters etc are numbered hierarchical in the thematic view. It is important to be able to refer to these from different places in the thematic text.

Notice the red stars - * - in the theme presentations, see for instance theme section 1. When you navigate by clicking on the red stars you will find a ref clause, which can be inserted as a reference to the relevant element. Thus,

  (ref "multi-1_themes-sec1" "multi-1" "page3" "tabular" "ta1")

is a reference to table 1.1. We insert this reference in the thematic text of the introduction to themes-multi-1_themes.leno. We also make a couple of references to sections and chapters.

We can remove the red stars by setting the attribute author-mode to false.

You will probably have noticed that it now takes some extra efforts if we add elements to a note page. In this case we need to update the theme source file manually. Use the value "delta" of the attribute theme-source of the leno-front-matters clause to get a useful delta file for updating of the theme source file.

7     Other LENO facilities
In this section we will briefly mention a number of other features of the LENO system.
7.1     Cleaning the HTML target directory
7.2     Elimination of note pages

7.1     Cleaning the HTML target directory

After some authoring, during which pages are created, and perhaps eliminated again, the HTML target directory may become quite polluted. It is useful to clean it every now and then, by setting the value of the leno-front-matters attribute clean-html-directory to true.

7.2     Elimination of note pages

Sometimes we wish to eliminate a note page from the material. We can of course delete it, or comment it out with Scheme semicolons.

Sometimes it is better to use the note-page attribute drop, with the value true.

Notice that subclauses of a note-page can also be left out in a similar way.

When used together with the theme facility, this is the preferred way to eliminate a note page or or one of its constituents.