r-markdown

How to include @font-face within style tag of RMarkdown?

末鹿安然 提交于 2020-05-17 05:45:15
问题 Is it possible to use the CSS @font-face to provide font files to an RMarkdown? e.g.: <style> @font-face { font-family: "Custom"; src: url(https://github.com/stevecondylios/fonts/raw/master/CircularStd-Book.ttf) format("truetype"); } body { font-family: "Custom", Verdana, Tahoma; } </style> Note that the exact same css code above (less the style tags) does work when it's stored in an external .css file locally and referenced in the Rmd's yaml with --- title: "My Rmarkdown doc" date: "28 April

RMarkdown can't find 'pdflatex.fmt' file

痞子三分冷 提交于 2020-05-16 08:56:06
问题 I am trying RMarkdown for the first time, using the very first example in Yihui's book "R Markdown A Definitive Guide": --- title: "Hello R Markdown" author: "Awesome Me" date: "2018-02-14" output: pdf_document --- This is a paragraph in an R Markdown document. Below is a code chunk: options(tinytex.verbose = TRUE) fit = lm(dist ~ speed, data = cars) b = coef(fit) plot(cars) abline(fit) The slope of the regression is `r b[1] I installed TinyTex using the following as per Yihui's comments here

mixing text and citations in R markdown

拜拜、爱过 提交于 2020-05-15 10:41:28
问题 Is it possible to mix regular text and citations in R markdown documents so that they looked as follows: (Author 2018; Methods) Currently, I've tried ([@Author2018]; *Methods*) which gives ((Author 2018); Methods) , and [@Author2018; Methods ] results in a knitting error. Any thoughts would be greatly appreciated! 来源: https://stackoverflow.com/questions/51881899/mixing-text-and-citations-in-r-markdown

mixing text and citations in R markdown

爷,独闯天下 提交于 2020-05-15 10:41:06
问题 Is it possible to mix regular text and citations in R markdown documents so that they looked as follows: (Author 2018; Methods) Currently, I've tried ([@Author2018]; *Methods*) which gives ((Author 2018); Methods) , and [@Author2018; Methods ] results in a knitting error. Any thoughts would be greatly appreciated! 来源: https://stackoverflow.com/questions/51881899/mixing-text-and-citations-in-r-markdown

Sudden collapse of kableExtra in [R]

北城以北 提交于 2020-05-15 08:05:41
问题 I should probably point out that I am still fairly new to working with RMarkdown and the kableExtra R package, but I have a document that was knitable last week and now no longer knits despite no physical changes to the document. The error message I receive is the following Error in save_kable_latex(x, file, latex_header_includes, keep_tex) : We hit an error when trying to use magick to read the generated PDF file. You may check your magick installation and try to use the magick::image_read

Set path to miktex for pdflatex in R

只愿长相守 提交于 2020-05-15 01:54:08
问题 I have been trying to get pdflatex to use the correct version of miktex and have not been successful. I have set the R Path to have the correct location of Miktex 2.9, and verified that it worked with: Sys.getenv("PATH") "C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64\\pdflatex;..." However when i look at the version of miktex that pdflatex is using: Sys.which("pdflatex") "C:\\PROGRA~1\\MIKTEX~1.9\\miktex\\bin\\x64\\pdflatex.exe" This 1.9 path is to an old version of miktex that no longer

How can I use Latex' \newcommand in Rmd?

こ雲淡風輕ζ 提交于 2020-05-14 18:29:25
问题 I would like to make the following work --- title: "Untitled" author: "SQC" date: "21 September 2018" output: html_document --- \newcommand{\short}{AreallylongwordIhavetotypefrequently} # My Test I would like to write \short which does not work, $\short$ however is close... Snippets do not work in Rmd plain text (= Rstudio's "Shift", see link below). But I could not find a solution. It would be great if there is something around! The following links are helpful, but didn't suggest a solution:

How to add horizontal scroll bar for a ggplot plot in RMarkdown html

烈酒焚心 提交于 2020-05-14 18:28:11
问题 I have recently started using RMarkdown for reporting purposes. A specific report I am working on contains tables and plots for data acquired from many experiments carried out over the years - sort of updating and summarising data quickly. While I have found a way to add scrollbars/scroll boxes for tables (by using Kable) and code chunk outputs, I have not been able to add scrollbars for plots. Most of plots are not big and its not an issue, but for one/two plots there are many categories and

Change bibliographystyle in R Markdown

情到浓时终转凉″ 提交于 2020-05-14 07:36:49
问题 I want to change the bibliographystyle in R Markdown but nothing I found could help. I do not want any "and"s in the bibliography (before the last author). My preferred option was if I could use alphadin (bst-file here) but I could not get it to work. Here is my YAML so far: --- output: pdf_document bibliography: literatur.bib biblio-style: alphadin.bst header-includes: - \usepackage{graphicx} - \usepackage{float} - \usepackage[ngerman]{babel} - \usepackage{fancyhdr} - \usepackage{hyperref} -

Change line spacing for RMD abstract?

爷,独闯天下 提交于 2020-05-13 10:48:31
问题 Is it possible to change the line spacing for the abstract specified in my YAML header to single space, while leaving the rest of the document in double space? My YAML is below: output: pdf_document number_sections: true title: | | My Title author: - Me header-includes: - \usepackage{setspace}\doublespacing - \usepackage{float} abstract: "My abstract" keywords: "My keywords" date: "`r format(Sys.time(), '%B %d, %Y')`" geometry: margin=1in fontsize: 12pt spacing: double fig_caption: yes indent