Why won't RMarkdown with Bookdown recognize Tufte formatting? - r-markdown

I am working on a Bookdown project and would like to use Tufte formatting.
I downloaded the Bookdown demo and the tufte package. Then, I simply changed the YAML in index.Rmd to:
---
title: "A Minimal Book Example"
author: "Yihui Xie"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
output:
bookdown::tufte_html_book:
toc: yes
css: toc.css
documentclass: book
bibliography: [book.bib, packages.bib]
biblio-style: apalike
link-citations: yes
github-repo: rstudio/bookdown-demo
description: "This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook."
---
Where the only change is in the output: option, which is specified by the Bookdown book
And then tried both the Knit button and bookdown::render_book(). The demo built successfully.
However, it did not produce Tufte formatting. Instead I get default formatting, with a white background, non-italic section headings, and footnotes instead of margin notes (I added a footnote to the doc on a second run to make this visible):
I also tried this with different spacing before the "bookdown"/"toc" etc. stuff, and with tufte::tufte_html: default instead of any of the "bookdown"/"toc" stuff.
What do I need to do to get Bookdown to recognize the Tufte formatting request? I feel like I am missing something exceedingly simple.

Related

Improve bibliography layout in bookdown gitbook (using zotero)

I am using bookdown to write a paper, and the zotero bibtex plug in to reference. When I knit, the bibliography is automatically added from my references.bibfile. The YAML in my index is:
site: bookdown::bookdown_site
output:
bookdown::gitbook: default
documentclass: book
bibliography: references.bib
csl: african-online-scientific-information-systems-harvard.csl
link-citations: yes
When I knit, it puts my bibliography at the end, which is great. However I'm not sure how to format the bibliography, at the moment it is just a block of text, I'd like a little more stylish formatting, say an indent on the second line of a specific reference.
Thanks

DiagrammeR and R Markdown pdf: How to crop to the diagram?

I have made a nice flowchart in DiagrammeR. I have also plotted it into R Markdown and I am able to knitr it into a pdf. As you see in the following screenshot, the figure is not centered (even though I included fig.align = 'center'). But there is also a huge gap between my figure and the following text. How do I "crop" the diagram so I removes the space and center the diagram?
You will find problems generally with markdown problems so you will have to modify manually from your latex code so I would recommend that you put in your yaml:
---
output:
pdf_document:
latex_engine: pdflatex
keep_tex: true
---

Tufte RMarkdown Document - Self Contained Option?

I would like to distribute the HTML variant for the theme to be a self-contained HTML file. Is that possible? The following YAML header built the gorgeous file, but appears to have dependencies via the form of cache and files folders.
---
title: "Tufte Handout"
subtitle: "An implementation in R Markdown"
author: "JJ Allaire and Yihui Xie"
date: "`r Sys.Date()`"
output:
tufte::tufte_html:
self_contained: true
---
I think you may not be looking closely enough at this, or looking from the wrong angle:
Self-contained asks for just that;
what your question notes are cache files
which are "merely" used to produced said self-contained file more easily.
Should work for tufte, tint and everything else running through the same machinery.

Full author list for first citation in a chapter [apa.csl]

I'm writing my dissertation in R markdown. I am using bibtex, pandoc-citeproc, and apa.csl with bookdown. I have new_session: yes in my _bookdown.yml and compiling primarily to PDF (documentclass:book, classoption: oneside).
The system I have is correctly using the full author list in place of "et al." for the first time I cite a 3-6 author work. That said, my adviser wants the full author list for the first time I cite a work per chapter.
Is there an easy way to go about this?
Here is the apa.csl I'm using:
https://github.com/citation-style-language/styles/blob/master/apa.csl
Turns out that a biblatex based solution is indeed very flexible as #moewe showed on TeX.SE. When one combines style=apa with citerest=chapter one gets the effect you are after. In a minimal R-markdown document:
---
output:
pdf_document:
citation_package: biblatex
documentclass: book
bibliography: biblatex-examples.bib
biblio-style: apa
biblatexoptions:
- citereset=chapter
---
# Intro
[#herrmann] and [#yoon]
[#herrmann] and [#yoon]
# Method
[#herrmann] and [#yoon]
[#herrmann] and [#yoon]
# References
Make sure that your TeX system includes the biber program.

Rmarkdown: use Komadown and Specify Pandoc Arguments

Hi at all i have the following Problem:
I'm using Rmarkdown to write a Dokument. I'm also using the komadown package to use some bookdown features for referencing and be able to use the scrartcl document Class (Latex Output). I want to specify a citation style using a .csl file.
Normaly a simple csl: FILENAME.csl in the YAML header does the trick. But with the Komadown package this doesn't work.
My YAML Header is as follows, it finds my bibliography but it doesn't find the .csl file :(
---
title: "Komadown Try"
bibliography: library.bib
csl: kaktus.csl
output: komadown::scrartcl
---
Furthermore i want to set the keep_tex option to TRUE or yes but this also doesn't work.
Many thanks in advance. Would be awesome if someone could help me out.
i just got an answer to my questions. Maybe It'll help others that run into the same problem.
I can specify the csl file now. There was a bug in the code and the developer has fixed it. Currently the latest Version isn't on Cran so you have to download the developer Version from Github:
# install.packages("devtools")
devtools::install_github("jolars/komadown")
If you have done that you can specify the csl and the keep_tex argument as follows:
---
title: "Thesis Template"
bibliography: library.bib
output:
komadown::scrartcl:
keep_tex: yes
csl: kaktus.csl
---