XML technologies / ePUB / Open Publication Structure / Text structure and character formatting / Paragraphs or lines

(Excerpt from “E-Books mit ePUB ─ Von Word zum E-Book mit XML” by Dr. Victor Wang)

The normal paragraph <p> is used identically in both standards, DTBook and XHTML. It usually represents a typographic paragraph, structurally the lowest block element. Typography usually identifies it clearly: it begins on a new line and ends with a line break.

Line breaks inside a paragraph are generally arbitrary and unimportant. Sometimes, however, preserving individual lines matters. Recall the repeated example of “Max und Moritz” and Wilhelm Busch’s rhyming verse.

<linegroup>
  <line>Ach, was muss man oft von bösen</line>
  <line>Kindern hören oder lesen!!</line>
  <line>Wie zum Beispiel hier von diesen,</line>
  <line>Welche Max und Moritz hießen;</line>
  <line>Die, anstatt durch weise Lehren</line>
  <line>Sich zum Guten zu bekehren,</line>
  <line>Oftmals noch darüber lachten</line>
  <line>Und sich heimlich lustig machten. -</line>
</linegroup> 

Code example: Line group with DTBook’s <linegroup> element

Here line preservation matters. DTBook offers an alternative to ordinary paragraphs, the line group, or stanza, <linegroup> and the individual line <line>.

A block such as a paragraph can also be broken with the empty element <br/> (line break), but use this sparingly in ordinary text flow.

As a DTD originally designed for audiobooks for visually impaired people, DTBook offers finer structures below paragraphs: sentences use the element <sent> (sentence), and words use <w>. Here is the opening of Thomas More’s “Utopia”, initially with sentence structure only:

<p>
  <sent>Wer eine Stadt kennt, kennt alle:</sent>
  <sent>so völlig ähnlich sind sie einander, soweit nicht die Beschaffenheit des Geländes dem entgegensteht.</sent>
  <sent>Ich will deshalb irgendeine beschreiben;</sent>
  <sent>es kommt nämlich wirklich nicht viel darauf an, welche.</sent>
  <sent>Aber welche lieber als Amaurotum?</sent>
  <sent>Denn keine verdient es mehr, da dieser Stadt die übrigen die Würde als Sitz des Senats übertragen haben und da ich sie infolge meines ununterbrochenen fünfjährigen Aufenthaltes dort besser als jede andere kenne.</sent>
</p> 

Code example: Excerpt from Thomas More’s Utopia in DTBook

With additional word markup, the first sentence becomes:

<sent><w>Wer</w> <w>eine</w> <w>Stadt</w> <w>kennt</w>, <w>kennt</w> <w>alle</w>:</sent> 

This extremely fine structure was intended for synchronized audio and text display, as found in some language-learning software.

   

 

 

 

back to top