Skip to content

LaTeX: Repeat caption of a table consistently. - #4623

Open
wilx wants to merge 1 commit into
jgm:mainfrom
wilx:master-tables-repeat-caption
Open

LaTeX: Repeat caption of a table consistently.#4623
wilx wants to merge 1 commit into
jgm:mainfrom
wilx:master-tables-repeat-caption

Conversation

@wilx

@wilx wilx commented May 3, 2018

Copy link
Copy Markdown
Contributor

This fixes #4558.

Add a repeat-caption table class that repeats captions on each page of a
longtable without adding duplicate list-of-tables entries. Preserve the
existing non-repeating default and ignore the class for floating tables.

Fixes jgm#4558.
@wilx
wilx force-pushed the master-tables-repeat-caption branch from 63d334d to a327a2a Compare August 30, 2026 17:13
Comment thread src/Text/Pandoc/Writers/LaTeX/Table.hs Outdated
Comment on lines +196 to +216
else [ foot'
else (if hasBottomCaption && not (isEmpty repeatedCapt)
then [ repeatedFoot, "\\endfoot" ]
else []) <>
[ foot'
, "\\endlastfoot"
, vcat rows'
, vcat rows'

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repeated head is already incorporated in head', whereas the repeated foot isn't already incorporated in foot', and hence needs adding here. To me, this makes the logic less clear. It would be better to do it the same way in both places.

Note also that lns 211-13 could be simplified using guards:

[repeatedFoot, "\\endfoot" | hasBottomCaption && not (isEmpty repeatedCapt)]

Comment thread src/Text/Pandoc/Writers/LaTeX/Table.hs Outdated
Comment on lines +196 to +216
else [ foot'
else (if hasBottomCaption && not (isEmpty repeatedCapt)
then [ repeatedFoot, "\\endfoot" ]
else []) <>
[ foot'
, "\\endlastfoot"
, vcat rows'
, vcat rows'

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repeated head is already incorporated in head', whereas the repeated foot isn't already incorporated in foot', and hence needs adding here. To me, this makes the logic less clear. It would be better to do it the same way in both places.

Note also that lns 211-13 could be simplified using guards:

[repeatedFoot, "\\endfoot" | hasBottomCaption && not (isEmpty repeatedCapt)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

caption for table with header is not repeated on pagebreak in latex output

2 participants