I have seen How do I fix "missing character" warnings when converting from docx to pdf using Pandoc and LaTeX? - but unfortunately, the advice there does not seem to apply to this test case:
$ git clone https://github.com/raspberrypi/documentation.git
$ cd documentation/configuration
$ pandoc *.md --pdf-engine=xelatex -o result.pdf
[WARNING] Missing character: There is no ┌ (U+250C) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ─ (U+2500) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ─ (U+2500) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ─ (U+2500) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ─ (U+2500) in font [lmmono10-regular]:!
...
[WARNING] Missing character: There is no ─ (U+2500) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ─ (U+2500) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ┘ (U+2518) in font [lmmono10-regular]:!
So, there are some specific "box drawing" glyphs, missing from Latin Modern Mono - so probably they are used in a context of code snippets.
Is there a way to provide a "fallback font" in this case? Or how could I solve this otherwise, so I can produce a (Latex) PDF from these markdown files via pandoc?
EDIT: found:
- https://tex.stackexchange.com/questions/512396/inserting-any-unicode-character-in-latex-document
- https://tex.stackexchange.com/questions/139139/adding-headers-and-footers-using-pandoc
... so I tried:
header-includes.yaml
:
---
header-includes: |
\usepackage{combofont}
\setupcombofont{multiscript-regular}
{
{file:lmsans10-regular.otf:\combodefaultfeat} at #1pt,
{file:DejaVuSans.ttf} at #1pt,
{file:NotoSansCJK-Regular.ttc(0)} at #1pt
}
{
{} ,
fallback,
fallback
}
\DeclareFontFamily{TU}{multiscript}{}
\DeclareFontShape {TU}{multiscript}{m}{n} {<->combo*multiscript-regular}{}
\fontfamily{multiscript}\selectfont
...
... and then I tried (note, using just single file from the repo, raspi-config.md
, here):
$ pandoc header-includes.yaml ./raspi-config.md --pdf-engine=lualatex -o result.pdf
Error producing PDF.
! Paragraph ended before \setupcombofont was complete.
<to be read again>
\par
l.61
... so, cannot get this approach to work, either ...
-
before each command and avoid line breaks inside the commands – Devitexlive
, but I couldn't find it ... So I looked into compiling it myself, but it's in Kotlin, needsgradlew
to build, and I'm not really a Java guy, so cannot do that either. Otherwise, I use the Python approach listed in jdhao.github.io/2018/04/08/matplotlib-unicode-character – Vibrato