Thank you, that's helpful. I can use the fonts which are installed. But, weirdly, I can use a TTF which is *not* installed as long as the file is in the same directory as the input file. I'll go look through the XeLaTeX documentation. Thanks once again. On Sunday, 13 November 2022 at 15:38:04 UTC Joost wrote: > > On Sun, Nov 13 2022, Terence Eden wrote: > > I am trying to convert a .md file to a .pdf using a specific TTF font. > > Pandoc doesn't work unless the .ttf is in the same directory as the .md > > file. Is that normal? > > > > This works: > > pandoc in.md --pdf-engine=xelatex -V mainfont="font.ttf" -o test.pdf > > > > I get a PDF in my specific font. > > > > But this fails: > > pandoc in.md --pdf-engine=xelatex -V mainfont="fonts/fontname/font.ttf" > -o > > test.pdf > > > > It gives the error: > > > > Error producing PDF. > > ! Missing number, treated as zero. > > > > f > > l.19 \fi > > > > I know Pandoc can read the directory, because if I try to use a .ttf > which > > doesn't exist, I get the error "! Package fontspec Error: The font > > "fonts/foo/bar" cannot be found." > > > > Is this a bug, or me not understanding how to use Pandoc properly (a > > distinct possibility!) > > The mainfont variable is not a Pandoc option but something that's passed > to the > fontspec package used by XeLaTeX. It doesn't take a font file as value, > but a > font name. > > For it to work, you need to make sure that XeLaTeX can find the font. As > far as > I know, this means that the font must be installed on your system. If > that's OK > for you, you can simply double-click the ttf file in your file manager and > your > system should install the font automatically, or open it in a application > that > will allow you to install it. > > If you do not wish to install the font, you'll need to figure out if > XeLaTeX can > be taught to use fonts from fonts file that aren't installed. I don't know > if > that's possible. > > > -- > Joost Kremers > Life has its moments > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/cd84e8c7-0bc4-4828-a090-12e7c679cf1fn%40googlegroups.com.