1

I'm using the following command line to generate a *.pdf file from my *.md file:

pandoc --pdf-engine=xelatex file.md -o file.pdf

Everything works fine except when I copy-paste a code block from the generated *.pdf. It then loses its spaces/tabs and so the following if statement:

if (i<j)
{
    i=i+5;
}

becomes

if (i<j)
{
i=i+5;
}

Is there anyway around this?

  • Even for a simple markdown file with an alleged simple code block, please add a minimal working example (MWE), so we can reproduce exactly the problem. As is, your code produce reallyif (i<j) { i=i+5; } in a single line. Having to guess what really you could be doing does not help. – Fran Dec 25 '19 at 20:34
  • Not really feasible: https://tex.stackexchange.com/a/323354/29873 – DG' Feb 20 '20 at 21:25

0 Answers0