Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing to a beamer presentation does not work #109

Closed
rich-iannone opened this issue Dec 15, 2018 · 2 comments
Closed

Publishing to a beamer presentation does not work #109

rich-iannone opened this issue Dec 15, 2018 · 2 comments

Comments

@rich-iannone
Copy link
Member

Currently, we cannot include a gt table inside of a beamer presentation. Doing so results in an error code that is uninformative.

Issue originally discovered and suggested by @tareefk .

@emmadehaan
Copy link

emmadehaan commented Dec 16, 2019

I have a solution for the beamer output with rmarkdown whenever you obtain the following error:

! Undefined control sequence.
\beamer@doifinframe ...meslide}\par \captionsetup 
                                                  [table]{labelformat=empty,...
l.110 \end{frame}

This was the case for me when I would add the gt package and output/print a table within an r-block with gt().

What solved the issue was to add the following code to the preamble:

header-includes:
- \usepackage{booktabs}
- \usepackage{caption}
- \usepackage{longtable}
- \makeatletter
- \let\@@magyar@captionfix\relax
- \makeatother

thus, to clarify with an example:

---
title: "Test"
author: "Author"
date: "12/16/2019"
output: beamer_presentation
header-includes:
- \usepackage{booktabs}
- \usepackage{caption}
- \usepackage{longtable}
- \makeatletter
- \let\@@magyar@captionfix\relax
- \makeatother
---

```{r test, echo = FALSE, message = FALSE, warning = FALSE}
library(tidyverse)
library(gt)
datasets::mtcars %>% 
 utils::head() %>% 
 dplyr::select(mpg, cyl) %>%
 gt::gt() %>% 
 gt::fmt_number(dplyr::everything())
``` ## remove ##, there for the ``` as i cannot figure out how to escape them

Solution and reasoning for the pre-amble found in this discussion

@rich-iannone rich-iannone added this to the FUTURE milestone Aug 22, 2022
@setgree
Copy link

setgree commented Jun 7, 2024

Hi there, it looks like this was an Rstudio-internal discussion, and thus it's missing a bit of the context (and the reproducible examples) that I would normally look to for debugging. is it possible to get a bit more explanation of the issue and why it occurred? I am having a hell of a time getting my gt(0 tables to knit in a beamer document and I swear it was working as recently as two days ago. Thanks!

I have the header you suggested and I'm getting the following errors (I have tinytex.verbose set to TRUE)

tlmgr search --file --global '/bkm-pdftex.def'
Trying to automatically install missing LaTeX packages...
tlmgr install bookmark
tlmgr: package repository https://ctan.math.illinois.edu/systems/texlive/tlnet (verified)
tlmgr install: package already present: bookmark
This is LuaHBTeX, Version 1.18.0 (TeX Live 2024) 
 restricted system commands enabled.
tlmgr search --file --global '/bkm-pdftex.def'
! Undefined control sequence.
\@currentHref ->table.\theHtable 

Error: LaTeX failed to compile vegan-meta-presentation.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See vegan-meta-presentation.log for more info.
Execution halted```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants