0

I'm not getting a pdf output from my rnotebook.

My header in my "index.Rmd" is:

--- 
title: "some title"
author: "me"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
documentclass: book
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
description: "Notes on a Leasing Company busines risk and opportunities."
---

I'm rendering the book in the console with the following code:

bookdown::render_book("index.rmd", output_format = "bookdown::pdf_book")

Output is:

Error: Functions that produce HTML output found in document targeting latex output. Please change the output type of this document to HTML. Alternatively, you can allow HTML output in non-HTML formats by adding this option to the YAML front-matter of your rmarkdown file:

always_allow_html: yes

Note however that the HTML output will not be visible in non-HTML formats.

How do I go about changing the output type?

My file "_output.yml" file is:

     toc:
      before: |
        <li><a href="./">A Minimal Book Example</a></li>
      after: |
        <li><a href="https://github.com/rstudio/bookdown" target="blank">Published with bookdown</a></li>
    download: ["pdf", "epub"]
bookdown::pdf_book:
  includes:
    in_header: preamble.tex
  latex_engine: xelatex
  citation_package: natbib
  keep_tex: yes
bookdown::epub_book: default
user2946746
  • 1,740
  • 3
  • 21
  • 36
  • Is that all the code in your notebook, or is there something else that, like the error message says, is trying to render HTML content in a Latex document? – camille Nov 04 '19 at 16:36
  • It's multiple ".Rmd" files knited together to create a notebook. This is my first time trying to create a book/report in rnotebook. The output works great as HTML just not sure how I would edit the header to get pdf or ebook output. I believe this is where the error is located. – user2946746 Nov 04 '19 at 16:45
  • The type of output that you've specified in the header tells the renderer what type of output to expect. Based on the error message, you have HTML content that the renderer is trying to convert to Latex (and then PDF) that can't be converted that way. So you need to figure out what in the document is creating HTML-specific content; you haven't included any of the code chunks from the notebooks, so I don't know what that might be – camille Nov 04 '19 at 16:52

0 Answers0