fixest icon indicating copy to clipboard operation
fixest copied to clipboard

Support resizebox for etable

Open matthewgson opened this issue 1 year ago • 5 comments

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)?

matthewgson avatar Jul 24 '24 15:07 matthewgson

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 }

waynelapierre avatar Jul 25 '24 17:07 waynelapierre

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

matthewgson avatar Jul 25 '24 17:07 matthewgson

@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?

waynelapierre avatar Jul 25 '24 17:07 waynelapierre

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)

etiennebacher avatar Jul 26 '24 07:07 etiennebacher

@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.

matthewgson avatar Jul 29 '24 21:07 matthewgson