You are not logged in.

#1 2026-03-31 19:13:54

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,873

[Solved] pandoc md to pdf - latex Unicode char not set up correctly

I'm trying to convert advice.md to pdf .

pandoc, texlive-latexextra and texlive-fontsrecommended are installed.

$ pandoc advice.md -o advice.pdf
Error producing PDF.
! LaTeX Error: Unicode character ■ (U+25A0)
               not set up for use with LaTeX.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.95 ■
$ 
$ file advice.md 
advice.md: Unicode text, UTF-8 text, with very long lines (603)
$ file -i advice.md 
advice.md: text/plain; charset=utf-8
$ 

search results all seem to advise removing the problem character as "solution" which is not my intention.
Any idea how to fix this ?

Last edited by Lone_Wolf (Yesterday 21:44:10)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#2 2026-03-31 20:17:31

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,100

Re: [Solved] pandoc md to pdf - latex Unicode char not set up correctly

Most likely a font issue, https://tex.stackexchange.com/questions … ith-pandoc

fc-match -s :charset=25a0

Offline

#3 Yesterday 21:19:15

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,873

Re: [Solved] pandoc md to pdf - latex Unicode char not set up correctly

$ fc-match -s :charset=25a0
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSans-Bold.ttf: "DejaVu Sans" "Bold"
DejaVuSans-Oblique.ttf: "DejaVu Sans" "Oblique"
DejaVuSans-BoldOblique.ttf: "DejaVu Sans" "Bold Oblique"
AdwaitaMono-Regular.ttf: "Adwaita Mono" "Regular"
DejaVuMathTeXGyre.ttf: "DejaVu Math TeX Gyre" "Regular"
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
DejaVuSerif.ttf: "DejaVu Serif" "Book"
JetBrainsMonoNLNerdFont-Regular.ttf: "JetBrainsMonoNL Nerd Font" "Regular"
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
DejaVuSerif-Italic.ttf: "DejaVu Serif" "Italic"
ter-u12n.otb: "Terminus" "Regular"
7x13.pcf.gz: "Misc Fixed" "Regular"
8x13.pcf.gz: "Misc Fixed" "Regular"
ter-x12n.pcf.gz: "xos4 Terminus" "Regular"
12x13ja.pcf.gz: "Misc Fixed Wide" "ja"
6x12.pcf.gz: "Misc Fixed" "SemiCondensed"
6x13.pcf.gz: "Misc Fixed" "SemiCondensed"
9x15.pcf.gz: "Misc Fixed" "Regular"
cu12.pcf.gz: "MUTT ClearlyU Wide" "Regular"
18x18ja.pcf.gz: "Misc Fixed Wide" "ja"
10x20.pcf.gz: "Misc Fixed" "Regular"
AdwaitaSans-Regular.ttf: "Adwaita Sans" "Regular"
SyrCOMAdiabene.otf: "East Syriac Adiabene" "Regular"
SyrCOMKharput.otf: "Serto Kharput" "Regular"
clR6x13.pcf.gz: "Schumacher Clean" "Regular"
cu-alt12.pcf.gz: "MUTT ClearlyU Alternate Glyphs Wide" "Regular"
cu-pua12.pcf.gz: "MUTT ClearlyU PUA" "Regular"
$ 
$ pandoc advice.md --pdf-engine=xelatex -V 'mainfont:DejaVuSerif.ttf' -V 'sansfont:DejaVuSans.ttf' -V 'monofont:DejaVuSansMono.ttf' -o advice.pdf

kpathsea: Running mktexfmt xelatex.fmt
mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order):
mktexfmt:   /etc/texmf/web2c/fmtutil.cnf
mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes:
mktexfmt:   /home/panoramix/.texlive/texmf-config/web2c/fmtutil.cnf
mktexfmt [INFO]: writing formats under /home/panoramix/.texlive/texmf-var/web2c
mktexfmt [INFO]: Did not find entry for byfmt=xelatex skipped
mktexfmt [INFO]: not selected formats: 17
mktexfmt [INFO]: total formats: 17
mktexfmt [INFO]: executable location: /usr/bin/mktexfmt
mktexfmt [INFO]: exiting with status 0
Error producing PDF.
This is XeTeX, Version 3.141592653-2.6-0.999998 (TeX Live 2026/Arch Linux) (preloaded format=xelatex)
 restricted \write18 enabled.
I can't find the format file `xelatex.fmt'!

xelatex.fmt is not found in any arch repo package.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#4 Yesterday 21:26:59

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,100

Re: [Solved] pandoc md to pdf - latex Unicode char not set up correctly

https://archlinux.org/packages/extra/any/texlive-xetex/ but from the pandoc dependencies I assume it provides lualatex?

Offline

#5 Yesterday 21:43:12

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,873

Re: [Solved] pandoc md to pdf - latex Unicode char not set up correctly

$ sudo pacman -S --asdeps pandoc-cli texlive-xetex texlive-fontsextra texlive-fontsrecommended texlive-latexrecommended
$ pandoc advice.md --pdf-engine=xelatex -V 'mainfont:DejaVuSerif.ttf' -V 'sansfont:DejaVuSans.ttf' -V 'monofont:DejaVuSansMono.ttf' -o advice.pdf
$ 

I had to install 200+ packages totalling about 2.6 Gib to make the conversion succeed.

Guess I'll be using okular to view .md files (and sqriptor to edit them) instead of converting to pdf .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#6 Yesterday 21:51:11

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,100

Offline

#7 Today 09:19:57

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,873

Re: [Solved] pandoc md to pdf - latex Unicode char not set up correctly

weasyprint is able to convert it but does seem to use an incorrect (too large) fontsize which messes up page breaks.

(I compared with the original pdf from 2018 that is supposed to have been created as pdf, not converted from something)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#8 Today 11:47:46

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 74,100

Re: [Solved] pandoc md to pdf - latex Unicode char not set up correctly

Does it ignore the html stylesheet or do you just need to control fonts when generating the html?

Offline

Board footer

Powered by FluxBB