0

I am using Rstudio to generate a document with bookdown. Unfortunately I have to use Windows and don't have xelatex.

How do I stop bookdown from trying to generate compile_main.tex?

I only want HTML

I just want to know what to put in the YAML header of the index.Rmd file to select only HTML as the output format. It seems list this should be in the output: part, but I did not find this issue addressed in Yihui's book.

Error: Failed to compile _main.tex.
In addition: Warning message:
running command '"xelatex" -halt-on-error -interaction=batchmode "_main.tex"' had status 127 
Please delete _main.Rmd after you finish debugging the error.
Execution halted

Exited with status 1.
Yihui Xie
  • 28,913
  • 23
  • 193
  • 419
Harlan Nelson
  • 1,394
  • 1
  • 10
  • 22
  • In addition to the correct answer below: you can install a TeX installation that includes xetex quite easily using the tinytex package. – Ralf Stubner Sep 06 '18 at 06:13
  • 1
    I tried install.packages('tinytex') tinytex::install_tinytex() but the install tried to download from a site restricted by my Admin. I requested to have the site opened. I just tried it again. It seemed to work. tinytex:::is_inytex() > TRUE . It's a miracle! – Harlan Nelson Sep 06 '18 at 14:17

1 Answers1

2

Although I'm not sure which Yihui's book you refer to, but one of his works does explain how to set YAML to get .html output in detail.

I also put my exmaple, JFYI.

---
title: "Your title"
author: "Your name"
date: "The date when you wrote the document"
output: 
  bookdown::html_document2:
    toc: yes #if you want to get the table of contents
    fig_caption: true
bibliography: Your-bibliography.bib # Specify if you have any bib format, such as `.bib`, `.enl`, .etc.
always_allow_html: yes
editor_options:
  chunk_output_type: console
---
Carlos Luis Rivera
  • 3,108
  • 18
  • 45
  • Simply put: `bookdown` won't produce PDF output, if one does not specify PDF output in the `output` part of the YAML header, which might be in the `_output.yml` file. – Ralf Stubner Sep 06 '18 at 08:10