owickstrom / pandoc-include-code

A Pandoc filter for including code from source files
Mozilla Public License 2.0
141 stars 17 forks source link

Conflicting with pandoc-crossref #41

Closed Bergiu closed 3 years ago

Bergiu commented 3 years ago

What is the Problem? When i use include in a listing and convert the markdown to a pdf, the listing only has the listing style from pandoc-crossref, but it's empty: 2021-08-01_20-12

When i don't add #lst:example in the curly braces the style is missing, but is contains the code from the file: 2021-08-01_20-15

What has changed? I am using pandoc to convert my markdown files to a pdf. Until yesterday i have used old versions of pandoc but updated them now. Now pandoc-include-code doesn't work anymore. This is an old example: 2021-08-01_20-16

Minimum example: example.md:

~~~{#lst:example .py .long .numberLines caption="example.py" include=example.py}
~~~

example.py:

print("Hello World")

build: $ pandoc example.md --pdf-engine=latexmk --filter pandoc-crossref --filter pandoc-include-code -o example.pdf

Versions:

Bergiu commented 3 years ago

I solved it by switching the filters order: pandoc example.md --pdf-engine=latexmk --filter pandoc-include-code --filter pandoc-crossref -o example.pdf