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

Different Latex Formatting - R vs Python #65

Open
nikchha opened this issue Jan 23, 2021 · 4 comments
Open

Different Latex Formatting - R vs Python #65

nikchha opened this issue Jan 23, 2021 · 4 comments

Comments

@nikchha
Copy link

nikchha commented Jan 23, 2021

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:

image

Python

image

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
image image

The R version output is much more readable than the Python ports output. Is there a way to change the Python behavior?

@toobaz
Copy link
Collaborator

toobaz commented Jan 24, 2021

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 .

@toobaz
Copy link
Collaborator

toobaz commented Jan 24, 2021

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:

@nikchha
Copy link
Author

nikchha commented Jan 24, 2021

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.

@toobaz toobaz closed this as completed in 92c8b73 Jan 27, 2021
@toobaz
Copy link
Collaborator

toobaz commented Jan 27, 2021

Mistake in commit, reopening

@toobaz toobaz reopened this Jan 27, 2021
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

2 participants