79507678

Date: 2025-03-13 21:38:11
Score: 0.5
Natty:
Report link

Drawing on this conversation, I was able to resolve the issue on the author's GitHub page as follows:

    ---
    output: 
        pdf_document:
    header-includes:
      - \usepackage{tabularray}
    ---
    
    ```{=latex}
    \DefTblrTemplate{firsthead,middlehead,lasthead}{default}{}
    \DefTblrTemplate{firstfoot,middlefoot}{default}{}
    \DefTblrTemplate{lastfoot}{default}% 
    {
      \UseTblrTemplate{caption}{default}
    }
    ```
    
    ```{r, echo=FALSE}
    library(modelsummary)
    library(tinytable)
    mod <- list()
    mod[['One variable']] <- lm(mpg ~ hp, mtcars)
    mod[['Two variables']] <- lm(mpg ~ hp + drat, mtcars)
    
    modelsummary(mod,
                  title = "Regression Models")|>
      style_tt(tabularray_outer = "label={tblr:test}")
    ```
    
    Table \ref{tblr:test}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Florian Reiche