Number layout

From Apache OpenOffice Wiki
Revision as of 16:37, 30 November 2006 by Flr (Talk | contribs)

Jump to: navigation, search

Number Layout capabilities in OD

The layout of numbered paragraphs in ODT is controlled by

a)Paragraphs properties, like indent, etc; and

b)Numbering position and spacing properties: indent (text:space-before), spacing to text (text:min-label-distance), minimum space numbering <-> text(text:min-label-distance) and numbering alignment (fo:text-align).

Properties of category (a) and (b) are “additive”, e.g. the real paragraph indent is calculated by the paragraph indent property and the number indent property and the minimum space numbering <-> text property. The following figure shows, how the layout of a numbered paragraph is influenced by the different parameters. The parameters shown are those defined in the ODT file format:

ODNumLayoutExample.jpg

The spacing l* is calculated by

l*:=max{text:min-label-width, text:min-label-distance+label-width}

The position of the label within the l* space is controlled by the fo:text-align parameter.

Number layout capabilities in WW

In WW the layout of numbered paragraphs is controlled by the paragraph's properties and mainly by the “level follow char”, which is either a tab; a space or nothing. Usually the “level follow char” is a “tab” and the space between the number's label and the paragraph text is given by the defined tab positions:

WWNumLayoutExample.jpg

The justification of the label is set with respect to the paragraph left indent (w:first-line+w:left). Although being “faked” by the GUI no “own” number spacing and position properties exist in Microsoft Word.

The number layout capabilities of WW and the number layout capabilities of ODT do not match. For illustration consider e.g. the following document (which happens to occur in real word). The following screen shot shows a numbered paragraph in Microsoft Word:

NumParSample1Example.jpg

The above paragraph is numbered, the follow char is a tab and the paragraph defines two tab positions. When the number in the above example grows, automatically the next tab position will be chosen:

NumParSample2Example.jpg

This e.g. can not be modelled using the ODT number layout capabilities without knowing the actual labels length at import time.


OD Enhancement

We suggest the introduction of a special min-label-width-suffix flag in the number layout properties. It is used to model WW's “follow char” and the difference between label alignments.

The semantic of the min-label-width-suffix flag is as follows: When min-label-width-suffix is set to “tab”, then l* is set to the next tab position following the label and the label is aligned at the first indent. When min-label-width-suffix is “space” or “nothing” then l* is set in the appropriate way and also the label is aligned with respect to the first indent.

The text:min-tabel-distance, text:space-before and text:min-tabel-width parameters are ignored in case of min-label-width-suffix is set. However they should be set for backward compatibility reasons.

In the ODT file format the min-label-width-suffix property is defined by enhancing the style-list-level-properties-attlist definition in the following way:

<define name="style-list-level-properties-attlist" combine="interleave">
 <optional>
  <attribute name="text:min-label-width-suffix">
   <choice>
    <value>tab</value>
    <value>space</value>
    <value>nothing</value>
   </choice>
  </attribute>
 </optional>
</define>

Change in number alignment

Consider for example the following numbered paragraph created in WW:

NumAlignmentExample.jpg

The red line illustrates the line with respect to which the label is aligned. The number alignment in the above sample is set to “centered”.

So --- when the text:min-label-width-suffix is set the text:fo-align property is interpretet differently.

  • left: Layout the label text as if the "red line" in the above picture is a "left tab";
  • centered: Layout the label text as if the "red line" in the above picture is a "centered tab";
  • right: Layout the label text as if the"red line" in the above picture is a "right tab".

Change in OOo GUI

Bulletsandnumbering position.jpg


Better use of styles

Finally I should be possible to attach a "list style" to a "paragraph style".

For example in WW you can create a paragraph style "My Numbering" which has a list style. Thus when you apply the style "My Numbering" to a paragraph, the paragraph gets numbered.

It is currently already possible/allowed to add a "style:list-style-name" attribute to a paragraph style. However this is not possible in OO.o Writer.

Personal tools