fix centering when using threeparttable
When threeparttable=T and a caption is set the table is not being centered on page. In order for the table to be centered on the page, \centering needs to be before \begin{threeparttable}. Right now, \centering is being put after \caption and the deleted lines insert \begin{threeparttable} between the two. By removing those lines, \being{threeparttable} is inserted after centering, but before \begin{tabular}. This results in the table being centered on page.
diff --git a/R/footnote.R b/R/footnote.R
index 066e96f..d67382b 100644
--- a/R/footnote.R
+++ b/R/footnote.R
@@ -204,15 +204,10 @@
footnote_text <- latex_tfoot_maker(footnote_table, footnote_as_chunk,
table_info$ncol, threeparttable)
if (threeparttable) {
- if (grepl("\\\\caption\\{.*?\\}", out)) {
- out <- sub("\\\\caption\\{", "\\\\begin{threeparttable}\n\\\\caption{",
- out)
- } else {
out <- sub(paste0("\\\\begin\\{", table_info$tabular, "\\}"),
paste0("\\\\begin{threeparttable}\n\\\\begin{",
table_info$tabular, "}"),
out)
- }
out <- sub(table_info$end_tabular,
paste0("\\\\end{", table_info$tabular,
"}\n\\\\begin{tablenotes}",