All Questions
773
questions
2
votes
0
answers
45
views
how to automatically align arabic text in R-Markdown document and tables
I'm currently working on a bilingual Arabic and English report using xelatex engine. I've included these in my R-Markdown YAML header so that arabic letters combine properly to create a word.
---
...
0
votes
0
answers
28
views
\mathcal{P} will show in preview but not the knitted html file of an .Rmd file (R markdown)
\mathcal{P} will show in preview but not the knitted html file of an .Rmd file (R markdown). Here's the code:
---
title: "xxx"
author: "yyy"
date: "2024-zz-ww"
output: ...
0
votes
1
answer
45
views
How to use Rmarkdown with natbib citation package?
I am trying to write a PDF article in Rmarkdown, and want to include a scientific bibliography using the latex natbib citation package.
Unfortunately, I get an error message.
This is a minimum example ...
1
vote
0
answers
21
views
How to properly deal with the working dir with knitr when R and LaTeX docs have different paths?
I have the following basic path structure:
project/
project/Rscripts/
project/LaTeX/
In my project/Rscripts/ dir, I have a main script that I source() in my main LaTeX doc in from project/LaTeX/. ...
1
vote
1
answer
48
views
How to show pipe character in kableExtra table in PDF?
I found a nice explanation of data validation on RPubs: https://rpubs.com/techanswers88/validate-data-in-r. I have tried to reproduce the steps in an R notebook. All the steps work perfectly until I ...
0
votes
0
answers
194
views
LaTeX error : use of \@startpbox doesn't match its definition - TinyTex in R?
I'm using the tiny_tex package in R to generate a LaTeX document from a .Rnw file (Sweave) - I can produce basic LaTeX outputs, however when trying to make something more complex with the color.sty ...
1
vote
1
answer
164
views
Plots showing \begin{figure} and \caption{"XXX"} when knitting to pdf
When I knit to a pdf in markdown, I am having the raw LaTex commands show in the pdf. Any idea what's going on? I've tried changing the captions and alignment, but all the text after this figure in ...
0
votes
1
answer
105
views
When knitting .rmd files to .pdf in RStudio, how do I give a different background colour to the output and echos?
I have been able to provide a colour to output chunks by following this solution. How do I make it so that the output chunks are a different colour to the code chunks? Also, how do I provide a ...
2
votes
0
answers
643
views
Did I break R markdown? Every file I try gives the error "! Undefined control sequence. l.128 \cs_new:Npe \__color_backend_devicen_colorants:n #1
I have an R markdown file that a former coworker wrote, and it worked fine until I made some edits. Suddenly I couldn't compile the pdf, and even scripts that were previously working gave the same ...
0
votes
0
answers
37
views
How to hyphenate text in the a TextField in an RMarkdown fillable PDF?
I am creating a fillable PDF form in RMarkdown and have a TextField. Below is an example of my script-
---
title: Project Form
geometry: paperheight=11in,paperwidth=8.5in,margin=1in
output:
...
1
vote
0
answers
71
views
Print big r matrix in Latex with Sweave, knitr or Rmd
Printing big r matrix in Latex. I came out with this function which loops over rows.. is there any smarter way to do it?
Is there a way to create a loop in Latex syntax?
\documentclass{article}
\...
0
votes
0
answers
16
views
kable() function for long tables prints unnecessary lines when knitting with rmarkdown
I ran the following code in a R code chunk.
library(knitr)
library(kableExtra)
library(tidyverse)
long_dt <- rbind(mtcars, mtcars, mtcars)
kable(
long_dt,
format = "latex",
...
0
votes
1
answer
1k
views
knit pdf in rmarkdown: LaTeX installation
I have an rmd file in RStudio that I've successfully knitted as html, but pdf is required. When I changed the output to pdf, I got a 'No LaTeX installation detected' error so I ran
install.packages('...
1
vote
0
answers
29
views
devtools::check() failing due to percent sign in table generated by code chunk in R function documentation
I am writing function documentation for an R package and I am including the following code chunk in said documentation:
#' Function title
#'
#' Function description
#'
#' @section My Section:
#'
#' ...
6
votes
2
answers
764
views
Making two sided Pretty PDFs with Quarto
(Disclaimer: I borrowed the most code from Making Pretty PDFs with Quarto.)
My code works fine with classoption: [oneside] but have issues with classoption: [twoside].
How can I correctly render it?
--...