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

Add Beamer to Flextable's Supported Formats? #428

Open
thatchermo opened this issue Jul 22, 2022 · 5 comments
Open

Add Beamer to Flextable's Supported Formats? #428

thatchermo opened this issue Jul 22, 2022 · 5 comments

Comments

@thatchermo
Copy link

I didn't see this feature requested anywhere, so thought I'd suggest it. I noted today that flextable doesn't seem to work with Beamer slides, but does with with PDF output. Since both are LaTeX format, it seems that it might not be too hard to add support for Beamer, although I've often found that "it might not be too hard" is optimistic---there's often a good reason it hasn't been done if it hasn't been done.

In any case, I did find that if I edited the printers.R file to change line 138 from

} else if (grepl("latex", opts_knit$get("rmarkdown.pandoc.to"))) {

to

} else if (grepl("latex|beamer", opts_knit$get("rmarkdown.pandoc.to"))) {`

then I got "mostly" working functionality with format: beamer in Quarto and output: beamer_presentation in R Markdown. I needed to add \usepackage{hhline} by hand to the beginning of the Beamer document. It looks like there might be functionality in Flextable to do that, but I haven't delved that deep yet. I also had an intermittent issue with frames needing to be set as "fragile" in order to compile in xelatex. It didn't happen in my small test examples, but only in my bigger documents, so hard to give a small reproducible example for testing. But, in any case, writing

## New Slide {.fragile}

in the quarto document fixed that problem.

So, I'm very happy that I have a functional solution for myself, as long as I'm willing to add a few tweaks, but thought I'd pass the suggestion along. Thanks for making seemingly the only table package that lets me make a cross-format table with both equations and hlines where I want them!

@davidgohel

This comment was marked as outdated.

@davidgohel davidgohel added the need for further details Issue need more details to be understood label Jul 22, 2022
@davidgohel

This comment was marked as outdated.

@thatchermo
Copy link
Author

Very interesting! I submitted this because I was getting no table output at all in Beamer yesterday. My test file worked in PDF, HTML, PPTX and DOCX, so I assumed Beamer just wasnt supported, especially after seeing "latex", but not "beamer" mentioned explicitly in flextable_to_rmd. Sorry for making the wrong assumption.

Yesterday, I was on someone else's computer, but today on my computer, your code above and my test code from yesterday produce tables as images, which looks like what would be expected. I'll have to see what was up on that other machine, and if I find anything that actually looks like a bug, I'll submit it with a minimal code example.

I could see keeping this as a feature request, since natively-generated tables in Beamer would likely be preferable to images, if there weren't too many obstacles to overcome. If I go further than experimentally changing one line of code, I'll submit the changes back for consideration, but that might be beyond my skill level.

In any case, Thanks!

@davidgohel
Copy link
Owner

Let's keep that open and try to support beamer

Your issue on the other computer is probably due to the fact that webshot is not installed.

I may take some weeks before we work on this..

@davidgohel davidgohel added enhancement and removed need for further details Issue need more details to be understood labels Jul 22, 2022
@dr-phuong

This comment was marked as spam.

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