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

Backticks are not displayed in codeblocks. #21

Open chisui opened 6 years ago

chisui commented 6 years ago

If a codeblock contains Backticks, they are not displayed and pandoc outputs the following warning

[WARNING] Missing character: There is no ` in font SourceCodePro-Regular-tlf-ts1!

The issue can be reproduced with this example:

    expecting backtick here ->`<-

Compile with pandoc test.md -o test.pdf --template eisvogel --listings

byronwall commented 6 years ago

I ran into this same issue. If you need to just push out a PDF that has backticks in the code block, you can change the font family that is used. Change line 513 using sourcecodepro to inconsolata which is a close enough substitute.

https://github.com/Wandmalfarbe/pandoc-latex-template/blob/master/eisvogel.tex#L513

Couple of lines around the edit:

%
% Source Sans Pro as the de­fault font fam­ily
% Source Code Pro for monospace text
%
% 'default' option sets the default 
% font family to Source Sans Pro, not \sfdefault.
%
$if(mainfont)$
$else$
\usepackage[default]{sourcesanspro}
\usepackage{inconsolata}
$endif$
ConnorBaker commented 5 years ago

As an alternative solution, you can use xelatex:

pandoc test.md -o test.pdf --template eisvogel --listings --pdf-engine xelatex