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

Displaying arrows in latex tables #59

Closed adampeg closed 6 years ago

adampeg commented 6 years ago

Thank you very much for your hard work on Huxtable. It's a really great package.

I was wondering whether the package supports presenting up and down arrows in to table cells in pdf latex tables. I have tried to do so by placing the latex code \uparrow and \downarrow in the data frame where appropriate, with no success. I wondered whether you know of a solution, or whether there is any documentation out there already on this?

Many thanks,

Adam

hughjonesd commented 6 years ago

?escape_contents -- Sent from Gmail Mobile

adampeg commented 6 years ago

Thank you for such a quick response. I am extremely pleased to report that my problem is now solved.

For future viewers of this issue, you can recode data frame values as latex symbols, for example, like this:

BM$Change[BM$Change == 1] <- paste0('$\uparrow$') BM$Change[BM$Change == -1] <- paste0('$\downarrow$')

To display the symbol correctly, make sure that the set_escape_contents = FALSE for the related table column, for example:

set_escape_contents(everywhere, 6, FALSE)

Thanks again! and thanks for a great package