pandoc_remove_codelisting_filter is the filter in order to render code blocks into multiple pages of a PDF file. If using pandoc and pandoc-crossref, perhaps code blocks go out of pages due to codelisting
commands in a LaTeX file. Therefore the filter replaces codelisting
commands with lstlisting
commands.
- Python 3.8
- pandocfilters
You can install executable pandoc_remove_codelisting_filter
via pip.
$ pip install git+https://github.com/Kenta11/pandoc_remove_codelisting_filter
Set pandoc_remove_codelisting_filter
in an argument --filter
. You must set the filter after pandoc-crossref
.
$ pandoc sample.md -o sample.pdf --filter=pandoc-crossref --filter=pandoc_remove_codelisting_filter
If LaTeX commands require listings package, add the following YAML block in your markdown file.
---
header-includes:
- \usepackage{listings}
---
Refer tutorial.
- Author: Kenta Arai
- Twitter: @isKenta14