Closed Skeeve closed 1 year ago
PDF export is using pandoc, which is using LaTeX under the hood. There, not all normally installed fonts are supported. See https://pandoc.org/MANUAL.html#fonts
Okay. But I have a font which works with pandoc on another machine, but I do not use panwriter there. So what would be the correct syntax to tell pandoc from panwriter where the fontfile resides?
I already tried the full path to the font file but I did not succeed.
I checked as described here: https://fedidat.com/160-installing-fonts-for-pandoc/
and I can see: My font is installed.
Update:
pandoc -f markdown --pdf-engine=xelatex --to pdf -o Untitled.pdf Untitled.md
This works with my intended font "Avenir Next"
but when I define in the document or defaults.yaml
papersize: A4
mainfont: Avenir Next
output:
latex:
toc: true
pdf-engine: xelatex
panWriter fails
Called: pandoc --metadata-file '/Users/skeeve/Library/Application Support/PanWriterUserData/default.yaml' --toc --pdf-engine xelatex --metadata 'mainfont=-apple-system, BlinkMacSystemFont, Segoe UI, sans-serif' --metadata monobackgroundcolor=#f0f0f0 --output /Users/skeeve/Desktop/Untitled.pdf --to latex --standalone
Error producing PDF.
! Package fontspec Error: The font "-apple-system, BlinkMacSystemFont, Segoe
(fontspec) UI, sans-serif" cannot be found.
For immediate help type H <return>.
...
l.24 \fi
Update: mainfont
works if
a) You put it into the document, not in the defaults.yaml
b) You use xelatex as the pdf-engine
Would, maybe, this solve the issue?
if (docMeta.mainfont === undefined) {
out.metadata.mainfont = extMeta.mainfont || '-apple-system, BlinkMacSystemFont, Segoe UI, sans-serif';
}
Yes, it does. Please see PR #134
Will be fixed when PR #134 is merged.
I put into my document:
and. in split mode I can see the font change.
But when exporting to PDF, the font is ignored.
Are there any troubleshooting tips?
I'm using