public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Joost Kremers <joostkremers-97jfqw80gc6171pxa8y+qA@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Cc: Terence Eden <terence.eden-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: Bug with fonts in subdirectory?
Date: Sun, 13 Nov 2022 16:32:21 +0100	[thread overview]
Message-ID: <87zgcuhnl8.fsf@fastmail.fm> (raw)
In-Reply-To: <62aceeb4-46d0-4079-9c5b-1be3dd5e2bben-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


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.
> <to be read again> 
>                    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


  parent reply	other threads:[~2022-11-13 15:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-13 13:55 Terence Eden
     [not found] ` <62aceeb4-46d0-4079-9c5b-1be3dd5e2bben-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-11-13 15:32   ` Joost Kremers [this message]
     [not found]     ` <87zgcuhnl8.fsf-97jfqw80gc6171pxa8y+qA@public.gmane.org>
2022-11-13 16:14       ` Terence Eden
     [not found]         ` <cd84e8c7-0bc4-4828-a090-12e7c679cf1fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-11-13 17:40           ` Bastien DUMONT
2022-11-13 19:29           ` Joost Kremers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgcuhnl8.fsf@fastmail.fm \
    --to=joostkremers-97jfqw80gc6171pxa8y+qa@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=terence.eden-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).