Open ghost opened 2 years ago
although the LaTeX appears to be correct
Did you test the equation already ? It seems using \text{}
with \sum
does not work in LaTeX. I tried this smaller reprex
---
title: "Untitled"
author: "TEST"
date: "2/28/2022"
output:
pdf_document:
keep_tex: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
This code does not run
$$ \sum \text{nsales}{i,c} $$
If you escape the underscore `_` using `\_`, your equation seems to render ok.
````markdown
$$
lift_{i,c}=\frac{\frac{\sum n\_sales_{i,c}}{\sum n\_impressions_{i,c}}}{\frac{\sum n\_sales_{i,FR}}{\sum n\_impressions_{i,FR}}}-1
$$
I don't know if this is a LaTeX math limitation or conflict. Maybe there is another way to write a sum with \text{}
Hi,
I'm struggling to render this .Rmd file to a pdf_latex, although the LaTeX appears to be correct
This code does not run
$$lift_{i,c}=\frac{\frac{\sum \text{nsales}{i,c}}{\sum \text{nimpressions}{i,c}}}{\frac{\sum \text{nsales}{i,FR}}{\sum \text{nimpressions}{i,FR}}}-1$$
<...>
/usr/lib/rstudio/bin/pandoc/pandoc +RTS -K512m -RTS test.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output test.tex --lua-filter /home/pc/R/x86_64-pc-linux-gnu-library/4.1/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /home/pc/R/x86_64-pc-linux-gnu-library/4.1/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --variable 'geometry:margin=1in' output file: test.knit.md
! Missing $ inserted.