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

Missing values and blank pages when adjusting prose_margin_bottom alongside a for table column type #1369

Closed
myii opened this issue Nov 5, 2019 · 3 comments
Assignees
Labels
Milestone

Comments

@myii
Copy link

myii commented Nov 5, 2019

Related issue

May be related to #926.

Asciidoctor file

= Bug: Using `a` for table column type

.Content is not displayed *and* results in blank page(s)
[format="psv", cols="a"]
|===
|
* abc
|===

Theme

---
extends: default
base:
  font_family: M+ 1mn
  ### For testing with `prose_margin_bottom: 0`
  # line_height: 1
prose:
  ### Can get this working with `base_line_height: 1` but with an extra blank page
  # margin_bottom: 0

  ### Content isn't displayed with the default value of `base_line_height`
  # margin_bottom: 1
  margin_bottom: 2

  ### Content is displayed but an extra blank page is still produced
  # margin_bottom: 3
  # margin_bottom: 4
  # margin_bottom: 5

  ### Lowest value that works without issues using the default `base_line_height`
  # margin_bottom: 6
  • Another important factor is the font_family that it used; some are affected more adversely than others.

Command

$ asciidoctor-pdf -a pdf-theme=bug_using-type-a-for-table-column.yml bug_using-type-a-for-table-column.adoc

Result

screenshot103

Workaround

Adjust prose_margin_bottom until a suitable value is found where the content is displayed and no extra page is produced.

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Nov 8, 2019
@mojavelinux
Copy link
Member

This turns out to be two separate bugs. First, prawn-table has some rounding errors that cause it to not reserve enough height for the cell. When that happens, the remainder gets thrown onto the next page. Basically, it's just haywire.

The second problem is that our blank page cleanup routine assumes the cursor is on the last page. There are cases, like this one, when it is not. So that requires an additional check.

@mojavelinux
Copy link
Member

Thanks for the detailed error report!

@mojavelinux mojavelinux self-assigned this Nov 8, 2019
@mojavelinux mojavelinux added the bug label Nov 8, 2019
@mojavelinux mojavelinux added this to the v1.5.0 milestone Nov 8, 2019
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Nov 8, 2019
@myii
Copy link
Author

myii commented Nov 8, 2019

As mentioned when discussing the commit, this issue appears to be resolved now.

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

No branches or pull requests

2 participants