0
votes

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.
1
In addition to the correct answer below: you can install a TeX installation that includes xetex quite easily using the tinytex package.Ralf Stubner
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

1 Answers

2
votes

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
---