OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] looking for advice on how to support "exercises" ... argh

On Fri, May 16, 2003 at 02:37:51PM -0400, Robert P. J. Day wrote:
> On Fri, 16 May 2003, Joachim Ziegler wrote:
> > hello,
> > 
> > i have nearly the same problem as you. i remember that we had some 
> > discussion here some time ago about why there is no <exercise>-element 
> > in DocBook.
> > 
> > what i need is a markup for exercises. exercises usually come in 
> > an"exercise-section".
> > 
> > 
> > in HTML and PDF output, every exercise should be numbered. the numbers 
> > should simply increase from the beginning of the text to the end, no 
> > matter where the corrsp. exercise  occurs.
> > 
> > so it should look like
> > 
> > 
> > Exercises:
> > 
> >    17. Proof that P != NP.
> > 
> > 
> >    18. Proof that 1+2+..+n = 1/2*n*(n-1)
> > 
> > 
> > 
> > does anybody know how to markup this and/or how to adapt the stylesheets 
> > for exercises?
> ah, this introduces another issue i never thought of -- that exercises
> might be numbered continuously throughout a section/chapter/book.  i 
> always start my exercise set over at 1 each time, but i can certainly
> see the need for a continuous numbering option.
> as it stands, i use an <orderedlist>, but that is a pretty weak
> excuse for a set of exercises.  here's what would be nice for an
> <exercises> element, even though some of it really falls into
> stylesheet presentation:
> 1) the ability to number continuously within a certain division, 
>    such as book, chapter, section, what have you.
>    perhaps a "restart-after" attribute which takes as a value
>    something like "chapter", "section" and so on.

Actually, orderedlist already has an attribute for this.
If you add a continuation="continues" attribute to your
orderedlist, the listitems will continue numbering
from the previous orderedlist.  But it has two problems:

1.  It applies to all orderedlists, not just your exercise
orderedlists.  You would have to add a role="exercises"
attribute to all your exercise orderedlists and customize
the stylesheet to continue the numbering only for
such lists.

2.  The continuation attribute isn't implemented in the
fo stylesheet, only the html stylesheets.  This is a bug
for which I've filed a bug report [745016].

> 2) the ability (and i know there will be howls of outrage over
>    this one) to insert an arbitrary number of blank lines after
>    an exercise or sub-exercise.  in many manuals, you may want
>    to leave space to allow the reader to fill in the answer
>    at that point.

Did you try a literallayout with a number of
empty lines?
>    i realize this violates the spirit of docbook, but there
>    should be *some* way to support this.
> 3) an <exercises> element should be a truly different kind of "list"
>    and not just a special case of list, section or what have you,
>    since it may be treated *very* differently from any of those

An orderedlist with role="exercises" allows you to
process such lists differently from other orderedlists.
Opinions will vary, but if it doesn't have or need a
different content model, then I can't see adding yet
another list type to DocBook.


Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]