You need a “drop cap”, or Initial, which is a “a letter at the beginning of a work, a chapter, or a paragraph that is larger than the rest of the text.”
Typographically, you have different options to place initials:
on the same baseline as the first line of text,
as floats, embedded between two or more lines,
besides the left margin of the text block without indentation.
Additionally you can design your initials as graphics, but we will come to this later.
This is the easiest method to implement. The stylesheet
normalizes the text node of the first paragraph, extract the first character
and wrap it between an fo:inline
element with font
size, family, and weight:
To use it, include it into your customization layer. It is usually called in text nodes like the first paragraph from a section which parent is an article:
It is easy to extend it to chapters, you just have to copy
the template and correct the content in the match
attribute to:
<xsl:template match="d:chapter/d:section/d:para[1]/text()">
TBD
TBD
The solution described in the section called “Place Initials on the Same Baseline” is in most cases sufficient. However, if the first character is not a letter, any character is incorrectly made an initial.
Find information about the property line-height
in Section 4.4, “Influencing the Leading”.
Project@GitHub | Issue#9 |