I've created a table using R kableExtra. but would like to be able to control the Notes section of the table manually in LATEX. Thus, I use the \include{table.tex} command to bring in the outputted table. Unfortunately, if I write:
\documentclass[12pt]{article}
\usepackage{longtable}
\begin{document}
\include{table.tex}\footnotesize{Note: this is a note.}
\end{document}
I get a huge indent after the table, and on the next page only, it says "this is a note".
The table.tex
file looks like so:
\begingroup\fontsize{8}{10}\selectfont
\begin{longtable}{|c|c|c|c|}
\caption{A simple longtable example}\label{tab:thetable}\\
\hline
\textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\
\hline
\endfirsthead
\multicolumn{4}{c}%
{\tablename\ \thetable\ -- \textit{Continued from previous page}} \\
\hline
\textbf{First entry} & \textbf{Second entry} & \textbf{Third entry} & \textbf{Fourth entry} \\
\hline
\endhead
\hline \multicolumn{4}{r}{\textit{Continued on next page}} \\
\endfoot
\hline
\endlastfoot
1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\ 1 & 2 & 3 & 4 \\
\end{longtable}
\endgroup{}
I have tried wrapping everything in a minipage
, but because I establish my captions and labels for the table inside kableExtra
, it resides in table.tex. Thus, I'm unable to reference that table, since I cannot have a table inside a minipage.
Someone please help!
\include{table.tex}
with\input table
?\footnotesize
is a switch, i.e., it does not take an argument delimited by curly braces. If you want to limit the scope of the\footnotesize
directive to the sentence "Note: this is a note.", you should write{\footnotesize Note: this is a note.}
.