git.iko.soy/typeable/pandoc
on master help sign in
Powerpoint writer: Set notes slide number correctly

Previously, this hadn't been aware of a metadata slide. We also clarify the logic for setting the startnumber of different slide sections correctly.

commit4ce07c20d7f06da3519fa601b9d3df94a16d507e authorJesse Rosenthal <jrosenthal@jhu.edu> dateFri 12 Jan 2018, 10:00 (9 years ago) parent53c48dd
1 file changed+8−10
src/Text/Pandoc/Writers/Powerpoint.hs+8−10
src/Text/Pandoc/Writers/Powerpoint.hs+8−10
@@ -679,20 +679,18 @@ getMetaSlide = do
679679
680680blocksToPresentation :: PandocMonad m => [Block] -> P m Presentation
681681blocksToPresentation blks = do
682− metadataslide <- getMetaSlide
683− let bodyStartNum = case metadataslide of
684− Just _ -> 2
685− Nothing -> 1
682+ metadataslides <- maybeToList <$> getMetaSlide
683+ let bodyStartNum = length metadataslides + 1
686684 blksLst <- splitBlocks blks
687− slides <- mapM
688− (\(bs, n) -> local (\st -> st{envCurSlideId = n}) (blocksToSlide bs))
689− (zip blksLst [bodyStartNum..])
690− let noteSlidesNum = length blksLst + 1
691− noteSlides <- local (\st -> st {envCurSlideId = noteSlidesNum}) makeNotesSlides
685+ bodyslides <- mapM
686+ (\(bs, n) -> local (\st -> st{envCurSlideId = n}) (blocksToSlide bs))
687+ (zip blksLst [bodyStartNum..])
688+ let noteStartNum = bodyStartNum + length bodyslides
689+ noteSlides <- local (\st -> st {envCurSlideId = noteStartNum}) makeNotesSlides
692690 presSize <- asks envPresentationSize
693691 return $
694692 Presentation presSize $
695− (maybeToList metadataslide) ++ slides ++ noteSlides
693+ metadataslides ++ bodyslides ++ noteSlides
696694
697695--------------------------------------------------------------------
698696