lierdakil / pandoc-crossref

Pandoc filter for cross-references
https://lierdakil.github.io/pandoc-crossref/
GNU General Public License v2.0
936 stars 74 forks source link

Use htbp float position for codelisting #422

Closed S3basuchian closed 8 months ago

S3basuchian commented 8 months ago

Such that the codelisting uses the same position as the other floats

lierdakil commented 8 months ago

Thanks for the PR!

Now, the choice of h positioning for listings was informed by how pandoc handles its native listings, which are typeset in-place, so this was done for consistency with vanilla pandoc. pandoc -F pandoc-crossref -Mlistings --listings will instead use listings package, which are typeset as other floats IIRC.

You can always reset the default by adding something to the tune of \AtEndPreamble{\floatplacement{codelisting}{htbp}} to the preamble via header-includes.

There's an argument for making this more easily configurable, I'll accept a PR adding a configuration option for this, with the default still being h. However, changing the placement at this point will break backwards compatibility, so I'm not inclined to merge it as is.

S3basuchian commented 8 months ago

Thank you for your response! I must confess, that I did not know about the \AtEndPreamble command, but this solves my issues!