Leanpub Header

Skip to main content
All forums

Leanpub Author Forum

Community discussions

Image vertical spacing increased

Gregor Hohpe8/11/2026
Questions

I had not regenerated Platform Strategy in a while, but I fixed a few typos and references. When generating a print-ready PDF, I found that picture vertical spacing has substantially increased. I agree that it looks better, but it causes page breaks to reset, which'd be a lot of work to fix. I set the Figure Vertical Margin to 0 , but it's still bigger than before. Is there a way to have the original narrow margins back for compatibility?


I attached old and new pictures.


8 replies

Hi Gregor,


We'll look into this for you. Typically, when we make these changes, we try to do things in a way that does not affect existing books, so that we don't cause work, because of this exact situation.

So, this is an oversight on our part that we did it this way.

Can you do me a favour and email your old PDF to me at peter@leanpub.com so I can have it for reference so I know the exact spacing that you're going for? Obviously, we can figure out from the code what it used to do, but it will be a good confirmation as a sanity check that our output is correct.

Thanks, and sorry,
Peter

Gregor Hohpe8/12/2026

Thank you! With a setting of 0 it's close enough for my purpose, so not super urgent, but I'll send the PDFs for you to see. It may be a compound effect of image plus heading above / below

Replying to @ghohpe

@ghohpe we (Fable and I) found the bug last night btw (before you sent the PDF actually) ... it was around equalize spacing being set to true when it should have been unaffected. The fix is deploying right now; it should be live in about 30 minutes. After it's live, I'll fix the setting on your book and trigger a preview, then follow up here.

We have a /pr-prep Claude Code skill which does a bunch of stuff; one of those things is writing a good explanation, including an ELI5 summary at the top. I'm pasting that here (along with its teddy bear emoji πŸ˜†) along with part of the actual full technical explanation that it wrote...

🧸 Explain like I'm 5

Authors have a settings page with a light switch on it. 🎚️ The switch looked like it worked, but the form behind it could only ever hear "yes" - even when the switch said "no", the form heard "yes". So every time an author saved that page for any reason, the switch got silently flipped on, and it could never be turned off again. That switch changes how much breathing room pictures get in a book's PDF, so books quietly got airier pages and their page breaks moved, with no setting that could undo it. Now the form actually hears "no" when the switch says no, and the switch works in both directions. πŸ”§

What was wrong

equalizeFigureSpacing on Theme > Lists and Figures (book route) is driven by an RSwitch whose state is submitted via <RHidden name="equalizeFigureSpacing" value={String(equalizeFigureSpacing)} /> - the literal strings "true"/"false". The action schema parsed it with z.coerce.boolean(), and Boolean("false") === true, so every save of the page force-enabled equalize_figure_spacing regardless of the switch position, and the switch could never turn it off (a one-way latch). Shipped 2025-12-12 in ad8dedd1f6.

User-facing impact: on markuaspec books the flip silently moves figure rendering onto the newer equalized-spacing model - roomier vertical glue around every figure, and the legacy Figure Vertical Margin setting becomes a no-op. Reported by Gregor Hohpe ("Platform Strategy"): his regenerated print-ready PDF gained substantial space around every image vs. his 2024-11-23 build, resetting his hand-tuned page breaks, and setting Figure Vertical Margin to 0 did nothing (the equalize path ignores it). The legacy pandoc figure path was verified byte-identical since Nov 2024 - the entire delta is this theme flag.

Note: the deploy is about 20 minutes from being live, so any changes won't show up if you preview right now.

Hi again Gregor,

This is the combination of two settings I changed, halfway down in Lists and Figures of Theme.

This is the behaviour now.

So, it looks like this combination of "Give all figures equal spacing" being OFF and setting the Figure Vertical Margin to 0 will get you what you had before.

If this is not the case please let me know, and we'll look into this more when my team is back online in about 4-5 hours (we're on Pacific Time).

Sorry again about this bug; I hope this resolves it for you. I'll follow up about the other issues on the other threads later today...

Thanks,
Peter

Gregor Hohpe8/12/2026

It's definitely close enough. Thanks for the quick turnaround. Now I have another funny one. with tables. In the PDF format (eBook, not print-ready), tables now overlap with text. I do have the 0pt image spacing set, could that be the culprit? It's very 0 spacing :-)



Gregor Hohpe8/12/2026

Replying to @ghohpe

Quick update. Setting the image spacing to 2 appears to fix the table spacing. while keeping image spacing reasonable.

Replying to @ghohpe

@ghohpe we now have separate settings for the space around tables and the space around other types of resources, so you can have the image spacing as tight as you want and have more spacing around the tables. Also, the defaults should match what existed before.

Log in to join the discussion.