Zulip Chat Archive
Stream: new members
Topic: Markdown with unicode math -> pdf
Jeremy Teitelbaum (Dec 17 2021 at 15:33):
I typically use pandoc to convert markdown files to pdf for formatting/printing. But the lean world is full of unicode characters. Any tips on getting pandoc to handle those appropriately, or is there an alternative?
Arthur Paulino (Dec 17 2021 at 15:35):
(Blind shot) Maybe try converting to html first and then use something more robust to convert from html to pdf. This wouldn't be an elegant solution though.
Mauricio Collares (Dec 17 2021 at 15:43):
https://stackoverflow.com/questions/18178084/pandoc-and-foreign-characters recommends using pandoc --pdf-engine=xelatex
. Sounds like a good thing to try, since XeLaTeX can render unicode characters.
Jeremy Teitelbaum (Dec 17 2021 at 15:50):
Unfortunately adding the --pdf-engine=xelatex
doesn't help. I've looked around on stackexchange and it 's clear that the issue is access to the appropriate fonts, but I have been unable to assemble a solution from the various pieces I've found. Here's what happens:
~/GitHub/formalising-mathematics master !2 ?3 > pandoc --pdf-engine=xelatex -o cheatsheet.pdf cheatsheet.md
[WARNING] Missing character: There is no ∀ (U+2200) in font [lmroman10-regular]:mapping=tex-text;!
[WARNING] Missing character: There is no ∈ (U+2208) in font [lmroman10-regular]:mapping=tex-text;!
[WARNING] Missing character: There is no ∀ (U+2200) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ∈ (U+2208) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ⟺ (U+27FA) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ∨ (U+2228) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ∨ (U+2228) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ∧ (U+2227) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ∃ (U+2203) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ∃ (U+2203) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ∨ (U+2228) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ∨ (U+2228) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ∨ (U+2228) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ∃ (U+2203) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ∧ (U+2227) in font [lmmono10-regular]:!
[WARNING] Missing character: There is no ⟺ (U+27FA) in font [lmmono10-regular]:!
Mauricio Collares (Dec 17 2021 at 16:09):
I don't know the full command you executed so I can't be sure this is going to work, but try passing -V monofont='DejaVu Sans Mono'
(or another appropriate monospace font) to pandoc. There are other font variables at https://pandoc.org/MANUAL.html#fonts which may be useful too; the other big one is mainfont
.
Last updated: Dec 20 2023 at 11:08 UTC