Skip to content

PPTX writer: keep tables and surrounding text on same slide#11411

Open
ccb wants to merge 2 commits into
jgm:mainfrom
ccb:pptx-table-content-same-slide
Open

PPTX writer: keep tables and surrounding text on same slide#11411
ccb wants to merge 2 commits into
jgm:mainfrom
ccb:pptx-table-content-same-slide

Conversation

@ccb
Copy link
Copy Markdown
Contributor

@ccb ccb commented Jan 22, 2026

Summary

  • Fix for PPTX writer where bullet points before and after a table would be split across multiple slides or rendered in incorrect order
  • Tables and surrounding text now stay together on the same slide with proper vertical positioning

Changes

  1. Presentation.hs: Modified splitBlocks' to continue accumulating content after tables instead of immediately splitting to a new slide

  2. Presentation.hs: When a slide has a table with surrounding text, use ContentSlide (single column) instead of ContentWithCaptionSlide (two columns) to preserve content order

  3. Output.hs: Added shapesToElementsStacked function to properly position multiple shapes (tables + text) vertically within a content area. Space is allocated proportionally based on content size (paragraphs and table rows)

Test plan

  • All 3836 existing tests pass
  • Added new test case table-with-surrounding-content
  • Manually tested with various markdown files containing tables with surrounding bullet points

Example markdown that previously had issues:

## Slide Title

- Bullet before table
- Another bullet

| Col A | Col B |
|-------|-------|
| Val 1 | Val 2 |

- Bullet after table

🤖 Generated with Claude Code

Chris Callison-Burch and others added 2 commits January 21, 2026 19:59
Previously, when a slide contained bullet points before and after a
table, content would be split across multiple slides or use a two-column
layout that didn't preserve the source order.

This change:

1. Modified splitBlocks' in Presentation.hs to continue accumulating
   content after tables instead of immediately splitting to a new slide.

2. When a slide has a table with surrounding text, use ContentSlide
   (single column) instead of ContentWithCaptionSlide (two columns)
   to preserve content order.

3. Added vertical stacking in Output.hs (shapesToElementsStacked) to
   properly position multiple shapes (tables + text) within a content
   area. Space is allocated proportionally based on content size
   (paragraphs and table rows).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add explicit Double type annotation for heightPerUnit
- Remove unused estimateTableHeight function

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant