From 909c50a4d04b0f0b65b90474986241e68fb29270 Mon Sep 17 00:00:00 2001 From: tiyn Date: Sun, 16 Nov 2025 10:04:32 +0100 Subject: [PATCH] nvim: stars display correctly after pandoc compile --- .config/nvim/lua/plugins/knap.lua | 2 +- .config/nvim/lua/resources/header.tex | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .config/nvim/lua/resources/header.tex diff --git a/.config/nvim/lua/plugins/knap.lua b/.config/nvim/lua/plugins/knap.lua index 7c32913..6b24803 100644 --- a/.config/nvim/lua/plugins/knap.lua +++ b/.config/nvim/lua/plugins/knap.lua @@ -15,7 +15,7 @@ return { textopdfforwardjump = "zathura --synctex-forward=%line%:%column%:%srcfile% %outputfile%", -- markdown mdoutputext = "pdf", - mdtopdf = "pandoc %docroot% -H ~/.config/nvim/lua/resources/header.tex --toc --toc-depth=5 -V colorlinks=true -V linkcolor=blue -V urlcolor=red -V toccolor=gray -o %outputfile%", + mdtopdf = "pandoc %docroot% --pdf-engine=xelatex -H ~/.config/nvim/lua/resources/header.tex --toc --toc-depth=5 -V colorlinks=true -V linkcolor=blue -V urlcolor=red -V toccolor=gray -o %outputfile%", mdtopdfviewerlaunch = "zathura ./%outputfile%", mdtohtml = "pandoc --standalone %docroot% -o %outputfile%", mdtohtmlviewerlaunch = "firefox --kiosk --new-window %outputfile%", diff --git a/.config/nvim/lua/resources/header.tex b/.config/nvim/lua/resources/header.tex new file mode 100644 index 0000000..63e5b9a --- /dev/null +++ b/.config/nvim/lua/resources/header.tex @@ -0,0 +1,13 @@ +% \usepackage[utf8]{inputenc} +% \DeclareUnicodeCharacter{2605}{\ensuremath{\star}} +% +\usepackage{fontspec} +\usepackage{newunicodechar} + +\newfontfamily\symbolafont{Symbola} + +% U+2605 BLACK STAR +\newunicodechar{★}{{\symbolafont ★}} + +% U+2606 WHITE STAR +\newunicodechar{☆}{{\symbolafont ☆}}