r-markdown

How to force Tikz in RMarkdown document to show cyrillic text?

梦想与她 提交于 2019-12-06 06:11:10
问题 Below is my experimental RMarkdown document (named tikz-cyrillic.Rmd ): --- title: "TikZ cyrillic test" output: pdf_document: keep_tex: yes latex_engine: xelatex dev: tikz html_document: default word_document: default --- ```{r,engine='tikz', fig.ext = if (knitr:::is_latex_output()) 'pdf' else 'svg'} \begin{tikzpicture} \path (0,0) node (x) {Hello World!} (3,1) node[circle,draw](y) {$\int_1^2 x \mathrm d x$}; \draw[->,blue] (x) -- (y); \draw[->,red] (x) -| node[near start,below] {мир!} (y);

How to avoid blank space for title in R markdown v2

孤街醉人 提交于 2019-12-06 06:07:39
问题 I would not like to have blank space in my pdf output, that surely stands for no title method in R markdown while knitting pdf. I would like not to have title and have text starting from the begging of the page. Can anyone can tell me how to do that? My code, so far, looks like this: --- output: pdf_document: highlight: pygments toc: false number_sections: true --- text Thanks for any advice ! 回答1: For this level of customization you'll want to change the TeX template Pandoc uses: Copy the

Cross-referencing in rticles

我只是一个虾纸丫 提交于 2019-12-06 05:14:07
The bookdown offers great cross-referencing options for equations, figures, tables and sections: https://bookdown.org/yihui/bookdown/cross-references.html However, they seems to not work when I set as an output 'rticles::elsevier_article'. What are the available options for cross-referencing in rticles? I haven't tried, but there is a possible solution here: https://bookdown.org/yihui/bookdown/a-single-document.html Particularly, specify in your YAML metadata: output: bookdown::pdf_book: base_format: rticles::elsevier_article Since I am new using R Markdown I have decided to post this answer

How to zoom in on plots inside an Rmarkdown presentation

隐身守侯 提交于 2019-12-06 05:11:17
问题 I am creating my first HTML - presentation with rmarkdown (ioslides) and would like to be able to manually zoom into a slide and navigate to an object. Zooming works fine in a browser (crtl +, crtl mouse wheel) but I can not move the slide. Neither with the mouse nor with scrollbars. The latter do not appear as they do e.g. on a website. Is there an appropriate way to implement such a thing or are ioslides not meant to be used like this? I am using Ubuntu 16.04 (LXDE) and rstudio (R version 3

Title not showing on R Markdown with knitr when rendering markdown file

三世轮回 提交于 2019-12-06 04:56:14
问题 I am trying to convert a .Rmd file to .md (output: md_document), but the title does not show up on the rendered file. The title does show up when I try to render the same file as an .html file (output: html_document). Title shows up on rendered document: --- title: "Test" output: html_document --- ```{r} head(cars) ``` Title does not show up on rendered document: --- title: "Test" output: md_document --- ```{r} head(cars) ``` rmarkdown::render(my_file) Any ideas why? I am using RStudio 0.98

Saving html to pdf in chrome

帅比萌擦擦* 提交于 2019-12-06 04:44:40
问题 I am using rmarkdown to generate an HTML report. I am on a restricted machine, can't install tex. So, I was trying to generate an HTML document and then convert/print it to a pdf. The example markdown document is: --- title: "trials" author: "Foo Bar" date: "15 December 2016" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ```{r cars, echo=FALSE, cache=FALSE, message=FALSE} library(dplyr, quietly = TRUE) library(abind, quietly = TRUE) virginica <-

Generate formattable widgets in a loop in an R markdown document

为君一笑 提交于 2019-12-06 04:37:39
I want to put HTML widgets like formattable (from formattable package) in an HTML page generated through RMarkdown. I need the widgets to be generated from within a for loop. How can i do that? With or without print() , both don't work. This is an example code (partly taken from formattable homepage ): --- title: "formattable example loop" output: html_document --- ```{r} library(formattable) df <- data.frame( id = 1:10, name = c("Bob", "Ashley", "James", "David", "Jenny", "Hans", "Leo", "John", "Emily", "Lee"), age = c(28, 27, 30, 28, 29, 29, 27, 27, 31, 30), grade = c("C", "A", "A", "C", "B"

Stargazer output is code, not a table

*爱你&永不变心* 提交于 2019-12-06 04:30:48
问题 I am trying to use the package stargazer in RStudio to generate a summary table of my data. For some reason, I am not able to view the table in the output when I use either the html or latex code, but I can see it when I output as text. An example: library(stargazer) stargazer(attitude, type = 'text') Output looks like (as it is supposed to): ## ## ===================================== ## Statistic N Mean St. Dev. Min Max ## ------------------------------------- ## rating 30 64.633 12.173 40

change where rmarkdown saves images generated by r code

耗尽温柔 提交于 2019-12-06 03:35:42
问题 I have a rmarkdown document and I'm converting this file to md document. My problem is that I want the pictures created by plots to be placed in a folder called Images in the same directory of the file. Suppose i have this document: --- title: "my test" author: "daniel" date: "18/08/2015" output: md_document --- This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown

Add X-UA-Compatible in rmarkdown html output

落花浮王杯 提交于 2019-12-06 03:06:53
问题 I'm trying to add the following tag <meta http-equiv="X-UA-Compatible" content="IE=edge" /> as the first one after <header> in the output of rmkardown HTML document. This is necessary for Internet Explorer, as explained in this MSDN article. This answer does not work for me because the tag is added at the end of <head> and is ignored. My HTML output has some script embedded that is written before the X-UA-Compatible meta tag. Is there a way to add the tag as the first one automatically in