@@ -224,29 +224,41 @@ def exclude_api_from_gettext(app):
224224
225225latex_elements = {
226226 # Use xelatex (set via ``latex_engine`` below): pdflatex chokes on the
227- # emoji / box-drawing / arrow glyphs sprinkled across the docs. Map the
228- # known problematic Unicode chars to the Symbola font (``fonts-symbola``
229- # on Debian/Ubuntu; usually fetched on demand by MiKTeX on Windows).
227+ # emoji / box-drawing / arrow glyphs sprinkled across the docs. The
228+ # ``ucharclasses`` package automatically routes whole Unicode blocks
229+ # (emoji, dingbats, box-drawing, ...) to the Symbola fallback font
230+ # (Debian/Ubuntu package ``fonts-symbola``; MiKTeX fetches it on
231+ # demand on Windows).
230232 "preamble" : r"""
231233 \usepackage{amsmath}
232234 \usepackage{amssymb}
233235 \usepackage{mathrsfs}
234236 \usepackage{fontspec}
235- \usepackage{newunicodechar}
236237 \newfontfamily\unicodefallback{Symbola}[Scale=MatchLowercase]
237- \newunicodechar{✅}{{\unicodefallback ✅}}
238- \newunicodechar{❌}{{\unicodefallback ❌}}
239- \newunicodechar{💡}{{\unicodefallback 💡}}
240- \newunicodechar{➝}{{\unicodefallback ➝}}
241- \newunicodechar{↔}{{\unicodefallback ↔}}
242- \newunicodechar{┌}{{\unicodefallback ┌}}
243- \newunicodechar{┐}{{\unicodefallback ┐}}
244- \newunicodechar{└}{{\unicodefallback └}}
245- \newunicodechar{┘}{{\unicodefallback ┘}}
246- \newunicodechar{├}{{\unicodefallback ├}}
247- \newunicodechar{┤}{{\unicodefallback ┤}}
248- \newunicodechar{─}{{\unicodefallback ─}}
249- \newunicodechar{│}{{\unicodefallback │}}
238+ \usepackage[
239+ Dingbats,
240+ Arrows,
241+ MiscellaneousSymbolsandArrows,
242+ MiscellaneousSymbols,
243+ MiscellaneousSymbolsandPictographs,
244+ MiscellaneousTechnical,
245+ BoxDrawing,
246+ GeometricShapes,
247+ SupplementalSymbolsandPictographs,
248+ Emoticons,
249+ TransportandMapSymbols,
250+ ]{ucharclasses}
251+ \setTransitionsForDingbats{\unicodefallback}{\normalfont}
252+ \setTransitionsForArrows{\unicodefallback}{\normalfont}
253+ \setTransitionsForMiscellaneousSymbolsandArrows{\unicodefallback}{\normalfont}
254+ \setTransitionsForMiscellaneousSymbols{\unicodefallback}{\normalfont}
255+ \setTransitionsForMiscellaneousSymbolsandPictographs{\unicodefallback}{\normalfont}
256+ \setTransitionsForMiscellaneousTechnical{\unicodefallback}{\normalfont}
257+ \setTransitionsForBoxDrawing{\unicodefallback}{\normalfont}
258+ \setTransitionsForGeometricShapes{\unicodefallback}{\normalfont}
259+ \setTransitionsForSupplementalSymbolsandPictographs{\unicodefallback}{\normalfont}
260+ \setTransitionsForEmoticons{\unicodefallback}{\normalfont}
261+ \setTransitionsForTransportandMapSymbols{\unicodefallback}{\normalfont}
250262 """
251263 + "\n " .join (f"\\ newcommand{{\\ { cmd } }}{{{ defn } }}" for cmd , defn in macros .items ()),
252264}
0 commit comments