OK. Let's try this.
I have this file index.Rmd:
---
title: "Test"
author: "Back Seat Pete"
---
# Preface {-}
## About this book {-}
Some info.
```{block2, type="rmdnote"}
Meant to be a **note**.
```
It is that last rmdnote that is ignored.
Here is _output.yml (not sure what I should and should not remove here):
bookdown::gitbook:
css: style.css
split_by: section
bookdown::html_chapters:
css: style.css
bookdown::pdf_book:
includes:
in_header: preamble.tex
keep_tex: yes
pandoc_args: --top-level-division=chapter
toc_depth: 3
toc_unnumbered: no
bookdown::epub_book:
stylesheet: style.css
And _bookdown.yml:
output_dir: _book
clean: [packages.bib, bookdown.bbl]
delete_merged_file: true
The preamble.tex file is (in the same directory as the other files):
\newenvironment{rmdnote}
{\begin{center}}
{\end{center}}
When I run
render_book("index.html", output_format="pdf_book")
I get this error message:
! LaTeX Error: Environment rmdnote undefined.
Error: Failed to compile _main.tex. See _main.log for more info.
When I examine _main.text, there is no mention of preamble.tex anywhere, or a definition for the rmdnote environment. The code to include the rmdnote is there, but of course it throws an error if the definition for that environment isn't loaded.
(Indeed, if I make a syntax error in the preamble.tex file by not closing a bracket, there is no difference: _main.tex still fails to compile because no rmdnote environment is defined, not because of the missing bracket.)
This suggests to me (who knows little) that the issue is that the files aren't being found or used. Why is my preamble.tex file not being found?
(Similarly, but details not included to save space, the style.css with a rmdnote definition also is ignored when the html file is rendered.)
Thanks for any help.
BSP.