Search code examples
rr-markdownbookdown

Bookdown Special Headers within Article Document Class


Bookdown has introduced a ton of great functionality, but I am having some issues with the single document output option. When documentclass: in the YAML header is set to book bookdown has no trouble recognizing and creating special headers, but if documentclass: is set to article bookdown is unable to render special headers. Here is a brief example:

---
title: "Untitled"
author: "John Doe"
date: "November 10, 2016"
documentclass: article
output: bookdown::pdf_document2
---

```{r setup, include=FALSE}
library(bookdown)
knitr::opts_chunk$set(echo = TRUE)
```

# Chapter One
# Chapter Two
# (APPENDIX) Appendix {-}
# Appendix A
# Appendix B

Is it possible to render documents of class article with special headers using Bookdown, or is this outside of Bookdown's functionality at this time?


Solution

  • I have updated bookdown on Github so that the article class will also be supported when you use these special headers. Please try the latest version (>= 0.2):

    install.packages('bookdown')