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

Support resizebox for etable #520

Open
matthewgson opened this issue Jul 24, 2024 · 5 comments
Open

Support resizebox for etable #520

matthewgson opened this issue Jul 24, 2024 · 5 comments

Comments

@matthewgson
Copy link

I would like to express my gratitude for the exceptional work you have done on this project.

Although I'm aware adjustbox is more flexible and has powerful features compared to similar resizebox, I've been somewhat more successful with resizebox when it comes to adjusting the tables in my paper. I was wondering if there's any chance this option could be added for regression tables (etable)?

@waynelapierre
Copy link

waynelapierre commented Jul 25, 2024

etable already has so many arguments.
You only need to add one line of LaTeX code to make your tables fit...
\resizebox{\linewidth}{!}
{
your table
}

@matthewgson
Copy link
Author

matthewgson commented Jul 25, 2024

@waynelapierre It's not something you want to do if you have many tables and want to set it programmatically.

@waynelapierre
Copy link

@matthewgson Sure, if you need more granular control of the table layout, wouldn't it make more sense to tune LaTeX codes than to make etable even more bloated?

@etiennebacher
Copy link

etiennebacher commented Jul 26, 2024

It's not something you want to do if you have many tables and want to set it programmatically.

Sure, but you could make your own helper function that takes the output of etable() and wraps it in the resizebox call. That way, you can just add a function call after etable():

wrap_in_resizebox <- function(x) {
  paste0("\\\resizebox{\\\linewidth}{!}{\n", x, "\n}")
}

etable(..., tex = TRUE) |>
  wrap_in_resizebox() |>
  writeLines(file = "output.tex")

(I didn't try this code, but this idea should work)

@matthewgson
Copy link
Author

@waynelapierre Not really. I think it is a simple change from the current flow that won't make it bloated if it ever were. etable is designed to be the finalizer of the workflow, not the pipeline I don't think it would be a design problem either. It's completely up to the maintainer's view.

@etiennebacher The resizebox should be inside the table boundary and it's pretty messier than it seems. Of course, there should be a way to augment them similar to your suggestion, but adding them similar to adjustbox would be greater.

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

No branches or pull requests

3 participants