Bookdown PDF generation

I'm having a problem getting my bookdown to output a pdf file. I've followed this thread and installed tinytex and most everything else.

My YML files are:


title: "Qualifying exam"
author: "Niklas Lollo"
date: "`r Sys.Date()`"
description: ''
documentclass: book
github-repo: niklaslollo/quals
bibliography: [quals.bib, packages.bib]
biblio-style: apalike
link-citations: true
colorlinks: true
knit: "bookdown::render_book"
site: bookdown::bookdown_site
subtitle: Literature Review & Prospectus
cover-image: images/mushroom.jpg


  split_by: rmd
  split_bib: TRUE
  highlight: tango
    download: [pdf]
      facebook: no
      github: yes
      collapse: section
      scroll_highlight: yes
      before: |
             <p>Niklas Lollo's Qualifying Exam </p>
      after: |
              <li><a href="" target="blank">Published with bookdown</a></li>
      position: static
      search: yes
        theme: white
        family: sans
        size: 2
  latex_engine: xelatex
  citation_package: natbib
  keep_tex: yes


book_filename: quals
output_dir: docs
delete_merged_file: true
    chapter_name: "Chapter "
rmd_files: ["index.Rmd",

When I click on the download PDF link of the bookdown site I receive this error:
Error - The requested URL was not found on this server. http://..../rmd_output/2/quals.pdf

This means (to me) there is no pdf generated when I render the book, which is confirmed when I look through my output directory. What do I need to change?


Have you checked the RMarkdown window in RStudio? When I tried rendering index.Rmd, I got

Error in rawToChar(out) : 
  embedded nul in string: '{~}S1?/.b15152566/.b15152566/1{\\\0C1{\\\0C1{\\\0CB/frameset{~}b15152566'
Calls: <Anonymous> ... <Anonymous> -> move_files_html -> vapply -> FUN -> rawToChar
In addition: Warning messages:
1: In FUN(X[[i]], ...) :
  out-of-range values treated as 0 in coercion to raw
2: In FUN(X[[i]], ...) :
  out-of-range values treated as 0 in coercion to raw
3: In FUN(X[[i]], ...) :
  out-of-range values treated as 0 in coercion to raw
Execution halted

and, of course, no output. The repo is public (you might want to change that). And I'll delete it from my laptop if there are no further questions

Thanks for looking into this. That makes me think it is an encoding issue with some text. I got it to work somehow last year... The repo is now private once more; feel free to delete!


How did you build your book ? Did you explicitly build the pdf_book ?

See here for explanation on how it works

You build all format one after the other using the IDE build pane

bookdown::render_book() will build only the first format found in _output.yaml. So it will render only html book and there is no pdf to download then.

1 Like

Yes, I believe I did that... thanks for your help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.