pandoc-latex-template icon indicating copy to clipboard operation
pandoc-latex-template copied to clipboard

Backticks are not displayed in codeblocks.

Open chisui opened this issue 6 years ago • 2 comments

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

chisui avatar Nov 13 '17 20:11 chisui

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$

byronwall avatar Aug 22 '18 20:08 byronwall

As an alternative solution, you can use xelatex:

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

ConnorBaker avatar Mar 29 '19 21:03 ConnorBaker