1

I am generating regression output tables from several regression models using the TexReg package in R Markdown. Is there a way to supply texreg with both long and short captions?

When writing in straight LaTeX, I can do \caption[short caption for ToC]{Longer caption in document}. However, when attempting to automate the process in TexReg, I can only get it to let me supply the long caption.

i.e.

t1 <- texreg(list(mod_1, mod_2),
caption = 'Brief Description')

becomes \caption{Brief Description} but

t1 <- texreg(list(mod_1, mod_2),
caption = '[Brief Description]{Long Description}')

becomes \caption{[Brief Description]{Long Description}}.

I have tried supplying TexReg with vectors of character strings and lists but that doesn't seem to work either...

kww_AU
  • 11
  • 1
  • I think this is currently not implemented. But feel free to add this functionality in a pull request on [GitHub](https://github.com/leifeld/texreg/pulls), and I am happy to consider your request there. It would need to be added to the code on four occasions between lines [3356](https://github.com/leifeld/texreg/blob/92e393131f5d6c0f75fbfc3934567d36032e626a/R/texreg.R#L3356) and [3634](https://github.com/leifeld/texreg/blob/92e393131f5d6c0f75fbfc3934567d36032e626a/R/texreg.R#L3634) in `texreg.R`. Ideally with an updated help entry and a unit test in `/tests/testthat/test-texreg.R`. – Philip Leifeld Sep 01 '21 at 14:07
  • I'm not familiar with the texreg package, but you might have a look if a solution like the one in [this question](https://stackoverflow.com/questions/69094228/give-a-single-figure-multiple-captions-in-rmarkdown-pdf-book-output) helps. – All Downhill From Here Sep 08 '21 at 06:49

0 Answers0