Edit online

Hyphenation specifies how words should be hyphenated when text wraps across multiple lines.

The transformation plugin uses the capabilities of the PDF Chemistry processor to perform hyphenation.

Edit online

The Oxygen XML Author Eclipse plugin provides built-in hyphenation patterns for the following languages:
Code Language
da Danish
de German
de_CH German (Switzerland)
en English
en-GB English (Great Britain)
es Spanish
fr French
it Italian
nb Norwegian Bokmål
nl

Dutch

ro Romanian
ru Russian
sv Swedish
th Thai
pt Portuguese
da Danish

The built-in hyphenation pattern license terms are listed in the XML files in the [CHEMISTRY_INSTALL_DIR]/config/hyph folder. Most of them comply with the LaTex distribution policy.

Edit online

The Oxygen XML Author Eclipse plugin uses the TeX hyphenation dictionaries converted to XML by the OFFO project: https://sourceforge.net/projects/offo/.

For a Standalone Chemistry Installation

The hyphenation dictionaries are located in: [CHEMISTRY_INSTALL_DIR]/config/hyph. The .xml files allow you to read the licensing terms. The .hyp files are the compiled dictionaries that the Oxygen XML Author Eclipse plugin actually uses.

One simple way to add more dictionaries:
  1. Download and extract the offo-hyphenation-compiled.zip file. This file is a bundle of many dictionary files.
  2. Copy the fop-hyph.jar file to the [CHEMISTRY_INSTALL_DIR]/lib directory.
  3. If you just need a single dictionary, place the .hyp file in the [CHEMISTRY_INSTALL_DIR]/config/hyph directory.

For Chemistry Embedded into an Oxygen XML Editor Installation

To add dictionaries:
  1. Download and extract the offo-hyphenation-compiled.zip file.
  2. Copy the fop-hyph.jar file to the [OXYGEN_INSTALL_DIR]/lib directory.
  3. If you just need a single dictionary, place the .hyp file in the [OXYGEN_INSTALL_DIR]/config/hyph directory. Create that directory if it is missing.

For Chemistry Embedded into a DITA Oxygen Publishing Engine

The hyphenation dictionaries are located in: [OPE_INSTALL_DIR]/plugins/com.oxygenxml.pdf.css/lib/oxygen-pdf-chemistry/config/hyph.

To add dictionaries:
  1. Download and extract the offo-hyphenation-compiled.zip file. This file is a bundle of many dictionary files.
  2. Copy the fop-hyph.jar file to the [CHEMISTRY_INSTALL_DIR]/lib directory.
  3. If you just need a single dictionary, place the .hyp file in the [OPE_INSTALL_DIR]/plugins/com.oxygenxml.pdf.css/lib/oxygen-pdf-chemistry/config/hyph directory.

Edit online

The hyphenation dictionaries are stored as XML files in the [CHEMISTRY_INSTALL_DIR]/config/hyph directory.

Each file is named with the language code and has the following structure:

<hyphenation-info>

<hyphen-min before="2" after="3"/>

<exceptions>
o-mni-bus
...
</exceptions>

<patterns>
préémi3nent.
proémi3nent.
surémi3nent.
....
</patterns>

</hyphenation-info>
To change the behavior of the hyphenation, you can modify either the patterns or the exceptions sections:
exceptions
Contains the list of words that are not processed using the patterns, each on a single line. Each of the words should indicate the hyphenation points using the hyphen ("-") character. If a word does not contain this character, it will not be hyphenated.

For example, o-mni-bus will match the omnibus word and will indicate two possible hyphenation points.

Note: Compound words (like "e-mail") cannot be controlled by exception words.
patterns
Contains the list of patterns, each on a single line. A pattern is a word fragment, not a word. The numbers from the patterns indicate how desirable a hyphen is at that position.

For example, tran3s2act indicates that the possible hyphenation points are "tran-s-act" and the preferable point is the first one, having the higher score of "3".

After you add the exceptions and the patterns, you will have to rebuild the binary dictionaries.

Edit online

Every time you change the dictionary source XML files, you have to rebuild the binary dictionaries:

  1. Locate the folder that contains the dictionary sources: [CHEMISTRY_INSTALL_DIR]/config/hyph.
  2. Start a command-line terminal and change the directory to that folder.
  3. Start the hyph.bat (on Windows) or hyph.sh (on Linux or Mac).

A report with the rebuilt dictionaries should be listed in the terminal.

Edit online

To enable hyphenation for your entire map:

  1. Make sure you set an @xml:lang attribute on the root of your map, or set the default.language parameter in the transformation.
  2. In your customization CSS, add:
    :root {
        hyphens: auto;
    }
  3. To except certain elements from being hyphenated, use hyphens:none. The following example excludes the <keyword> elements from being hyphenated:
    *[class ~= "topic/keyword"] {
        hyphens: none;
    }

Edit online

To enable hyphenation for your entire map:

  1. Make sure you set an @xml:lang attribute on the root of your map or your table elements.
  2. The built-in CSS already has the following rule defined that activates hyphenation:
    *[class ~= "topic/table"] {
        hyphens: auto;
    }
    Note: To disable table hyphenation, add the following in your customization CSS:
    *[class ~= "topic/table"] {
        hyphens: none;
    }
  3. To prevent certain elements from being hyphenated, use hyphens:none. The following example excludes the <keyword> elements from being hyphenated:
    *[class ~= "topic/keyword"] {
        hyphens: none;
    }

Edit online

To disable hyphenation for a specific word, there are several possible approaches:

  • If the word is a compound (like "T-shirt") and you want to keep it on the same line, you have two options:
    Manual Approach
    Wrap the word in an inline element with the @outputclass attribute set. In the CSS, change its style to white-space:nowrap;. For example:
    .. <ph outputclass="no-hyphenation">T-shirt</ph>...
    *[outputclass ~= "no-hyphenation"] {
    	white-space: nowrap;
    }
    Automatic Approach
    A better alternative to this is to write an XSLT extension that matches the text nodes and performs automatic markup (to see an example, go to How to Wrap Words in Markup in the XSLT Extensions for PDF Transformations section). Then match the compound-word class the same as in the previous example:
    *[outputclass ~= "compound-word"] {
    	white-space: nowrap;
    }
    Another Alternative
    In all the compound words from your documentation, replace the hyphen ("-") with a non-breaking hyphen character U+2011 (or XML notation &#2011;).

    Then change the autocorrect settings to automatically replace the compound word with its equivalent. For example: "T-shirt" would be replaced with "T[\u2011]shirt".

  • If the word is not a compound, you have two options: