fix: give raster figures the same \parskip as paragraphs and pspictures - #37
Merged
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
\imgand\youtubewere the only block-level things the renderer emits with no vertical spacing of their own — the wrapper carried an inline style and nothing else:That worked on the old mathapedia only by accident: images were inline there, so the line box's leading (~21px at
line-height: 20px) happened to look like a paragraph gap. Any consumer running a modern CSS reset loses it — Tailwind's preflight setsimg { display: block }— and a figure ends up flush against the following paragraph. Measured on mathapedia.com's rewrite, the gap below the figure on/books/31/sections/153/338was 0px where production shows 21px; with this change it's 22.4px, i.e. the same1.6em\parskipthat.math > p.paraand.pspicturealready use.So the spacing lands where the rest of the document rhythm already lives — one variable in
latex2js.css— rather than in a consumer stylesheet.width: 100%from the inline style is dropped because a blockdivis already full width. Noimgrule is added: whether images are block or inline is the consuming site's reset to decide, and this fix holds either way.bundle/latex2js.cssandbundle/latex2html5.bundle.jsare the tracked build outputs, regenerated.Link to Devin session: https://app.devin.ai/sessions/e51e8ecb94d241bd8d89e65e642c3e43
Requested by: @pyramation