Wandmalfarbe / pandoc-latex-template

A pandoc LaTeX template to convert markdown files to PDF or LaTeX.
BSD 3-Clause "New" or "Revised" License
6.09k stars 958 forks source link

Disable numbering in listings #44

Closed skymal4ik closed 6 years ago

skymal4ik commented 6 years ago

Would be great to have an option to have nice listings (including background color, syntax highlight, border, etc), but without line numbering, or have them in a separate column.

The problem is I have some Linux commands listed in those listings, and I wish just to copy them entirely. But they are selected and copied with numbers, so I cannot paste them into terminal directly.

Maybe just need to edit source a bit to disable them?

Thanks for amazing document tho, great job!

gpantanetti commented 6 years ago

A configuration switch would be preferable but, as a temporary workaround, you can disable numbering by editing the source template (approx line 580):

$if(listings)$
\lstdefinestyle{eisvogel_listing_style}{
  [...]
  % numbers          = left,
  [...]
  % xleftmargin      = 2.7em,
  [...]
  % framexleftmargin = 2.5em,

(Left margin parameters are commented-out too in order to bring code text near frame border)

Wandmalfarbe commented 6 years ago

Thank you @gpantanetti for the correct explanation. I want to integrate this feature in the near future but currently I don't have the time.

Wandmalfarbe commented 6 years ago

I've added the new option listings-disable-line-numbersto disable the line numbers.