You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like to save tables of results in separate scripts and then later import them into the documents I'm writing. To make cross-referencing work, I will have a title argument such as "title = test \\label{tab:stud_reg}". This used to work. I wish I knew when, but at some point this broke and the reason it broke seems to be that modelsummary is adding 5 spaces before the titles in tables saved as txt or md.
This reproduces the problem:
library(modelsummary)
mod <- lm(speed ~ dist, data = cars)
modelsummary(mod,
title = "test",
output = "test.txt")
The first line of test.txt is 5 spaces followed by "Table: test". If I save the output as .md then the first line again is 5 spaces followed by "Table: test". In a markdown file, which I would typically use, the titles are then read as code blocks and this breaks the \label{} portion of the title. It also renders the title like a code block instead of a title.
One other person that I mentioned this to has reproduced it on their machine.
I think this is incorrect behaviour and that the indentation should not be there.
sessionInfo() output
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.5.2
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
I like to save tables of results in separate scripts and then later import them into the documents I'm writing. To make cross-referencing work, I will have a title argument such as "title = test \\label{tab:stud_reg}". This used to work. I wish I knew when, but at some point this broke and the reason it broke seems to be that modelsummary is adding 5 spaces before the titles in tables saved as txt or md.
This reproduces the problem:
The first line of test.txt is 5 spaces followed by "Table: test". If I save the output as .md then the first line again is 5 spaces followed by "Table: test". In a markdown file, which I would typically use, the titles are then read as code blocks and this breaks the \label{} portion of the title. It also renders the title like a code block instead of a title.
One other person that I mentioned this to has reproduced it on their machine.
I think this is incorrect behaviour and that the indentation should not be there.
sessionInfo()
outputR version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.5.2
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: America/Toronto
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] modelsummary_1.4.2
loaded via a namespace (and not attached):
[1] httr_1.4.7 svglite_2.1.1 cli_3.6.1
[4] knitr_1.44 rlang_1.1.1 xfun_0.40
[7] stringi_1.7.12 generics_0.1.3 glue_1.6.2
[10] backports_1.4.1 colorspace_2.1-0 performance_0.10.5
[13] htmltools_0.5.6 parameters_0.21.2 datawizard_0.9.0
[16] scales_1.2.1 rmarkdown_2.25 evaluate_0.21
[19] munsell_0.5.0 kableExtra_1.3.4 fastmap_1.1.1
[22] lifecycle_1.0.3 stringr_1.5.0 insight_0.19.5
[25] compiler_4.3.1 rvest_1.0.3 rstudioapi_0.15.0
[28] systemfonts_1.0.4 digest_0.6.33 viridisLite_0.4.2
[31] R6_2.5.1 magrittr_2.0.3 checkmate_2.2.0
[34] webshot_0.5.5 tools_4.3.1 bayestestR_0.13.1
[37] tables_0.9.17 xml2_1.3.5
The text was updated successfully, but these errors were encountered: