1

I tried to set the font family to Source Sans Pro, but pandoc gives me the following error:

pdfTeX error (font expansion): auto expansion is only possible with scalable
fonts.
\AtBegShi@Output ...ipout \box \AtBeginShipoutBox

I have sourcesanspro installed via miktex console and set the yaml header as follows:

---
geometry: margin=2cm
papersize: a4paper
toc: true
fontenc: T1
fontfamily: sourcesanspro  
fontfamilyoptions: sfdefault
---

What am I doing wrong?

  • I guess your TeX installation lacks the CM-Super fonts. Are you using MiKTeX? – egreg Mar 23 at 16:44
  • Yes, I use miktex: I tried installing cm-super, but I could not see a difference. Maybe I was using the fontfamily etc, settings wrong. Could you provide an example how to do it correctly for cm-super? – AndiLeni Mar 23 at 16:51
  • I know nothing about Pandoc. – egreg Mar 23 at 17:14
  • You should mention the version of Pandoc you are using. – Khalid Hussain Apr 4 at 15:41
1

The sourcesanspro package uses an old version of the fonts; it's better to use the latest version of Source Sans Pro installed on your system, and use it directly with fontspec:

pandoc -o test.pdf --pdf-engine=lualatex << EOT

---
mainfont: Source Sans Pro
---

Lorem ipsum dolor sit amet

EOT
1

sfdefault is not an option provided by the sourcesanspro package.

Source Sans Pro options

My settings

  • Tex Live 2018
  • sourcesanspro v2.6 (Dec 3, 2016)
  • Pandoc v.2.7.1

Procedure

Content of input.md (T1 is the default option for fontenc):

---
geometry: margin=2cm
papersize: a4paper
toc: true
fontfamily: sourcesanspro
fontfamilyoptions: default
---

# Introduction

This is a sample sentence.

Command:

pandoc -t latex -o output.pdf input.md

Output:

Sample Output

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.