r-markdown

Full citation in RMarkdown?

五迷三道 提交于 2019-12-04 06:33:27
Is there any way to insert a fully formatted citation in RMarkdown in-text. For example, something like this: You enter the citation key @watson1953 and it renders (as a latex PDF) as Watson, J. D., & Crick, F. H. C. (1953). Molecular structure of nucleic acids: A structure for deoxyribose nucleic acid. Nature, 171(737-738), 3-12. But it does it in exact location of the citation key. The bibliography at the end of the document should also be suppressed. Is there any way to do this? I couldn't find anything either here or through searching google. 来源: https://stackoverflow.com/questions

Latex Formulas or symbols in table cells using knitr and kableExtra in R-Markdown,

丶灬走出姿态 提交于 2019-12-04 06:25:24
Thanks to jaySf I was able to create a pdf file containing beautiful tables with footnotes showing formulas and symbols with R Markdown, Latex, knitr and kableExtra (below his example): --- title: "Untitled" output: pdf_document --- ```{r tab} library(knitr) library(kableExtra) df <- data.frame(v1=rnorm(6), v2=runif(6), v3=rbinom(6, 1, .33), row.names=LETTERS[1:6]) kable(df, "latex", align="c", booktabs=TRUE) %>% footnote(general=c("$a^2+b^2=c^2,$", "$\\\\sigma^2=\\\\frac{1}{n-1}\\\\sum_{i=1}^n(x_i-\\\\bar{x})^2;$", "1,000 \\\\$;", "100\\\\%."), number=c("Hello\ there! \\\\textit{Hello\ there!

Incorporate Leaflet map in revealjs presentation within R

十年热恋 提交于 2019-12-04 06:20:56
I'm trying to add a Leaflet map with tiles to a revealjs_presentation created in R. This map renders fine in ioslide or html format, but not in the revealjs_presentation format (main problems: all fonts are much too large and the map has strange artifacts around polygon boundaries when selected). Because the map works well in other output formats I suspect the issue has to do with some kind of CSS incompatability between revealjs_presentation and leaflet. In order to isolate the two sets of code I saved the leaflet map using htmlwidgets. This map looks fine but it seems that there is no way to

Bookdown: How can I change the size of the chapter titles?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 06:05:11
I am using bookdown to generate slides for a workshop. I use the 'big' letter option in the menu for display as slides. However then the chapter title font size is too large. Where/how can I modify that one? Thanks, Paul roman you can control this with .css as yihui suggests in the top level of your bookdown project there is a file called style.css open it and paste in: .book .book-body .page-wrapper .page-inner section.normal h1{font-size:1em} this will increase the size of your top level header font when you build the book. you can change the value of 'em' or you can use other ways of

change dimensions of shiny app embedded in r markdown HTML

佐手、 提交于 2019-12-04 05:31:06
问题 I have an embedded shiny app within an r markdown script which is knit to HTML. Currently when I knit the r markdown chunk that contains the shiny app, the app is not shown in the full size. r markdown includes the shiny app within a smaller 'window' where I need to use a window slider/scroller to view the entire app. I think this is an r markdown issue and have tried to change the chunk dimensions with fig.width and fig.height , but to no avail. I want the shiny app to be shown in the full

Why does {.tabset} not work with htmltools::tagList?

拜拜、爱过 提交于 2019-12-04 04:54:01
问题 The content looks fine except that there are "normal" sections without tabs. What I also tried: Use cat(paste0("### Number ", i, "{.tabset}\n")) instead of htmltools::h3(...) Look for a possible parameter tabset = TRUE in htmltools::h3 Minimal reproducible example: --- title: "Test" author: "SQC" date: "11 Juli 2019" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE) library(leaflet) ranges <- paste0("section_", c(1:3)) ``` # Title level 1 ```{r, echo

How to type tilde in formulas in RMarkdown

匆匆过客 提交于 2019-12-04 04:52:16
I am trying to type equations on RMarkdown to create a PDF and I want to use a tilde, how can I go about it. I am trying this but throws back a pandoc.exe: Error producing PDF from TeX source .... --- title: "See" date: "24 September 2016" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` follows a Bernouli distribution $$y_i \~ Bernouli(p_i)$$ Hansel Palencia I believe if you do $$ \sim $$ This should produce the ~ you are attempting to place in your formula. 来源: https://stackoverflow.com/questions/39671612/how-to-type-tilde-in-formulas-in-rmarkdown

rmarkdown: how to use multiple bibliographies for a document

只谈情不闲聊 提交于 2019-12-04 04:20:02
[My environment: Win 7 Pro / R 3.2.1 / knitr_1.12.3 / R Studio Version 0.99.892] I am trying to write an article in .Rmd format using R Studio, Knit -> PDF, and I've been following http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html for details of how to get pandoc and pandoc-citeproc to produce a References section and citations in the text. My BibTeX references are in several different .bib files, which, when using LaTeX in .Rnw files, are all found in my local texmf tree via \bibliography{statistics, graphics} I can't seem to make this work with pandoc-citeproc . My

Figure size in R Markdown

和自甴很熟 提交于 2019-12-04 04:13:40
问题 I tried to be careful and thorough, to read various things on the net on how to format figures in R Markdown. They are plotted correctly, but it seems that their size cannot be controlled. Firstly, there are basics, like: ```{r Fig1, echo=FALSE, fig.height=5, fig.width=15} x1 = rnorm(100) x2 = runif(100) x3 = rbeta(100, 1, 1,) par(mfrow=c(1,3), mar=c(4,4,4,1), oma=c(0.5,0.5,0.5,0)) qqnorm(x1) qqnorm(x2) qqnorm(x3) ``` Then, I try a bit more with: ```{r Fig1b, echo=FALSE, fig.height=5, fig

Rmd to PDF compiling error: Package geometry \paperwidth (0.0pt) too short

痴心易碎 提交于 2019-12-04 03:44:05
问题 I am writing a paper in R markdown and need to format it with this .cls file supplied by an academic journal. A minimal .tex file compiles perfectly well with the above cls file. My .tex file (compiled on ShareLaTeX with clv3.cls saved in same directory): \documentclass[shortpaper]{clv3} \usepackage[utf8]{inputenc} \title{Paper title} \author{Name Surname} \date{May 2018} \begin{document} \maketitle \section{Introduction} Some text. \end{document} However a comparable minimal document in R