Keep the paired README plots side by side on the pkgdown site#104
Merged
Conversation
The side-by-side chunks set out.width = "49%" with fig.show = "hold", but inherited the global fig.align = "center", so knitr tagged each image display: block. GitHub strips the inline style (images stay inline, side by side), but pkgdown keeps it and stacks them. Set fig.align = "default" on those chunks so the paired plots sit side by side in both renderers.
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.
The README paired-plot chunks (fig.show = hold, out.width = 49%) inherited the global fig.align = center, so knitr tagged each image with style display: block; margin: auto. GitHub strips inline styles, so on GitHub the images stay inline and sit side by side; the pkgdown site keeps the style and stacks them vertically.
Setting fig.align = default on those five chunks (basic, boxed, cluster, triangle, insig) drops the display: block, so the paired plots render side by side in both renderers. Single-figure chunks are untouched and stay centered. Only the style attribute changes in README.md; the figures themselves are unchanged.