hughjonesd / huxtable

An R package to create styled tables in multiple output formats, with a friendly, modern interface.
http://hughjonesd.github.io/huxtable
Other
321 stars 28 forks source link

huxreg notes don't wrap in LaTeX #164

Closed ramattheis closed 4 years ago

ramattheis commented 4 years ago

Describe the bug

print_latex doesn't wrap long notes in huxreg tables.

Minimal Reproducible Example

longnote = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ipsum nulla, pellentesque eu tellus eu, sodales congue nulla. Sed varius lacus ac nisl rutrum, id feugiat odio facilisis. " data(diamonds, package = "ggplot2") huxreg(lm(price~carat,diamonds), note = longnote) %>% print_latex()

Expected behavior

Long table notes should be inside of a tablenotes environment, as in earlier versions, and not in a \multicolumn.

System details

packageVersion("huxtable") [1] ‘5.0.0’

hughjonesd commented 4 years ago

The reason for this is that in version 5.0.0, width is no longer set. Set width and you will find the note wraps. Huxtable has never used tablenotes, incidentally, though perhaps it should.