cheat-sheet-rmarkdown icon indicating copy to clipboard operation
cheat-sheet-rmarkdown copied to clipboard

Markdown tables: "! LaTeX Error: Environment longtable undefined."

Open jrcalabrese opened this issue 2 years ago • 0 comments

Hi, I found your blogpost on making cheatsheets in RMarkdown and your template for minimizing whitespace/formatting content into multiple columns is exactly what I've been looking for.

I've been trying to use this theme with my own RMarkdown cheatsheet, but I don't think it's compatible with Markdown tables. I'm relatively unfamiliar with LaTeX, but do you know if something be added to template.tex to make it Markdown-table-friendly?

---
title: ""
output:
  pdf_document:
    template: template.tex
---

  # Tables
  
  | Symbol         | Mean        | Symbol         | Meaning                        |
  | :------------- | :---------- | :------------- | :----------------------------- |
  | $\beta_{0}$    | Intercept   | $\sigma$       | Variance                       |
  | $\beta_{1}$    | Slope       | $\sigma^2$     | Standard deviation             |
  
  | Model                      | Formula                                                                                |
  | :------------------------- | :------------------------------------------------------------------------------------- |
  | Intercept Only             | $\operatorname{Y_{i}} = \beta_{0} + \epsilon_{i}$                                      |
  | Simple linear regression   | $\operatorname{Y_{i}} = \beta_{0} + \beta_{1}x_{i} + \epsilon_{i}$                     |
  | Multiple linear regression | $\operatorname{Y_{i}} = \beta_{0} + \beta_{1}x_1{i} + \beta_{2}x_2{i} + \epsilon_{i}}$ |
  
  # Models
  
  $$ 
  \operatorname{Y_{i}} = {\beta}_{1}x_{1i} + {\beta}_{2}x_{2i} + ... + {\beta}_{p}x_{pi} + \epsilon_{i}
  $$

  $$
   \epsilon_{i} \sim_{iid} N(0, \sigma^2)
  $$

> processing file: reprex.Rmd
> output file: reprex.knit.md

> ! LaTeX Error: Environment longtable undefined.

> Error: LaTeX failed to compile reprex.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See reprex.log for more info.
> Execution halted

jrcalabrese avatar Mar 05 '22 21:03 jrcalabrese