jfrench
jfrench

Reputation: 335

Why is bookdown only providing section headings with no text?

I'm trying to type up some statistics notes for one of my classes in bookdown. bookdown is not rendering the text written for any chapter with subsections. There is a bunch of text within each subsection, but it is not showing up when I compile to pdf.

Any ideas about what could be causing the problem?

The only thing that shows up is the section headers for the chapter. Sometimes deleting the files in _book is a workaround, but I can't reproduce the error easily. Everything seems to work, then I add a little text, and then I have the rendering problem. The document seems to compile with no warnings. A screenshot of the what I'm getting is included.

example of problem

I'm running the most current version of RStudio.

Session info:

R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics 
[3] grDevices utils    
[5] datasets  methods  
[7] base     

loaded via a namespace (and not attached):
 [1] compiler_3.6.1 
 [2] bookdown_0.13.2
 [3] htmltools_0.3.6
 [4] tools_3.6.1    
 [5] yaml_2.2.0     
 [6] Rcpp_1.0.2     
 [7] rmarkdown_1.15 
 [8] knitr_1.25     
 [9] xfun_0.9       
[10] digest_0.6.20  
[11] packrat_0.5.0  
[12] evaluate_0.14 

My yaml header is:

title: "A Book"
author: "Frida Gomam"
site: bookdown::bookdown_site
documentclass: book
output:
  bookdown::pdf_book:
    includes:
      in_header: preamble-latex.tex
  # bookdown::gitbook:
  #   includes:
  #     before_body: preamble-mathjax.tex
bibliography: [book.bib]
biblio-style: apalike

Upvotes: 1

Views: 296

Answers (2)

Mathemilda
Mathemilda

Reputation: 129

I did not get the Build Book button in RStudio. For some reason I do not have the option of Bookdown on my Rmarkdown project list options. Instead when I want to latex the whole book I go to Build at the top of my editing pane and click on Configure Build options... option, where I specify pdf option. Then I go to the Build again and hit Build All.

P.S. I found the Build Book button! It is does not belong to editing pane and not even in the global RStudio options line. If you have original placements of RStudio panes like I do, then one of tabs of the pane is Build, next to Environment, History and others. Click on it and you will see the Build Book button. All book files must be already knitted or at least saved.

Upvotes: 0

Yihui Xie
Yihui Xie

Reputation: 30114

You should click the Build Book button, instead of the Knit button. The latter only previews the current chapter. See documentation here: https://bookdown.org/yihui/bookdown/rstudio-ide.html

Upvotes: 3

Related Questions