Repository: sympy/sympy
Pull request: [PDF] Fix "Missing character" issues when building PDF
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

#### References to other Issues or PRs

Fix #26877


<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->


#### Brief description of what is fixed or changed

Suitable LaTeX font configuration to support all needed characters.

#### Other comments

We only need two additional fonts from a standard LaTeX installation based on TeXLive.  But rather than go check how this is packaged in Ubuntu or on Windows, this is done is completely safe way and will be enacted only if the font are actually there.

Most characters where already available in DejaVu Sans, but not in DejaVu Sans Mono. 

A mark-up glitch in a source found while examining PDF was also fixed.

#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers. Formerly, `log(-x)` incorrectly gave `-log(x)`.

* physics.units
  * Corrected a semantical error in the conversion between volt and statvolt which
    reported the volt as being larger than the statvolt.

or if no release note(s) should be included use:

NO ENTRY

See https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more
information on how to write release notes. The bot will check your release
notes automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->
NO ENTRY
<!-- END RELEASE NOTES -->


Problem statement:
[PDF] Missing characters are reported during PDF via LaTeX build
Page numbers from log maybe off because I had a problem with the Chromium svg to pdf conversion so perhaps this induces some shift not sure.  Besides only some pages numbers are shown because by luck the warning was the first one on current page, so `[NNNN]` indicates the page *before*.

I hope globally this is enough to locate sources.  The ones with U+0003 are a bit strange and may indicated corrupted sources (no it was simply `\mathbf{\Lambda}` see next comment) others are more expected.  Fixing the latter will require finding fonts with the suitable glyphs and do some preamble additions.

```text
latex$ grep -C1 'Missing character' sympy-1.14.dev.log
[329]
Missing character: There is no ^^C (U+0003) in font DejaVu Serif Bold/OT:script
=latn;language=dflt;mapping=tex-text;!
Missing character: There is no ^^C (U+0003) in font DejaVu Serif Bold/OT:script
=latn;language=dflt;mapping=tex-text;!
--
[330]
Missing character: There is no ^^C (U+0003) in font DejaVu Serif Bold/OT:script
=latn;language=dflt;mapping=tex-text;!
Missing character: There is no ^^C (U+0003) in font DejaVu Serif Bold/OT:script
=latn;language=dflt;mapping=tex-text;!
--
[1135]
Missing character: There is no ∊ (U+220A) in font DejaVu Serif/OT:script=latn;l
anguage=dflt;mapping=tex-text;!
--
[1741]
Missing character: There is no 𝑅 (U+1D445) in font DejaVu Serif/OT:script=latn;
language=dflt;mapping=tex-text;!
--
[2223]
Missing character: There is no ⭯ (U+2B6F) in font DejaVu Sans Mono/OT:script=la
tn;language=dflt;mapping=tex-text;!
--

Missing character: There is no ⭯ (U+2B6F) in font DejaVu Sans Mono/OT:script=la
tn;language=dflt;mapping=tex-text;!
--
[2231]
Missing character: There is no ⭯ (U+2B6F) in font DejaVu Sans Mono/OT:script=la
tn;language=dflt;mapping=tex-text;!
--
[2236]
Missing character: There is no ⭯ (U+2B6F) in font DejaVu Sans Mono/OT:script=la
tn;language=dflt;mapping=tex-text;!
--
[2545]
Missing character: There is no ᵦ (U+1D66) in font DejaVu Sans Mono Bold/OT:scri
pt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no ᵪ (U+1D6A) in font DejaVu Sans Mono Bold/OT:scri
pt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no ᵧ (U+1D67) in font DejaVu Sans Mono Bold/OT:scri
pt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no ᵩ (U+1D69) in font DejaVu Sans Mono Bold/OT:scri
pt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no ᵨ (U+1D68) in font DejaVu Sans Mono Bold/OT:scri
pt=latn;language=dflt;mapping=tex-text;!
--
[2546]
Missing character: There is no ┬ (U+252C) in font DejaVu Sans Mono Bold/OT:scri
pt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no ⅆ (U+2146) in font DejaVu Sans Mono Bold/OT:scri
pt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no 𝕀 (U+1D540) in font DejaVu Sans Mono Bold/OT:scr
ipt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no ⊼ (U+22BC) in font DejaVu Sans Mono Bold/OT:scri
pt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no ⊽ (U+22BD) in font DejaVu Sans Mono Bold/OT:scri
pt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no 𝟙 (U+1D7D9) in font DejaVu Sans Mono Bold/OT:scr
ipt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no ┴ (U+2534) in font DejaVu Sans Mono Bold/OT:scri
pt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no ⨂ (U+2A02) in font DejaVu Sans Mono Bold/OT:scri
pt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no 𝕌 (U+1D54C) in font DejaVu Sans Mono Bold/OT:scr
ipt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no ⊻ (U+22BB) in font DejaVu Sans Mono Bold/OT:scri
pt=latn;language=dflt;mapping=tex-text;!
Missing character: There is no 𝟘 (U+1D7D8) in font DejaVu Sans Mono Bold/OT:scr
ipt=latn;language=dflt;mapping=tex-text;!
--
[3472]
Missing character: There is no 彭 (U+5F6D) in font DejaVu Sans Mono/OT:script=la
tn;language=dflt;mapping=tex-text;!
Missing character: There is no 于 (U+4E8E) in font DejaVu Sans Mono/OT:script=la
tn;language=dflt;mapping=tex-text;!
Missing character: There is no 斌 (U+658C) in font DejaVu Sans Mono/OT:script=la
tn;language=dflt;mapping=tex-text;!
--
[3474]
Missing character: There is no ❌ (U+274C) in font DejaVu Serif/OT:script=latn;l
anguage=dflt;mapping=tex-text;!
```

Hints from issue discussion:
The `^^C` ones come from `\mathbf{\Lambda_c}` mark-up in `src/explanation/modules/physics/mechanics/lagrange.rst`.  

Edit: *this next sentence is **wrong**  on two counts.  Loading `unicode-math` does not solve this issue.   At least with the current version one should use `\symbf` here not `\mathbf`.  And actually it does not seem to increase build time either (I had seen LaTeX on some other big project with custom set-up almost stalled right after loading unicode-math-table.tex, but on investigating closer today I realize it was stalled due to something done *next*... apologies to unicode-math here).*

<strike>Such mark-up may work (untested) if loading package `unicode-math` (which will cause a noticeable addition of a few seconds to the build time of PDF) but perhaps</strike>

simpler to use `\bm` in place of `\mathbf` (as package `bm` is loaded via conf.py set-up anyhow).  However I don't know if MathJax interprets `\bm` (probably it does?).

with `\mathbf`
![Capture d’écran 2024-07-30 à 12 59 44](https://github.com/user-attachments/assets/462d9403-953c-413c-b429-127dff2ead10)

with `\bm`
![Capture d’écran 2024-07-30 à 13 00 40](https://github.com/user-attachments/assets/fc1ba46c-f42e-4997-85d7-21bb11337e08)

Looking more closely, the problem is also related to fontspec package  which modifies `\mathbf` to map to current text font.  Using ``\usepackage[no-math]{fontspec}`` *also fixes this*.

Indeed `\mathbf` in traditional LaTeX has never worked for *lowercase* Greek (by design) but always worked for the 10 or 11 uppercase Greek letters having their associated macro name such as here `\Lambda` (because `\mathbf` maps to an old-fashioned TeX font in OT1 encoding which happens to have the bold uppercase Greek letters in slots 0 to 10 (or 9, I forget)).

The `\usepackage{fontspec}` originates here from old Sympy conf.py "denounced" at PR #26868, but it is also used upstream at Sphinx.  I think Sphinx should do `\usepackage[no-math]{fontspec}` and will perhaps raise an issue there.

Edit 2: *upstream issue raised at https://github.com/sphinx-doc/sphinx/issues/12714.  It is not really an upstream issue currently for Sympy but will become one if #26868 is merged.  Currently `\usepackage{fontspec}` originates from Sympy itself.  In both cases using the `'passoptionstopackages'`of `latex_elements` could be used to pass `no-math`.*

Edit 3: with `\usepackage[no-math]{fontspec}` + (after it) `\usepackage{unicode-math}` one gets another type of error:

```
Missing character: There is no 𝛬 (U+1D6EC) in font DejaVu Serif Bold/OT:script=
latn;language=dflt;mapping=tex-text;!
```

Indeed `unicode-math` transforms `\mathbf` into something trying to use Unicode code-points so the error change nature.
- If using `lualatex` there is a mechanism of fallback-fonts which could be attempted. 
- in fact the correct mark-up with `unicode-math` is probably `\symbf`.  But it has to work for HTML of course.  I tested now and MathJax renders it correctly. My HTML from Sphinx 8 contained
```html
<script async="async" src="[https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js](view-source:https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js)"></script>
```
and the boldface Lambda was there on the page.

Advantage of unicode-math is to allow literal Unicode in math mode.  But in the case at hand as we see `\mathbf` has to be replaced by `\symbf` (and `no-math` is still recommended for fontspec, leave it all to unicode-math to handle "at begin document").

Commit message: [PDF] Fix "Missing character" issues when building PDF

Fix #26877

Patch to review:
diff --git a/doc/src/conf.py b/doc/src/conf.py
index cb2a5409fb1f..517557f02e5c 100644
--- a/doc/src/conf.py
+++ b/doc/src/conf.py
@@ -372,7 +372,7 @@
 
 \usepackage{bm}
 \usepackage{amssymb}
-\usepackage{fontspec}
+\usepackage[no-math]{fontspec}
 \usepackage[english]{babel}
 \defaultfontfeatures{Mapping=tex-text}
 \setmainfont{DejaVu Serif}
@@ -383,7 +383,79 @@
     'inputenc':  '',
     'utf8extra': '',
     'preamble':  r'''
-'''
+\usepackage{newunicodechar}
+% Some Unicode characters need some re-mapping:
+% using \text to allow usage in math mode
+% Those turn out to be available in DejaVu Sans, but not Mono,
+% which caused Missing character.
+% Attention that if sans-serif font is modified in future, this
+% may need updates.
+\newunicodechar{ᵦ}{\text{\sffamily ᵦ}}%   (U+1D66)
+\newunicodechar{ᵧ}{\text{\sffamily ᵧ}}%   (U+1D67)
+\newunicodechar{ᵨ}{\text{\sffamily ᵨ}}%   (U+1D68)
+\newunicodechar{ᵩ}{\text{\sffamily ᵩ}}%   (U+1D69
+\newunicodechar{ᵪ}{\text{\sffamily ᵪ}}%   (U+1D6A)
+\newunicodechar{∧}{\text{\sffamily ∧}}%   (U+2227)
+\newunicodechar{∪}{\text{\sffamily ∪}}%   (U+222A)
+\newunicodechar{ⅆ}{\text{\sffamily ⅆ}}%   (U+2146)
+\newunicodechar{∊}{\text{\sffamily ∊}}%   (U+220A)
+\newunicodechar{⊻}{\text{\sffamily ⊻}}%   (U+22BB)
+\newunicodechar{⊼}{\text{\sffamily ⊼}}%   (U+22BC)
+\newunicodechar{⊽}{\text{\sffamily ⊽}}%   (U+22BD)
+\newunicodechar{⨂}{\text{\sffamily ⨂}}%   (U+2A02)
+% Those next two are not available in DejaVu Sans Bold,
+% we can find them in boldface in XITS or simply use \mdseries
+% Opting for the later here.
+\newunicodechar{┬}{\text{\sffamily\mdseries ┬}}%   (U+252C)
+\newunicodechar{┴}{\text{\sffamily\mdseries ┴}}%   (U+2534)
+% Next one (cross mark) is  used only once in sources (not in math mode).
+% Available in Emoji fonts such as Noto Emoji.
+% U+2715 is available in DejaVu Sans and DejaVu Sans Mono but not Serif
+\newunicodechar{❌}{\textcolor{red}{\sffamily\bfseries ✕}}% (U+274C --> U+2715)
+%
+% \IfFontExistsTF was added to fontspec at v2.5c 2017/01/02.
+% If it does not exist we take no risk.
+\makeatletter
+\ifdefined\IfFontExistsTF\else\let\IfFontExistsTF\@secondoftwo\fi
+\makeatother
+%
+%
+\IfFontExistsTF{NewCMMath-Regular.otf}
+ {%
+  \newfontfamily{\NCMMath}{NewCMMath-Regular}
+  % This one is available (on TeXLive 2024) only in New Computer Modern Math
+  % and OldStandard-Math.
+  \newunicodechar{⭯}{\text{\NCMMath ⭯}}%   (U+2B6F)
+  % Those next few are all available in New Computer Modern Math:
+  \newunicodechar{𝑅}{\text{\NCMMath 𝑅}}%   (U+1D445)
+  \newunicodechar{𝕀}{\text{\NCMMath 𝕀}}%   (U+1D540)
+  \newunicodechar{𝕌}{\text{\NCMMath 𝕌}}%   (U+1D54C)
+  \newunicodechar{𝟘}{\text{\NCMMath 𝟘}}%   (U+1D7D8)
+  \newunicodechar{𝟙}{\text{\NCMMath 𝟙}}%   (U+1D7D9)
+ }
+ {\AtEndDocument{\typeout{%
+    𝑅 and some like characters could not be rendered as^^J%
+    New Computer Modern Math font could not be found or fontspec^^J
+    package is too old (we need 2.5c 2017/01/02 or later).%
+    }%
+   }%
+ }%
+\IfFontExistsTF{HaranoAjiMincho-Regular.otf}
+ {%
+  % A few Asian ideograms:
+  \newfontfamily{\HaranoAjiMincho}{Harano Aji Mincho}
+  \newunicodechar{于}{\text{\HaranoAjiMincho 于}}%   (U+4E8E)
+  \newunicodechar{彭}{\text{\HaranoAjiMincho 彭}}%   (U+5F6D)
+  \newunicodechar{斌}{\text{\HaranoAjiMincho 斌}}%   (U+658C)
+ }
+ {\AtEndDocument{\typeout{%
+    于 and some like characters could not be rendered as^^J%
+    Harano Aji Mincho font could not be found or fontspec^^J
+    package is too old (we need 2.5c 2017/01/02 or later).%
+    }%
+   }%
+ }%
+''',
 }
 
 # SymPy logo on title page
diff --git a/doc/src/modules/solvers/solveset.rst b/doc/src/modules/solvers/solveset.rst
index 8c83c355e094..189b0e7b3db3 100644
--- a/doc/src/modules/solvers/solveset.rst
+++ b/doc/src/modules/solvers/solveset.rst
@@ -105,7 +105,7 @@ containers in mathematics such as:
 
 Also, the predefined set classes such as:
 
- * :class:`~.Naturals`, $\mathbb{N}
+ * :class:`~.Naturals`, $\mathbb{N}$
 
    Represents the natural numbers (or counting numbers), which are all
    positive integers starting from 1.


Code review comments:
diff_hunk: @@ -372,7 +372,7 @@
 
 \usepackage{bm}
path: doc/src/conf.py
text: @author:
This serves nothing because there is not a single usage of `\bm` in math mark-up in sources.  But who knows it may help in future. (MathJax in its default configuration as set-up by current Sphinx appears to render the `\bm`; of course the mark-up has primarily to work for HTML output so if `\bm{}` syntax was not understood by HTML this would be a no-go anyhow).

@user1:
This seems to be a holdover from galgebra, which was removed from sympy (see 8a29065982af9e8c512824688ded9b41eacbff56). We can remove it if it is unused. 

@author:
I pushed a commit at PR #26868 which removes `\usepackage{bm}`.

diff_hunk: @@ -383,7 +383,79 @@
     'inputenc':  '',
     'utf8extra': '',
     'preamble':  r'''
-'''
+\usepackage{newunicodechar}
+% Some Unicode characters need some re-mapping:
+% using \text to allow usage in math mode
+% Those turn out to be available in DejaVu Sans, but not Mono,
+% which caused Missing character.
+% Attention that if sans-serif font is modified in future, this
+% may need updates.
+\newunicodechar{ᵦ}{\text{\sffamily ᵦ}}%   (U+1D66)
+\newunicodechar{ᵧ}{\text{\sffamily ᵧ}}%   (U+1D67)
+\newunicodechar{ᵨ}{\text{\sffamily ᵨ}}%   (U+1D68)
+\newunicodechar{ᵩ}{\text{\sffamily ᵩ}}%   (U+1D69
+\newunicodechar{ᵪ}{\text{\sffamily ᵪ}}%   (U+1D6A)
+\newunicodechar{∧}{\text{\sffamily ∧}}%   (U+2227)
+\newunicodechar{∪}{\text{\sffamily ∪}}%   (U+222A)
+\newunicodechar{ⅆ}{\text{\sffamily ⅆ}}%   (U+2146)
+\newunicodechar{∊}{\text{\sffamily ∊}}%   (U+220A)
+\newunicodechar{⊻}{\text{\sffamily ⊻}}%   (U+22BB)
+\newunicodechar{⊼}{\text{\sffamily ⊼}}%   (U+22BC)
+\newunicodechar{⊽}{\text{\sffamily ⊽}}%   (U+22BD)
+\newunicodechar{⨂}{\text{\sffamily ⨂}}%   (U+2A02)
+% Those next two are not available in DejaVu Sans Bold,
+% we can find them in boldface in XITS or simply use \mdseries
+% Opting for the later here.
+\newunicodechar{┬}{\text{\sffamily\mdseries ┬}}%   (U+252C)
+\newunicodechar{┴}{\text{\sffamily\mdseries ┴}}%   (U+2534)
+% Next one (cross mark) is  used only once in sources (not in math mode).
+% Available in Emoji fonts such as Noto Emoji.
+% U+2715 is available in DejaVu Sans and DejaVu Sans Mono but not Serif
+\newunicodechar{❌}{\textcolor{red}{\sffamily\bfseries ✕}}% (U+274C --> U+2715)
+%
+% \IfFontExistsTF was added to fontspec at v2.5c 2017/01/02.
+% If it does not exist we take no risk.
+\makeatletter
+\ifdefined\IfFontExistsTF\else\let\IfFontExistsTF\@secondoftwo\fi
+\makeatother
+%
+%
+\IfFontExistsTF{NewCMMath-Regular.otf}
+ {%
+  \newfontfamily{\NCMMath}{NewCMMath-Regular}
+  % This one is available (on TeXLive 2024) only in New Computer Modern Math
+  % and OldStandard-Math.
+  \newunicodechar{⭯}{\text{\NCMMath ⭯}}%   (U+2B6F)
+  % Those next few are all available in New Computer Modern Math:
+  \newunicodechar{𝑅}{\text{\NCMMath 𝑅}}%   (U+1D445)
+  \newunicodechar{𝕀}{\text{\NCMMath 𝕀}}%   (U+1D540)
+  \newunicodechar{𝕌}{\text{\NCMMath 𝕌}}%   (U+1D54C)
+  \newunicodechar{𝟘}{\text{\NCMMath 𝟘}}%   (U+1D7D8)
+  \newunicodechar{𝟙}{\text{\NCMMath 𝟙}}%   (U+1D7D9)
+ }
+ {\AtEndDocument{\typeout{%
+    𝑅 and some like characters could not be rendered as^^J%
+    New Computer Modern Math font could not be found or fontspec^^J
path: doc/src/conf.py
text: @author:
should be `^^J%` to avoid space at start of next line in console output but well.
```suggestion
    New Computer Modern Math font could not be found or fontspec^^J%
```

diff_hunk: @@ -383,7 +383,79 @@
     'inputenc':  '',
     'utf8extra': '',
     'preamble':  r'''
-'''
+\usepackage{newunicodechar}
+% Some Unicode characters need some re-mapping:
+% using \text to allow usage in math mode
+% Those turn out to be available in DejaVu Sans, but not Mono,
+% which caused Missing character.
+% Attention that if sans-serif font is modified in future, this
+% may need updates.
+\newunicodechar{ᵦ}{\text{\sffamily ᵦ}}%   (U+1D66)
+\newunicodechar{ᵧ}{\text{\sffamily ᵧ}}%   (U+1D67)
+\newunicodechar{ᵨ}{\text{\sffamily ᵨ}}%   (U+1D68)
+\newunicodechar{ᵩ}{\text{\sffamily ᵩ}}%   (U+1D69
+\newunicodechar{ᵪ}{\text{\sffamily ᵪ}}%   (U+1D6A)
+\newunicodechar{∧}{\text{\sffamily ∧}}%   (U+2227)
+\newunicodechar{∪}{\text{\sffamily ∪}}%   (U+222A)
+\newunicodechar{ⅆ}{\text{\sffamily ⅆ}}%   (U+2146)
+\newunicodechar{∊}{\text{\sffamily ∊}}%   (U+220A)
+\newunicodechar{⊻}{\text{\sffamily ⊻}}%   (U+22BB)
+\newunicodechar{⊼}{\text{\sffamily ⊼}}%   (U+22BC)
+\newunicodechar{⊽}{\text{\sffamily ⊽}}%   (U+22BD)
+\newunicodechar{⨂}{\text{\sffamily ⨂}}%   (U+2A02)
+% Those next two are not available in DejaVu Sans Bold,
+% we can find them in boldface in XITS or simply use \mdseries
+% Opting for the later here.
+\newunicodechar{┬}{\text{\sffamily\mdseries ┬}}%   (U+252C)
+\newunicodechar{┴}{\text{\sffamily\mdseries ┴}}%   (U+2534)
+% Next one (cross mark) is  used only once in sources (not in math mode).
+% Available in Emoji fonts such as Noto Emoji.
+% U+2715 is available in DejaVu Sans and DejaVu Sans Mono but not Serif
+\newunicodechar{❌}{\textcolor{red}{\sffamily\bfseries ✕}}% (U+274C --> U+2715)
+%
+% \IfFontExistsTF was added to fontspec at v2.5c 2017/01/02.
+% If it does not exist we take no risk.
+\makeatletter
+\ifdefined\IfFontExistsTF\else\let\IfFontExistsTF\@secondoftwo\fi
+\makeatother
+%
+%
+\IfFontExistsTF{NewCMMath-Regular.otf}
+ {%
+  \newfontfamily{\NCMMath}{NewCMMath-Regular}
+  % This one is available (on TeXLive 2024) only in New Computer Modern Math
+  % and OldStandard-Math.
+  \newunicodechar{⭯}{\text{\NCMMath ⭯}}%   (U+2B6F)
+  % Those next few are all available in New Computer Modern Math:
+  \newunicodechar{𝑅}{\text{\NCMMath 𝑅}}%   (U+1D445)
+  \newunicodechar{𝕀}{\text{\NCMMath 𝕀}}%   (U+1D540)
+  \newunicodechar{𝕌}{\text{\NCMMath 𝕌}}%   (U+1D54C)
+  \newunicodechar{𝟘}{\text{\NCMMath 𝟘}}%   (U+1D7D8)
+  \newunicodechar{𝟙}{\text{\NCMMath 𝟙}}%   (U+1D7D9)
+ }
+ {\AtEndDocument{\typeout{%
+    𝑅 and some like characters could not be rendered as^^J%
+    New Computer Modern Math font could not be found or fontspec^^J
+    package is too old (we need 2.5c 2017/01/02 or later).%
+    }%
+   }%
+ }%
+\IfFontExistsTF{HaranoAjiMincho-Regular.otf}
+ {%
+  % A few Asian ideograms:
+  \newfontfamily{\HaranoAjiMincho}{Harano Aji Mincho}
+  \newunicodechar{于}{\text{\HaranoAjiMincho 于}}%   (U+4E8E)
+  \newunicodechar{彭}{\text{\HaranoAjiMincho 彭}}%   (U+5F6D)
+  \newunicodechar{斌}{\text{\HaranoAjiMincho 斌}}%   (U+658C)
+ }
+ {\AtEndDocument{\typeout{%
+    于 and some like characters could not be rendered as^^J%
+    Harano Aji Mincho font could not be found or fontspec^^J
path: doc/src/conf.py
text: @author:
same here better with `^^J%`.
```suggestion
    Harano Aji Mincho font could not be found or fontspec^^J%
```