I have a markdown with inline code with curly quotes and I use pandoc to generate a PDF.

The markdown is

Fancy Unicode quotes inlined `“”`.

The resulting latex is :

Fancy Unicode quotes inlined \lstinline!“”!.

xelatex fails to build the PDF.

Is it a normal behavior ?


First of all, thanks for you response. I should have mentioned that I am quite new with latex. I may write some wrong statement.

I use pandoc to convert my markdown into PDF with xelatex with the command pandoc FOO.md -o FOO.pdf --listings --latex-engine xelatex

I do not think listing does not handle unicode because the following markdown is working.


The corresponding latex is:



I just tried another test which let me think that this looks like a bug.

The following markdown example fails:

Inline code `“”`

Corresponding latex:

Inline code \lstinline!“”!


$ pandoc FOO.md -o FOO.pdf --listings --latex-engine xelatex
! File ended while scanning use of \lst@temp.
<inserted text>
<*> /tmp/tex2pdf.14686/input.tex

No pages of output.
Transcript written on /tmp/tex2pdf.14686/input.log.

pandoc: Error producing PDF

While the following markdown example succeeds:

Inline code `FOO=“”`

Corresponding latex:

Inline code \lstinline!FOO=“”!
  • 2
    What's the error you're getting? Can you provide a minimum working example of your file that you're feeding to xelatex?
    – Don Hosek
    Mar 12, 2020 at 15:39
  • 1
    As far as I know listings does not support unicode so it cannot handle those. If those are the only non-ascii you use, then you could add support for it manually using the literal feature, search the site for listings literal
    – daleif
    Mar 12, 2020 at 15:53

1 Answer 1


If you want to use chars outside the 0-255 range with listings you have to declare them first:

\makeatletter %for xelatex:
 \lst@CCECUse \lst@ProcessLetter
  ^^^^201c^^^^201d% quotes for xelatex
Fancy Unicode quotes inlined \lstinline!“”!.
  • Why not using literate? Thanks!
    – manooooh
    Mar 12, 2020 at 17:55
  • 1
    @manooooh presumably in this case it is assumed that xelatex is already using a font that covers the necessary fonts, so you just need the extra chars. Literate will map the char to larex symbol commands
    – daleif
    Mar 13, 2020 at 7:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .