bookdown

R markdown / bookdown - how to switch to rticles?

冷暖自知 提交于 2019-12-13 16:14:49
问题 Input data I prepared an example Rmd file with references to figure, table and equation, setting as an output 'bookdown::pdf_document2'. It compiles without errors to PDF. I placed it on dropbox: https://www.dropbox.com/sh/zmu0a4wq95ywssv/AAD-nHlkDiLknLk2NVR4Xup3a?dl=0 Question Now I wish to set as an output format 'rticles::elsevier_article' How can I do that? Issue When I change output line from: bookdown::pdf_document2 to rticles::elsevier_article I'm receiving an error message. Even if I

Automated nicely formated book of lyrics from data.frame using markdown, knitr and glue

╄→гoц情女王★ 提交于 2019-12-13 04:28:32
问题 This is the extension of previous question: Automating the generation of preformated text in Rmarkdown using R. Here's the task: You have a collection of song lyrics stored in data.frame , the columns of which are: song lyrics (with many \n at the end of each line), song title, song album, music author, words author, year, etc... Now you want to produce automatically a nicely formatted book of this poetry using markdown (or bookdown ) and glue packages, which should generate an html of this

How to keep the merged Rmd file created during Merge and Knit

点点圈 提交于 2019-12-13 02:12:12
问题 bookdown merges all of the Rmd files into one, before knitting, but deletes this files at the end of the process. I would like to examine the merged Rmd for debugging purposes. How can I tell bookdown not keep this intermediate file instead of erasing it? Update I found out about the delete_merged_file option in _bookdown.yml , but unfortunately, it seems to have no effect. 来源: https://stackoverflow.com/questions/56031857/how-to-keep-the-merged-rmd-file-created-during-merge-and-knit

Can't use PLOS rticles template with bookdown

倾然丶 夕夏残阳落幕 提交于 2019-12-12 10:57:38
问题 Following this post, I'm trying to put @YihuiXie 's answer in practice with the PLOS template of rticles but it doesn't work. Any help would be very appreciated! Below in a minimal example: --- title: Title of submission to PLOS journal author: - name: Me affiliation: Here # output: rticles::plos_article output: bookdown::pdf_document2: base_format: rticles::plos_article --- # Introduction Some text \@ref(fig:fig1) # References {#references .unnumbered} The error message reads Error in pdf

Cross-reference figure in a separate Rmarkdown (PDF) file

自作多情 提交于 2019-12-11 17:26:00
问题 I am working on a project with two separate .Rmd files that are part of the same project. One file contains text and equations mainly and the other file contains figures/plots. Is it possible to cross-reference the figures from the second file into the first .Rmd file? File_1.Rmd The following formula has revolutionized the car manufacturing industry. It predicts the mileage per gallon of a car based on its weight. $$ mpg = f(wt) $$ The formula is illustrated in Figure \@ref(fig:File_2.Rmd

Cannot add tikz code snippet in my .Rmd post using blogdown

允我心安 提交于 2019-12-11 07:05:37
问题 I have just started using blogdown and I have created a project by using template Hugo-Xmin. In RStudio, when creating the project in blogdown, it created some predefined posts, I am editing this one: /content/post/2015-07-23-r-rmarkdown.Rmd Adding a tikz image Following this question and the bookdown documentation on engines, I modified the afore-mentioned file by adding this snippet: This is a tikz picture: ```{r, echo=FALSE, engine='tikz', out.width='90%', fig.ext=if (knitr:::is_latex

Bookdown stopped following chapter order specified in _bookdown.yml

孤者浪人 提交于 2019-12-11 06:47:47
问题 Bookdown will order chapters alphabetically unless an order is specified after rmd_files: in the _bookdown.yml file This has worked fine for me in the past but is not currently working. Here is a MWE: This _bookdown.yml specifies to render Chapter 2 before Chapter 1 and not include Chapter 3, yet Chapters 1, 2, and 3 are rendered in order in the rendered book. (Rendered with bookdown::render_book("index.Rmd") The local preview has the same issue. I am using the dev version of bookdown (0.10.1

Consistent math equation numbering in bookdown across pdf, docx, html output

不羁的心 提交于 2019-12-11 05:39:30
问题 In bookdown, is there a LaTeX math environment which numbers each equation, regardless of whether the ouptut is .pdf, .docx, .html? Adding this LaTeX: \begin{align} X &= Y \\ Z &= W \end{align} Into the bookdown-demo outputs the following: PDF: works as expected. DOCX: missing equation numbers. HTML: missing equation numbers. Notes: The output was generated using pdf_book , word_document2 , gitbook . This is related to an unanswered question of mine: Align environment in R Markdown which

bookdown/rmarkdown/knitr: Open a document with the (graphical) result of a later code chunk?

痴心易碎 提交于 2019-12-11 03:35:32
问题 Imagine a simplified bookdown / rmarkdown document that goes something like this: --- title: "Test Doc" author: "Balin" date: "May 25, 2018" output: bookdown::pdf_document2: toc: no --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` <!-- Placeholder - See question --> This stands in for an extensive report where `code`, its documentation and interpretation of its results are integrated: 1. We load some data: ```{r data-loading} my_data <- cars ``` 2. We (rougly) explore

Adding natbib options for PDF output

微笑、不失礼 提交于 2019-12-11 03:19:27
问题 Is there a way to specify natibib options when outputting a PDF with bookdown ? I want the tex output to have the command \usepackage[sort&compress]{natbib} But there doesn't seem to be any way to specify it in the YAML. I can't add the command to my preamble, because the template already adds \usepackage{natbib} . What's the correct way to pass package options to natbib ? 回答1: As of this commit, the default LaTeX template supports natbib options in the YAML via the variable natbiboptions . I