pandoc-crossref icon indicating copy to clipboard operation
pandoc-crossref copied to clipboard

Table ref points to wrong page if the table is on the top of the page

Open r0polach opened this issue 4 years ago • 1 comments

Table reference points to wrong page (the page before the correct page) if the table is on the top of the page.

Steps to reproduce:

pandoc -o tab_ref_example.pdf -f markdown -F pandoc-crossref tab_ref_example.md

(As tab_ref_example.md use the attached file.) tab_ref_example.md

Current behavior: The second reference (number "2") points to page 1.

Expected behavior: The second reference (number "2") should point to page 2.

The result pdf is also attached... tab_ref_example.pdf

r0polach avatar Apr 16 '21 13:04 r0polach

Neither pandoc-crossref nor pandoc have any idea what a "page" even is to begin with, so this is purely a LaTeX issue. Now with longtables this is apparently the way the cookie crumbles: the longtable starts at the end of the page, and its contents get shoved to the next page, while every anchor remains on the current one. I couldn't figure out a way to fix this in general. Adding a manual \pagebreak just before the table works, but it's a very brittle solution obviously. I'm attaching a Markdown file that manifests this behaviour without pandoc-crossref:

tab_ref_example.md

Feel free to use it if you decide to raise this issue on the pandoc repo.

lierdakil avatar Apr 16 '21 15:04 lierdakil