code: protected void writeSection(Section section, int indent) throws IOException {
          if (section.getTitle() != null) {
              int depth = section.getDepth() - 1;
              if (depth > 5) {
                  depth = 5;
              }
              Properties styleAttributes = new Properties();
              if (section.getTitle().hasLeading()) styleAttributes.setProperty(Markup.CSS_KEY_LINEHEIGHT, section.getTitle().getTotalLeading() + "pt");
              // start tag
              addTabs(indent);
              writeStart(HtmlTags.H[depth]);
              write(section.getTitle().getFont(), styleAttributes);
              String alignment = HtmlEncoder.getAlignment(section.getTitle().getAlignment());
              if (!"".equals(alignment)) {
                  write(HtmlTags.ALIGN, alignment);
              }
              writeMarkupAttributes(markup);
              os.write(GT);
              currentfont.push(section.getTitle().getFont());
              // contents
              for (Iterator i = section.getTitle().iterator(); i.hasNext(); ) {
                  write((Element)i.next(), indent + 1);
              }
              // end tag
              addTabs(indent);
              writeEnd(HtmlTags.H[depth]);
              currentfont.pop();
          }
          for (Iterator i = section.iterator(); i.hasNext(); ) {
              write((Element) i.next(), indent);
          }
      }
docs: Writes the HTML representation of a section.
  
  @param   section     the section to write
  @param   indent      the indentation
  @throws IOException