Wandmalfarbe / pandoc-latex-template

A pandoc LaTeX template to convert markdown files to PDF or LaTeX.
BSD 3-Clause "New" or "Revised" License
6.21k stars 968 forks source link

Specify fallback fonts for SourceSansPro #96

Open atbest opened 5 years ago

atbest commented 5 years ago

Currently, many greek letters are missing in italic and bold-italic SourceSansPro fonts, and many special characters are missing in SourceSansPro font as well. Please see the attached markdown and pdf files for the greek letters and sepcial characters. I am wondering if it is possible to specify a list of fallback fonts or at least one fallback font when these letters cannot be found in SourceSansPro font by any chance? Either a yaml file or cli parameter will be great. Thanks!

symbols.txt

symbols.pdf

Wandmalfarbe commented 5 years ago

You can change the used font with mainfont and sansfont when using --pdf-engine=xelatex:

---
author: Some Author
date: 2019-05-04
title: Font Test
mainfont: Arial
sansfont: Arial
---

font

Unfortunately the font is still missing some characters. There seems to be a way to support some kind of fallback:

  1. https://blog.michael.franzl.name/2014/12/10/xelatex-unicode-font-fallback-unsupported-characters/
  2. https://github.com/Pomax/ucharclasses/blob/master/ucharclasses.tex#L52

I'll have to research a bit if including this is worth it or has any implications.

atbest commented 5 years ago

I am still want to use Source Sans Pro as the main font if possible. Hopefully we can figure it out with ucharclasses.

noraj commented 5 years ago

https://github.com/Wandmalfarbe/pandoc-latex-template/blob/7eff8ff442c7de094afa8debf4e39bd380d92cd8/eisvogel.tex#L551-L561

I'm just getting

Error producing PDF.
! LaTeX Error: File `sourcesanspro.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 

l.196 \usepackage

Because on some distro the texlive font package is not install by default with the core texlive.

For fixing on ArchLinux see #121 .