Comments (6)
I applied @n-peugnet advice and this works at my locale
latex_engine = 'lualatex'
latex_theme = 'howto'
latex_elements = {
"preamble": r"""
\directlua {
luaotfload.add_fallback("emoji",
{
"[TwemojiMozilla.ttf]:mode=harf;",
"[DejaVuSans.ttf]:mode=harf;",
}
)
}
\setmainfont{LatinModernRoman}[RawFeature={fallback=emoji},SmallCapsFont={* Caps}]
\setsansfont{LatinModernSans}[RawFeature={fallback=emoji}]
\setmonofont{DejaVuSansMono}[RawFeature={fallback=emoji},Scale=0.8]
""",
}
produces
from sphinx.
I changed the type of this ticket to question
because it does not seem to be related to a bug in Sphinx LaTeX support, except if one considers support for color emojis should be built-in, on which topic I don't have myself any strong opinion!
from sphinx.
Using #12195 n-peugnet solution I go it (almost) working:
Change latex_elements
in conf.py
:
latex_elements = {"preamble": r"""
\directlua{ luaotfload.add_fallback("emoji", {"[TwemojiMozilla.ttf]:mode=harf"}) }
\setmainfont{LatinModernRoman}[RawFeature={fallback=emoji},SmallCapsFont={* Caps}]
\setsansfont{LatinModernSans}[RawFeature={fallback=emoji}]
\setmonofont{DejaVuSansMono}[RawFeature={fallback=emoji},Scale=0.8]
""" }
content, titles and code Colors emoji in PDF !
But ⣿ character missing, in content, code and titles ;(
$ grep Missi _build/latex/test_emoj.log
Missing character: There is no ⣿ (U+28FF) in font LatinModernRoman/B:mode=harf
Missing character: There is no ⣿ (U+28FF) in font LatinModernSans/B:mode=harf;
Missing character: There is no ⣿ (U+28FF) in font LatinModernRoman:mode=harf;s
Missing character: There is no ⣿ (U+28FF) in font DejaVuSansMono:mode=harf;scr
Missing character: There is no ⣿ (U+28FF) in font DejaVuSansMono:mode=harf;scr
Missing character: There is no ⣿ (U+28FF) in font DejaVuSansMono:mode=harf;scr
Missing character: There is no ⣿ (U+28FF) in font DejaVuSansMono:mode=harf;scr
$
How to have both hammer 🔨 and ⣿ (U+28FF) in the final PDF ?
from sphinx.
You can provide a chain of fallback fonts in add_fallback
. I didn't test myself but check the description of the function in luaotfload's documentation.
I guess you could add some Noto symbolic font (or Symbola) to the chain.
from sphinx.
Yes working like a charm !
from sphinx.
As I stumbled across this issue:
For other unicode characters like greek letters, it is enough to add \usepackage{commonunicode}
to the preamble in the latex_elements config in the sphinx conf.py:
latex_elements = {
'preamble': r"""
\usepackage{commonunicode}
""",
}
from sphinx.
Related Issues (20)
- LaTeX/ImageConverter: Regression with `data:` URIs HOT 1
- Should `defusedxml` be moved to the runtime dependencies? HOT 5
- When compiling linux kernel(drm-tis), failed at module `docutils.nodes` for no attribute ‘reprunicode’ HOT 11
- sphinx-build hard-codes the python path into the exe HOT 7
- ext.napoleon to work with ext.todo HOT 2
- `:loading: embed` on images does not work as expected HOT 7
- ``todo`` directive treat repeated special characters as headers
- toc_object_entries uses language (Python) scoping instead of documentation scoping HOT 2
- TOWER_HOST=https://awx.example.org TOWER_USERNAME=example TOWER_PASSWORD=secret make clean html HOT 1
- Index pages use `–` but it can not be used in ePub HOT 3
- Intersphinx Mapping link not working with Plotly objects in signature HOT 4
- Internationalization doc mentions deprecated transifex-client HOT 1
- 7.3.7: missing `defusedxml` install time dependency HOT 2
- THYDUX COIN 𝕏 🥏
- Multiple labels inside math directives HOT 1
- LaTeX: footnote mark may indicate "Page N, M" but footnote M is already on page N
- Gettext builder cannot extract 'option' directive HOT 3
- `autodoc_class_signature = "separated"` cause a warning for enum with no `__init__` HOT 12
- [search] issues with the new HTML search algorithm HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinx.