-
Notifications
You must be signed in to change notification settings - Fork 572
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
Conversion to LaTeX of output of colSums()
in R could be improved
#806
Comments
@flying-sheep is this actually a conversion, or is that Latex produced by the R code? If it's doing a conversion, it's using pandoc, which we don't have much control over. |
@takluyver If it's a conversion (I think it is), should I close this and file it with pandoc? |
I've got a feeling that IRkernel creates latex output itself, so it may not
be a conversion. Can you have a look at the raw contents of the ipynb file
and check which formats it has?
…On Sun, 6 May 2018, 3:07 p.m. krinsman, ***@***.***> wrote:
@takluyver <https://github.com/takluyver> If it's a conversion (I think
it is), should I close this and file it with pandoc?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#806 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUA9bq6ZDpz11k0AshRyCWrUQmsimyaks5tvvWYgaJpZM4Tzytk>
.
|
@takluyver Is it possible that this should be filed with IRkernel then? I just want to know what will be most helpful. Anyway, I think this is the code for the relevant output in the .ipynb file, but I'm not 100% certain of my understanding of the JSON structure of the notebook file.
|
Yup, that looks like it. That means that the Latex is being produced by the kernel. The https://github.com/IRkernel/repr If you want to file an issue there, feel free to link to it and close this one. |
Done. Thank you for your help! |
Example: Given an R data frame
data
with columnsever_self_employed
(0 missing entries),log_tot
(0 missing entries), andtreated
(712 missing entries), the output of runningin Jupyter Notebook is converted to
This doesn't look very much like the original output from the notebook.
\_
is necessary for the variable names with underscores to be rendered correctly in LaTeX, the insertion of\textbackslash{}
is not required, and in fact changes the output from what it looked like in the original Jupyter notebook.Here is what I propose as a fix for this specific example:
description*
tolongtable
(longtable
instead oftabular
so that the list breaks over pages when it is very long, as was necessary in another example I hade which was too long for an MWE).\textbf{}
.\usepackage{longtable}
(which is already in the preamble anyway for pandoc support), add another line setting\setlength{\LTleft}{-1cm plus -1fill}
so that the resulting longtable is approximately left-adjusted (the default setting makes the longtable look centered, which is different from its adjustment in the original notebook).&
's and\\
to state the cells and rows of the longtable explicitly.Here is the code I have for this specific example which seems to more faithfully reproduce the output from the original notebook:
Admittedly the
\setlength{\LTleft}{-1cm plus -1fill}
seems to make the table a little too far to the left in some cases.The text was updated successfully, but these errors were encountered: