Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Powerpoint Output: bullet points are rendered as indented to level 2 #4828

Closed
rich-iannone opened this issue Aug 9, 2018 · 10 comments · Fixed by #7578
Closed

Powerpoint Output: bullet points are rendered as indented to level 2 #4828

rich-iannone opened this issue Aug 9, 2018 · 10 comments · Fixed by #7578

Comments

@rich-iannone
Copy link

rich-iannone commented Aug 9, 2018

The issue here was originally posted in rstudio/rmarkdown#1418, where the OP expressed that this output (bullet points appearing as indented to level 2) is not the expected behaviour, requiring manual editing after rendering.

To reproduce, use the following (bullets.md):

### Slide with Bullets

- Bullet 1
- Bullet 2
- Bullet 3

I ran this with pandoc (v.2.2.1):

pandoc +RTS -K512m -RTS bullets.md --to pptx --from markdown --output bullets.pptx

Here's a screenshot of bullets.pptx, showing the bullet characters appearing reasonably far from the left border of the text box.

bullets-indented

@jgm
Copy link
Owner

jgm commented Aug 10, 2018

@jkr when you have a chance, could you look at this and #4827?

@jkr
Copy link
Collaborator

jkr commented Aug 10, 2018 via email

@dvbuntu
Copy link

dvbuntu commented Aug 2, 2019

I've noticed this recently as well. Any update or workaround on this?

@jkr
Copy link
Collaborator

jkr commented Aug 3, 2019

Sorry to take so long on this. This is just PowerPoint's default template's formatting. The bullets are actually level 1. If you want it to be indented differently, you need to use a different template (reference-doc, in pandoc-speak).

Run pandoc on the above example to produce a PowerPoint doc.

$ cat input.text                                         
### Slide with Bullets

- Bullet 1
- Bullet 2
- Bullet 3
$ pandoc input.text -o output.pptx                             

Note the "lvl = 1" in the output

$ unzip -p output.pptx ppt/slides/slide1.xml|xmllint --format -

<?xml version="1.0" encoding="UTF-8"?>
<p:sld xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main">
  <p:cSld>
    <p:spTree>
      <p:nvGrpSpPr>
        <p:cNvPr id="1" name=""/>
        <p:cNvGrpSpPr/>
        <p:nvPr/>
      </p:nvGrpSpPr>
      <p:grpSpPr>
        <a:xfrm>
          <a:off x="0" y="0"/>
          <a:ext cx="0" cy="0"/>
          <a:chOff x="0" y="0"/>
          <a:chExt cx="0" cy="0"/>
        </a:xfrm>
      </p:grpSpPr>
      <p:sp>
        <p:nvSpPr>
          <p:cNvPr id="2" name="Title 1"/>
          <p:cNvSpPr>
            <a:spLocks noGrp="1"/>
          </p:cNvSpPr>
          <p:nvPr>
            <p:ph type="title"/>
          </p:nvPr>
        </p:nvSpPr>
        <p:spPr/>
        <p:txBody>
          <a:bodyPr/>
          <a:lstStyle/>
          <a:p>
            <a:pPr lvl="0" marL="0" indent="0">
              <a:buNone/>
            </a:pPr>
            <a:r>
              <a:rPr/>
              <a:t>Slide</a:t>
            </a:r>
            <a:r>
              <a:rPr/>
              <a:t> </a:t>
            </a:r>
            <a:r>
              <a:rPr/>
              <a:t>with</a:t>
            </a:r>
            <a:r>
              <a:rPr/>
              <a:t> </a:t>
            </a:r>
            <a:r>
              <a:rPr/>
              <a:t>Bullets</a:t>
            </a:r>
          </a:p>
        </p:txBody>
      </p:sp>
      <p:sp>
        <p:nvSpPr>
          <p:cNvPr id="3" name="Content Placeholder 2"/>
          <p:cNvSpPr>
            <a:spLocks noGrp="1"/>
          </p:cNvSpPr>
          <p:nvPr>
            <p:ph idx="1"/>
          </p:nvPr>
        </p:nvSpPr>
        <p:spPr/>
        <p:txBody>
          <a:bodyPr/>
          <a:lstStyle/>
          <a:p>
            <a:pPr lvl="1"/>
            <a:r>
              <a:rPr/>
              <a:t>Bullet 1</a:t>
            </a:r>
          </a:p>
          <a:p>
            <a:pPr lvl="1"/>
            <a:r>
              <a:rPr/>
              <a:t>Bullet 2</a:t>
            </a:r>
          </a:p>
          <a:p>
            <a:pPr lvl="1"/>
            <a:r>
              <a:rPr/>
              <a:t>Bullet 3</a:t>
            </a:r>
          </a:p>
        </p:txBody>
      </p:sp>
    </p:spTree>
  </p:cSld>
</p:sld>

@jkr jkr closed this as completed Aug 3, 2019
@eptesicus
Copy link

Sorry to take so long on this. This is just PowerPoint's default template's formatting. The bullets are actually level 1. If you want it to be indented differently, you need to use a different template (reference-doc, in pandoc-speak).


Note the "lvl = 1" in the output

Indentation levels start at 0 in Powerpoint, so lvl = "1" is actually the second level.

@jgm jgm reopened this Oct 8, 2019
@jkr
Copy link
Collaborator

jkr commented Oct 8, 2019

Yes, but we treat 0-level as content paragraphs (everything is a leveled paragraph, with our without a bullet).

So what we would think of as outside of a list in pandoc is expressed as an unbulleted 0-level. The first level of a list is a bulleted 1-level.

@jkr
Copy link
Collaborator

jkr commented Oct 8, 2019

I suppose we could have content and first-level bullets both at 0, but that would cause problems if you have unbullleted-style lists...

@jgm
Copy link
Owner

jgm commented Oct 9, 2019

What would the problems be?
And by unbulleted-style lists, do you mean just regular paragraphs, or something else?

@stevenjcarr
Copy link

Any further update on this? Would be good to get a fix. I would expect both content and first-level bullets to be at level-0 this is how most PowerPoint content is written from what I've seen. Slides are typically written in two ways... all bullets in which case they need to be at level-0, or you have a leading paragraph followed by bullets, but they aren't typically indented, they would still be at level-0.

@cameronneylon
Copy link

I came across this issue which wasn't the behaviour I was expecting and arrived here pretty quickly based on a search. There is one super-hacky work-around which appears to be viable. That is to change the position and format in the Second and other level bullets in the ppt template file.

  1. In your template view the Slide Master (View Menu, select 'Slide Master' from ribbon)
  2. In view menu select the checkbox for 'Ruler' in the ribbon
  3. Return to the 'Home' menu in the ribbon
  4. Select the lowest level of bullets you want to adjust and move by grabbing the handles in the ruler and using the level above as an approximate guide (change the font size first, then move the bullets, its a fiddly pain)
  5. Work your way back up to Level 2 using Level 1 as a guide
  6. Use the template (and if there is an eventual fix remember you did this, although if you only ever use one level of bullets it shouldn't matter much)

@jgm jgm closed this as completed in #7578 Oct 18, 2021
jgm pushed a commit that referenced this issue Oct 18, 2021
In PowerPoint, the content of a top-level list is at the same level as
the content of a top-level paragraph – the only difference is that a
list style has been applied.

At the moment, the pptx writer increments the paragraph level on each
list, turning what should be top-level lists into second-level lists.

This commit changes that logic, only incrementing the paragraph level on
continuation paragraphs of lists.

- Fixes #4828
- Fixes #4663
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants