NickCH-K / vtable

An R package for creating Variable Documentation Files

Home Page:https://nickch-k.github.io/vtable/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't put 2 st function tables in one Rmarkdown document

Conny42 opened this issue · comments

commented

I really like this package and the nice output. Thanks for creating it.

But I'm having real trouble using the st () table function. Not sure if it's just me, or a bug in the function.

A)When I'm using st() to create a pdf via Rmarkdown, it's only showing one page of my table (which should be on several pages). I posted a question on stackoverflow:

https://stackoverflow.com/questions/66749907/why-is-my-rmarkdown-summary-table-only-showing-on-one-pdf-page-where-is-the-res

B) As I can't create the output in the group.long format, I tried to split it into several st() tables without using group.long. But I can't figure out how to put 2 or more tables in one Rmarkdown (PDF) document. I always get this error:
! LaTeX Error: \caption outside float.

Everything is working fine when knitting to a html file...

Thanks!

Thanks for the Issue!

  1. Answered on StackExchange
  2. Hmm, odd. RMarkdown seems to be escaping characters incorrectly for hte second table, not sure why. I'll look into this a bit later. You can fix this now by going into the TeX code after the fact and replacing \textbackslash begin\{table\}{[}!htbp{]} with \begin{table}[!htbp]. Or just remove the out = 'latex' options - this will default to a knitr::kable version of the table, which naturally RMarkdown knows how to deal with. You will lose a little formatting though.

This is fixed with 228d6f4
Thanks for bringing it up!