1

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?

Yihui Xie
  • 28,913
  • 23
  • 193
  • 419

1 Answers1

2

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')
Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
  • Hey Yihui with the new version of bookdown the appendices are rendered within the `article class`, but when you render using `html_documetn2` or `pdf_document2` the appendix figure numbers (Figure A.1, Figure A.2 etc) are not correctly rendered. Instead they are rendered as normal sections (Figure 5.1, 5.2 etc). Let me know if you want example. – Forrest Williams Nov 16 '16 at 16:07
  • @ForrestWilliams Thanks for the report! I have fixed this issue as well on Github: https://github.com/rstudio/bookdown/issues/245 (you need to install from Github) – Yihui Xie Nov 17 '16 at 18:30
  • using Bookdown version 0.2.3 the issue is resolved for `html_document2`, thanks! florisvdh mentioned that this is not an issue for `pdf_document2` which is true for the appendix titles, but figure numbers still do not correctly render. – Forrest Williams Nov 17 '16 at 20:23
  • @ForrestWilliams Could you post a new question here or file an issue to bookdown with a reproducible example? I tested figures in appendix, and I didn't see anything wrong. – Yihui Xie Nov 18 '16 at 03:39
  • Here is the new quesiton: http://stackoverflow.com/questions/40678036/rendering-appendix-figure-numbers-in-bookdown – Forrest Williams Nov 18 '16 at 13:15