Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text containing table flows beyond bottom page margin when figure floats to next page #8526

Open
chromevanadium opened this issue Jan 5, 2023 · 4 comments

Comments

@chromevanadium
Copy link

Explain the problem.

Text that includes a table continues beyond the bottom margin when a figure is floated to the next page.

Steps to reproduce the issue

  1. Create a document containing multiple paragraphs.

  2. Insert a figure before the last paragraph of the first page. Insert two more paragraphs, then a simple table, then plenty more paragraphs

  3. Render the document. If the figure still renders on the same page, add a little paragraph before such that the figure does not anymore fit, and render again.

Expected behavior: Once the figure was floated to the next page, the continuing text (that includes the table) should flow until the bottom margin.

Observed behavior: The continuing text renders beyond the bottom margin to the bottom of the page.

Remark: This appears to be caused by the markdown table. If it is removed, or replaced by another figure, text continues to flow correctly.

Included are a sample markdown file and a small sample graphic with which the issue can be reproduced.

Pandoc version?

andoc 2.14.0.3
Compiled with pandoc-types 1.22.1, texmath 0.12.3.3, skylighting 0.10.5.2,
citeproc 0.4.0.1, ipynb 0.1.0.1

layoutissue.md (7 kb)
testgraphic.png (12 kb)

@jgm
Copy link
Owner

jgm commented Jan 5, 2023

I can confirm this with latest pandoc. You can see how the text extends below the margin:

Screen Shot 2023-01-05 at 10 09 39 AM

@jgm
Copy link
Owner

jgm commented Jan 5, 2023

I suspect this is a longtable (LaTeX) issue and not something we can fix in pandoc.
longtable used to have a bug that caused text to spill over the page; this was fixed in recent versions, but there may be similar issues still.

@chromevanadium
Copy link
Author

chromevanadium commented Jan 7, 2023

Indeed, it looks like this. I can even reproduce the issue with the most simple tex document possible, see attachment. One can therefore argue that pandoc, for the time being, should probably revert to the Latex \table environment to render out to PDF. This issue breaks automated formatting.

testgraphic
layoutissue.txt

@jgm
Copy link
Owner

jgm commented Jan 7, 2023

We can't use regular table because it doesn't work for larger tables.
It's a vexing issue which has come up many times.
Related: #782, #1023, #4392

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

No branches or pull requests

3 participants