scitex_msword.bold
Preserve specified tokens by re-splitting runs and applying bold + font.
This module implements preserve_bold_tokens() which scans a
python-docx Document, locates every occurrence of each token, and
ensures that token is its own run with bold=True and a configurable
font (default MS Gothic — used for emphasized Japanese keywords in
the BOOST 2026 application).
The implementation operates per paragraph: it concatenates run text,
finds token spans, then rebuilds the paragraph’s runs as
[before, token, after] triples, preserving the original character
formatting of the surrounding text.
Functions
|
Walk every paragraph in |