In Rstudio, I create a new project and select book project using bookdown
. The built in example runs perfectly as expected and i can compile 4 books - gitbook, html, epub, and pdf. Great.
The next obvious step is to want to have slides at the same time, very much in line with what the beamer package
does, allowing for both beamer mode
and article mode
. Therefore, I tried to add another output in the _output.yml
code: bookdown::pdf_document2
. In line with the documentation, I know I should be able to define the base_format
to use rmarkdown::beamer
, The package author told me I was almost right, see this link for the discussion.
Punchline: I use this amended _output.yml
for the default project:
bookdown::gitbook:
css: style.css
config:
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:
base_format: rmarkdown::beamer_presentation
includes:
in_header: preamble.tex
latex_engine: xelatex
citation_package: natbib
keep_tex: yes
bookdown::epub_book: default
bookdown::pdf_document2:
includes:
in_header: preamble.tex
latex_engine: xelatex
citation_package: natbib
keep_tex: yes
which is exactly the suggestion XieYihui kindly made. However, I am getting a compile fail, when the pdf_book needs to be built:
Output created: _book/index.html
Error in base_format(toc = toc, number_sections = number_sections, fig_caption = fig_caption, :
unused argument (number_sections = number_sections)
Calls: <Anonymous> ... <Anonymous> -> create_output_format -> do.call -> <Anonymous>
Execution halted
Exited with status 1.
I am lost - I spent hours looking for a solution without success. Could anyone kindly help me? I am so sorry i have not been able to figure this one out. XieYiHui has been incredibly supportive and his comments suggest this is the right venue for such questions. Many thanks. thomas
bookdown::pdf_book
andbookdown::pdf_document2
output to the same file - which gets therefore overwritten! I know how to change filenames and locations for all files at once using_bookdown.yml
, but I do not know how to do it for individual files.... i will search more online, but did not see anything so far - do I need to post another question for this if I cannot find anything? many thanks, thomas – Blotto