Skip to content

Added number_sections for docx - #1869

Merged
yihui merged 3 commits into
rstudio:masterfrom
jooyoungseo:word-number-sections
Jul 24, 2020
Merged

yihui merged 3 commits into
rstudio:masterfrom
jooyoungseo:word-number-sections

Conversation

@jooyoungseo

@jooyoungseo jooyoungseo commented Jul 24, 2020 •

Copy link
Copy Markdown

This PR is the first step to address bookdown#756.

Now that --number-sections is supported for Docx writer via pandoc v2.10.1, I've added number_sections argument to word_document() output_format (set to FALSE by default).

I've also made a condition to ignore the argument when fired in a session < pandoc v2.10.1, and added a gentle warning message.

I've tested the following document with pandoc v2.10.1, and confirmed that this works.

---
output:
  word_document:
    number_sections: true
---

# Introduction

# Body

# Conclusion

@yihui yihui left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thanks!

@yihui
yihui merged commit 0717ff5 into rstudio:master Jul 24, 2020
j-magnolia added a commit to j-magnolia/rmarkdown that referenced this pull request Aug 23, 2020
Merge branch 'master' into jg-devel

* master:
  tweak news
  require Pandoc >= 1.14
  xfun 0.16 is on CRAN now
  replace base64enc with xfun::base64_encode/decode()
  support number_sections for word_document() output (rstudio#1869)

# Conflicts:
#	DESCRIPTION
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants