1

Regarding the following latex table, I would like to add footnotes to define the * in the last column. For example, The * refers to Parametric Model, ** semi-parametric and *** non-parametric, and the distance between the table and the footnote is the minimum possible.

\noindent\begin{tblr}{
  colspec={@{}l|[white]Xc@{}},
  hline{1,Z}={wd=1.2pt},
  hline{2}={wd=0.4pt},
  cell{2-Z}{2}={mode=imath}
}
Number  &  Model & Type\\
Model 1 &  \text{BC\_WS} = \beta _0 + \beta _1\cdot {\text{M\_WS}} + \epsilon & *\\
Model 2 &  \text{BC\_WS} = \beta _0 + f(\text{M\_WS}) + \epsilon & *** \\
Model 3 &  \text{BC\_WS} = \beta _0 + \beta _1\cdot W\_WS+ \beta _2\cdot \text{\text{W\_Direction}}+  \beta _3\cdot \text{Temperature} + \beta _4\cdot \text{Pressure}  + \epsilon &  *\\
Model 4 &  \text{BC\_WS} = \beta _0 + f(\text{M\_WS})+  f(\text{W\_Direction})+ f(\text{Temperature}) + f(\text{Pressure})  + \epsilon & *** \\
Model 5 &  \text{BC\_WS} =\beta _0 + \beta _1\cdot (\text{M\_WS})+  f(\text{W\_Direction})+ f(\text{Temperature}) + f(\text{Pressure})  + \epsilon & **\\
Model 6 &  \text{BC\_WS} = \beta _0 + \beta _1\cdot \text{M\_V}+ \beta _2\cdot \text{M\_V}+  \beta _3\cdot \text{Temperature} + \beta _4\cdot \text{Pressure}  + \epsilon &  *\\
Model 7 &  \text{BC\_WS} = \beta _0 + f(\text{M\_V})+ f(\text{M\_V})+ f(\text{Temperature}) + f(\text{Pressure})  + \epsilon & ***\\
\end{tblr} 

enter image description here

Abbas
  • 807
  • 7
  • 14

1 Answers1

2

Use long tables (longtblr environment) and for table-footnotes use note{} = {table note ....} option.


---
title: "footnotes"
output: pdf_document
header-includes:
  - \usepackage{tabularray}
---


## R Markdown


\noindent\begin{longtblr}[
  note{} = { * Parametric ** Semi-parametric *** Non-parametric}
]{
  colspec={@{}l|[white]Xc@{}},
  hline{1,Z}={wd=1.2pt},
  hline{2}={wd=0.4pt},
  cell{2-Z}{2}={mode=imath}
}
Number  &  Model & Type\\
Model 1 &  \text{BC\_WS} = \beta _0 + \beta _1\cdot {\text{M\_WS}} + \epsilon & *\\
Model 2 &  \text{BC\_WS} = \beta _0 + f(\text{M\_WS}) + \epsilon & *** \\
Model 3 &  \text{BC\_WS} = \beta _0 + \beta _1\cdot W\_WS+ \beta _2\cdot \text{\text{W\_Direction}}+  \beta _3\cdot \text{Temperature} + \beta _4\cdot \text{Pressure}  + \epsilon &  *\\
Model 4 &  \text{BC\_WS} = \beta _0 + f(\text{M\_WS})+  f(\text{W\_Direction})+ f(\text{Temperature}) + f(\text{Pressure})  + \epsilon & *** \\
Model 5 &  \text{BC\_WS} =\beta _0 + \beta _1\cdot (\text{M\_WS})+  f(\text{W\_Direction})+ f(\text{Temperature}) + f(\text{Pressure})  + \epsilon & **\\
Model 6 &  \text{BC\_WS} = \beta _0 + \beta _1\cdot \text{M\_V}+ \beta _2\cdot \text{M\_V}+  \beta _3\cdot \text{Temperature} + \beta _4\cdot \text{Pressure}  + \epsilon &  *\\
Model 7 &  \text{BC\_WS} = \beta _0 + f(\text{M\_V})+ f(\text{M\_V})+ f(\text{Temperature}) + f(\text{Pressure})  + \epsilon & ***\\
\end{longtblr}


tabularray long table with table-notes


See the chapter 4 of this tabularray documentation for more a complete example with many more options.

shafee
  • 15,566
  • 3
  • 19
  • 47
  • Is there any way to put them horizontally instead of stacking them vertically? – Abbas Aug 20 '22 at 15:54
  • 1
    @Abbas, see the update – shafee Aug 20 '22 at 16:38
  • The problem with the current solution is that it produces a caption automatically, which is so close to the table, as you can see as "Table 1:". I there any way to increase the distance between the caption and the table? – Abbas Aug 20 '22 at 18:33
  • @Abbas, if you want to remove them, see the answer of this https://stackoverflow.com/questions/71169502/how-to-remove-contfoot-conthead-caption-in-longtblr-package – shafee Aug 21 '22 at 10:09