Table of Contents
More Resources
Editing List Spacing

Edit the various spacings regarding lists and list items in your custom PDF output.
context
You have the custom-attrs.xsl file (located in cfg/fo/attrs/) open and want to edit list spacing. This procedure uses examples for unordered lists, however, you can do the same thing for ordered lists.

  1. You need to get the default list styling so that you can modify it. The default attribute set is displayed below, as well as a screenshot of the default styling.

    Step Information
    < xsl:attribute-set name="ul" use-attribute-sets="common.block"> 
      < xsl:attribute name="provisional-distance-between-starts"> 5mm< /xsl:attribute> 
      < xsl:attribute name="provisional-label-separation"> 1mm< /xsl:attribute> 
    < /xsl:attribute-set> 
    
    < xsl:attribute-set name="ul.li"> 
      < xsl:attribute name="space-after"> 1.5pt< /xsl:attribute> 
      < xsl:attribute name="space-before"> 1.5pt< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

  2. You can add whatever attributes you want here. Start by adjusting the space before and after the individual list items. So, you’ll modify the “ul.li” attribute set by adding some padding attributes:

    Step Information
    < xsl:attribute-set name="ul.li"> 
      < xsl:attribute name="space-after"> 1.5pt< /xsl:attribute> 
      < xsl:attribute name="space-before"> 1.5pt< /xsl:attribute> 
      < xsl:attribute name="padding-top"> 10px< /xsl:attribute> 
      < xsl:attribute name="padding-bottom"> 10px< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

  3. In addition to adding space between list items, you can also adjust the spacing before and after the entire list elements. You can use the padding attributes here as well (on the “ul” attribute set):

    Step Information
    < xsl:attribute-set name="ul" use-attribute-sets="common.block"> 
      < xsl:attribute name="provisional-distance-between-starts"> 5mm< /xsl:attribute> 
      < xsl:attribute name="provisional-label-separation"> 1mm< /xsl:attribute> 
      < xsl:attribute name="padding-top"> 10px< /xsl:attribute> 
      < xsl:attribute name="padding-bottom"> 10px< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

  4. Using the existing “provisional-distance-between-starts” attribute (in the “ul” attribute set) you can adjust how much space there is between the bullet and the start of the text:

    Step Information
    < xsl:attribute-set name="ul" use-attribute-sets="common.block"> 
      < xsl:attribute name="provisional-distance-between-starts"> 15mm< /xsl:attribute> 
      < xsl:attribute name="provisional-label-separation"> 1mm< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

  5. You can adjust the distance between the page margin and the bullet by adjusting the “margin-left” attribute on the “ul” attribute set.

    Step Information
    < xsl:attribute-set name="ul" use-attribute-sets="common.block"> 
      < xsl:attribute name="provisional-distance-between-starts"> 5mm< /xsl:attribute> 
      < xsl:attribute name="provisional-label-separation"> 1mm< /xsl:attribute> 
      < xsl:attribute name="margin-left"> 20px< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

  6. You can also adjust the line-height of the list item text content (as explained in Editing Paragraph Spacing). However, be careful because this will also adjust the spacing between list items (the same as adjusting padding-bottom): 

    Step Information
    < xsl:attribute-set name="ul.li"> 
      < xsl:attribute name="space-after"> 1.5pt< /xsl:attribute> 
      < xsl:attribute name="space-before"> 1.5pt< /xsl:attribute> 
      < xsl:attribute name="line-height"> 15px< /xsl:attribute> 
    < /xsl:attribute-set> 

    Expected Result

result
You modified the list spacing in your PDF output.