[Tex/LaTex] lyx table footnote

footnoteslyxtables

I have the table below, in LyX. How can I add text that hugs the bottom line and I want it to be very small text, smaller than the font in the table.

\begin{table}
\begin{tabular}{c c c c c c c}
\hline
& \multicolumn{2}{c}{Model 1}&\multicolumn{2}{c}{Model 2}&\multicolumn{2}{c}{Model 3}\\
\hline
\hline
Variable 1 & 12.758 & *** &  13.822 & *** & 2.123 & ***\\
\hline
\fontsize{4}{4} \selectfont Blah Blah Blah and * $p \le 0.05$, ** $p \le 0.01$, *** $p \le 0.001$.
\end{tabular}
\end{table}

This works but there is white space between table end and footnote

Best Answer

Always supply a complete, compilable document.

If you really want to use \texit, you have to load \usepackage[T1]{fontenc} in your preamble so that the < will render correctly. Or you can just put the whole thing in math environment and use \mathit instead.

Here is one method.

%\documentclass[10pt]{article}
\documentclass[preview,convert,border=5]{standalone}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{c c c c c c c}
\toprule
& \multicolumn{2}{c}{Model 1}&\multicolumn{2}{c}{Model 2}&\multicolumn{2}{c}{Model 3}\\
\midrule
Variable 1 & 12.758 & *** &  13.822 & *** & 2.123 & ***\\
\bottomrule
\multicolumn{7}{r}{\footnotesize$\mathit{*p < 0.05, ** p < 0.01, *** p < 0.001}$}\\
\end{tabular}
\end{document}

enter image description here

However, I don't like how the asterisks are separated from the p-values so I suggest that you eliminate some columns. This is what I did in the next method with the use of threepartable package. (There is also a threeparttablex package.)

%\documentclass[10pt]{article}
\documentclass[preview,convert,border=5]{standalone}
\usepackage{booktabs}
\usepackage[para]{threeparttable}
\begin{document}
\begin{table}
\centering
\caption{\label{tab:1} Your table}
\begin{threeparttable}
\begin{tabular}{c c c c c c c}
\toprule
& Model 1 & Model 2 & Model 3\\
\midrule
Variable 1 & 12.758\tnote{***} &  13.822\tnote{***} & 2.123\tnote{***}\\
\bottomrule
\end{tabular}
\begin{tablenotes}\footnotesize
\item [*] $p<0.05$
\item [**] $p<0.01$
\item [***] $p<0.001$
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{document}

enter image description here

Update

I have included \renewcommand{\arraystretch}{0.5} inside a scope to make the effect local. I have replaced \footnotesize with \tiny but it's up to you if you want to resort to a smaller font size. (Just a caution: be kind to your eyes. :)

%\documentclass[10pt]{article}
\documentclass[preview,convert,border=5]{standalone}
\usepackage[T1]{fontenc}
\usepackage{threeparttable}
\usepackage{booktabs}
\begin{document}
{\renewcommand{\arraystretch}{0.5}
\begin{threeparttable}
\begin{tabular}{c c c c}
\toprule
& Model 1 & Model 2 & Model 3\\
\midrule
Variable 1 & 12.758\tnote{***} &  13.822\tnote{***} & 2.123\tnote{***}\\
\bottomrule
\multicolumn{4}{r}{\tiny *$\mathit{p < 0.05}$, ** $\mathit{p < 0.01}$, *** $\mathit{p < 0.001}$}\\
\end{tabular}
\end{threeparttable}
}
\end{document}

enter image description here