rstudio / bookdown

Authoring Books and Technical Documents with R Markdown
https://pkgs.rstudio.com/bookdown/
GNU General Public License v3.0
3.74k stars 1.26k forks source link

Document fig.topcaption in bookdown book? #866

Open markbneal opened 4 years ago

markbneal commented 4 years ago

There is an option to create captions at the top of figures, fig.topcaption=TRUE, described here. I note it isn't documented in the bookdown book, and the functionality is hard to find. It appears to live in the knitr package here. Would it be useful to have it documented in the bookdown book? If so, I could make the attempt, via a fork, edit, then pull request, noting I'm pretty new to github workflows and etiquette.

cderv commented 3 years ago

@yihui is this more suited for the Rmarkdown Cookbook or the bookdown book is also a correct place for this ?

yihui commented 3 years ago

The main reason I didn't document this option "officially" is that it only works for a special case (HTML output). I was hoping to get it to work for at least LaTeX, too, before documenting it. I guess it won't work for other output formats such as Word.

So the first step would be to add the support for LaTeX in knitr. Then document it at https://yihui.org/knitr/options/. At last mention it in a book (preferably the R Markdown Cookbook).