I was wondering, whether it is possible to align text on both sides in notes using modelsummary. It would be great if the note would look similar to notes in this paper https://www.econ.uzh.ch/dam/jcr:a68d7a76-93af-4ceb-86aa-344d6ee8d0c6/dodging%20the%20taxman%20AEJ%20Applied.pdf (in particular similar to that on page 151).
In markdown notes look fine. Once I export to .tex the text is somewhat misaligned.
Here is the code that I used.
library("modelsummary")
#small example:
x<-rnorm(5)
y<-rnorm(5)
modelsummary(list(lm(y~x),lm(y~x)),notes = "this is my very very very very very very long note this is my very very very very very very long note",output = "test.tex")
				
                        
The default output for the
modelsummaryfunction is a table drawn by thekableExtrapackage. It looks likekableExtrasupports the LaTeXthreeparttablepackage which, I believe, allows you to left-and-right justify footnotes. To learn how to customizekableExtratables, I strongly recommend you read the excellent LaTeX-focused vignette which can be found on thekableEtrawebsite.If you don't like the default footnotes supplied by
modelsummary, for example, you can create your own using thefootnotefunction fromkableExtra. To do this, you need to specify"latex"as your output format, then apply thefootnotefunction, then finally save the table withsave_kable.This code should bring you very close to the desired result, but note that
kableExtraallows lots of ways to customize almost everything about your table: