Different Latex Formatting - R vs Python
Hi,
Thank you for the Python port of the super useful R package stargazer.
I noticed two differences between the R version and the Python port:
(1) Different separator above coefficients
R:

Python

Is there a way to enable the R separator? Or does it require code changes?
(2) R inserts an empty row between variables, which increases readability
| Python | R |
|---|---|
![]() |
![]() |
The R version output is much more readable than the Python ports output. Is there a way to change the Python behavior?
Thanks for your input @nikchha !
(1) Different separator above coefficients Is there a way to enable the R separator? Or does it require code changes?
I don't think there is a way without code changes. On the other hand, I think the R version is just nicer with no drawbacks. So I guess it's worth implementing (not very soon I fear - feel free to provide a PR).
(2) R inserts an empty row between variables, which increases readability The R version output is much more readable than the Python ports output. Is there a way to change the Python behavior?
I agree with you on readability, but the R version takes much more space on the page, which is problematic with large tables (and different from the standard for economists - which is, like it or not, set by Stata). This is why this stargazer by default copies the R behavior with no.space=TRUE.
And to be honest, I'm not a fan of inserting the empty lines - it just doesn't seem the right way to implement spacing in LaTeX. However, it should be trivial to add an optional argument providing the space to leave between coefficients. I'm opening a separate issue for this: #66 .
On the other hand, I think the R version is just nicer with no drawbacks.
... and ironically, it seems like the Python version was like that originally:

Thank you for answering so quickly!
I don't think there is a way without code changes. On the other hand, I think the R version is just nicer with no drawbacks. So I guess it's worth implementing (not very soon I fear - feel free to provide a PR).
It's really funny that someone preferred the current version - perhaps unintentionally. I haven't looked into the code of the Python version in detail yet, but when I find some time I will submit a PR.
And to be honest, I'm not a fan of inserting the empty lines - it just doesn't seem the right way to implement spacing in LaTeX. However, it should be trivial to add an optional argument providing the space to leave between coefficients. I'm opening a separate issue for this: #66 .
I agree with you in #66 - custom spacing with the \[.3cm] is a much better and more flexible approach than the hacky solution from the R stargazer implementation.
Mistake in commit, reopening

