Table spacing issue converting to PDF via LaTeX with pandoc

前端 未结 1 333
北荒
北荒 2021-01-23 16:24

I\'m facing the issue that in R texreg() doesn\'t seem to break the lines in the notes below the table. Also the margins between the models are not extended equally

相关标签:
1条回答
  • 2021-01-23 17:02

    Here I gladly quote the great answer I received from Fran at https://tex.stackexchange.com/.

    According to him the custom note ends in a \multicolumn in the LaTeX code. Thus we cannot use line break commands like par or \\. But we can achieve the automatic line break with \parbox. If we still want a custom line break we can use four backslashes \\\\. For better formatting we use \\vspace{2pt}. To give even the Coefficients and the GOFs more space we can add \renewcommand\arraystretch{1.3} (default is 1) right before the R chunk:

    \renewcommand\arraystretch{1.3}  
    
    ```{r results="asis", echo = TRUE, comment = FALSE, message = FALSE}
    
    library(texreg)
    texreg(list(lm1, lm2, lm3), custom.note = "\\parbox{.4\\linewidth}
    {\\vspace{2pt}Lorem ipsum dolor sit amet, consetetur sadipscing elitr, 
    sed diam nonumy eirmod tempor invidunt ut labore et dolore magna 
    aliquyam. \\\\ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, 
    sed diam nonumy eirmod tempor invidunt ut labore et dolore magna 
    aliquyam. \\\\ %stars.}")
    
    ```
    

    0 讨论(0)
提交回复
热议问题