Hyphenation
The CSS hyphens
property specifies how the words should be hyphenated when
the paragraph text wraps on multiple lines.
The accepted values are:
- manual
-
Words are only hyphenated when there are characters inside the word that explicitly suggest hyphenation opportunities. Those characters are:
- U+2010 (HYPHEN)
- The "hard" hyphen character indicates a visible line break opportunity. The hyphen is always shown in the output.
- U+00AD (SHY)
- An invisible "soft" hyphen. This character is not rendered visibly. It marks a
breaking place for the word if hyphenation is necessary. You can use
­
in XML or­
in HTML.
- auto
- Words are hyphenated automatically according to an algorithm that is driven by a
hyphenation dictionary. Also, Oxygen PDF Chemistry uses an aggressive technique to
create hyphenation points at underscores, dots, and case changes. This is useful when
your publication contains snippets of code (Java, JS). To disable this functionality,
you can use the
-no-aggressive-hyphenation
parameter.Note: The element, or one of its parents, must have alang
orxml:lang
attribute present for the processor to identify the hyphenation dictionary. If this is missing, themanual
hyphenation is performed.<table lang="en"> ... </table>
- none
- Currently not supported by Oxygen PDF Chemistry and it falls back to
manual
. If your document does not use theHYPHEN
orSHY
characters, no hyphenation is done.
Example: Hyphenation
To perform hyphenation on all paragraphs from an HTML document, you can
use:
p {
hyphens: auto;
}
Usually, it is best to activate hyphenation for elements that are known to have a limited
width (for example, on tables) where long words could bleed off the
page:
table {
hyphens: auto;
}