1

Given the following code, I would like to remove the colours and add a third column including *, **, *** to show the grouping of, for example, 2,4 and 7 and... and then in the footnote what each start group mean.

\documentclass{article}

\usepackage{geometry}
\usepackage{xcolor}
\usepackage{tabularray}

\begin{document}

\begin{tblr}{
  colspec={l|[white]l},
  cell{1}{2}={halign=c},
  rows={bg=lightgray},
  row{1}={bg=brown!80,fg=white,font=\bfseries},
  row{2}={bg=brown!80!black,fg=white},
  row{4}={bg=brown!80!black,fg=white},
  row{6}={bg=brown!80!green,fg=white},
  row{7}={bg=brown!80!black,fg=white},
}
Number  &  Model \\
\hline[white,wd=1pt]
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 M\_U+ \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(M\_U)+ f(\text{M\_V})+ f(\text{Temperature}) + f(\text{Pressure})  + \epsilon\)
\end{tblr}    




\end{document}

The output from the code above looks like this: enter image description here

I tried to remove the, for example, row{2}={bg=brown!80!black,fg=white}, to remove the colouring, but I received the following error:

! Paragraph ended before \environment tblr  was complete.
<to be read again> 
                   \par 
l.113 

I want the output to look like this with footnotes about the stars(header row and first column are aligned centre, the remaining are aligned left): enter image description here

Abbas
  • 807
  • 7
  • 14

1 Answers1

1

The error has nothing to do with the row colours, you are missing the amsmath package. Without this package you can't use the \text{...} macro.

\documentclass{article}

\usepackage{geometry}
\usepackage{xcolor}
\usepackage{tabularray}
\usepackage{amsmath}

\UseTblrLibrary{booktabs}

\begin{document}

\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 & LM*\\
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 &  LM*\\
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 M\_U+ \beta _2\cdot \text{M\_V}+  \beta _3\cdot \text{Temperature} + \beta _4\cdot \text{Pressure}  + \epsilon &  LM*\\
Model 7 &  \text{BC\_WS} = \beta _0 + f(M\_U)+ f(\text{M\_V})+ f(\text{Temperature}) + f(\text{Pressure})  + \epsilon&\\
\end{tblr}    

\end{document}

enter image description here

  • What part of the code should I change to 1- make the upper and lower borders thinner and the second border thicker as in the picture sent in the question? and 2- How to make the word "Model" alined center – Abbas Aug 15 '22 at 12:50
  • 1
    Normally top/bottom rule should be wider than the midrule. Everything else will look very odd – samcarter_is_at_topanswers.xyz Aug 15 '22 at 12:51
  • Having `Model` centred already looked strange in the previous question. If the rest of the column is left aligned, the header should be, too! – samcarter_is_at_topanswers.xyz Aug 15 '22 at 12:52
  • Ok, will keep it. Since I want to create a table for the model statistics the same as the third table in the reference you sent earlier (http://betterposters.blogspot.com/2012/08/the-data-prison.html), I would like to extend this table and wold be thankful if you let me know how can I do that generally – Abbas Aug 15 '22 at 12:55
  • How can I add footnotes? @samcarter_is_at_topanswers.xyz – Abbas Aug 20 '22 at 13:50
  • @Abbas You can add footnotes by asking a new question. Each question on stackoverflow should be about a single problem. It does not work well if you ask multiple unrelated questions in one post. – samcarter_is_at_topanswers.xyz Aug 20 '22 at 13:53
  • Ok, I did so. @samcarter_is_at_topanswers.xyz – Abbas Aug 20 '22 at 14:26