2

I used the option si={table-format=3.4} because I will have integers in the range of hundreds and as many as four decimals, yet neither the decimals nor the ranges are arranged.

What could I be missing?

\documentclass{scrartcl}
\usepackage[margin=20mm]{geometry}

\usepackage{pdflscape}
\usepackage[version=4]{mhchem}
\usepackage{xcolor}
\definecolor{dark-blue}{RGB}{28, 69, 135}
\definecolor{purple}{rgb}{.82, .1, .26}
\definecolor{tableLineOne}{RGB}{255, 253, 233}
\definecolor{tableLineTwo}{RGB}{255, 250, 194}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\NewTableCommand\panelsteel{
    \SetCell[c=8]{c,bg=purple,fg=white}}    

\begin{document}
\begin{landscape}
    \begin{longtblr}[
        caption = {Minimal booktabs example.},
        label = {tab:table1}
        ]{
            colspec = {*{8}{X[si={table-format=3.4},c, m, cmd={\hskip 0pt}]}},
            colsep  = 1.2pt,
            cell{1}{1-2} = {r=2}{m},
            row{even[3]} = {bg= black!30},
            row{odd[3]}  = {bg= black!5},
            row{1,2}= {fg=white,bg=dark-blue},
            rowhead=2
        }
        \toprule[fg=white]
       Thickness (in)
        &   Amperage (\unit{\ampere}) 
        &   \SetCell[c=3]{c}  Voltage (\unit{\volt})& &
        &   \SetCell[c=3]{c}  Wire feed speed (ipm)& &\\
        \midrule[fg=white]
        &   & \ce{CO2}   
        & \ce{Ar} \qty{75}{\%} \ce{CO2} \qty{25}{\%}  
        & \ce{Ar} \qty{98}{\%}+  \ce{O2} \qty{2}{\%} 
        & Steel 0.030  
        & Steel 0.035 
        & Steel 0.045 \\
        \bottomrule[fg=white]
        \panelsteel{Short circuit transfer mode}
          &   &   &   &   &   &   &        \\
        \midrule[fg=dark-blue]
         .028 & 40 - 55   & 16 - 17   & 15 - 16   & -  & 90 - 100  & - & - \\
         .036 & 50 - 60   & 17 - 18   & 15 - 16   & - & 120 - 135 & 105 - 115 & -  \\
         .048 & 70 - 80   & 18 - 19   & 16 - 17   & - & 150 - 175 & 140 - 160 & 70 \\
         .064 & 90 - 110  & 19 - 20   & 17 - 18   & - & 220 - 250 & 180 - 220 & 90 - 110 \\
         .08 & 120 - 130 & 20 - 21   & 17 - 18   & - & 250 - 340 & 240 - 260 & 120 - 130\\
         .125   & 140 - 150 & 21 - 22   & 18 - 19   &   & - & 280 - 300 & 140 - 150\\
         .1875  & 160 - 170 & 21 - 22   & 18 - 19   & - & - & 320 - 340 & 160 - 175\\
         .25   & 180 - 190 & 23 - 24   & 21 - 22   & - & - & 360 - 380 & 185 - 195\\
         .3125  & 200 - 210 & 23 - 24   & 21 - 22   & - & - & 400 - 420 & 210 - 220\\
         .375   & 220 - 250 & 24 - 25   & 23 - 24   & - & - & 420 - 520 & 220 - 270\\
         .5   & 300 & - & - &  - & - & - & 375\\
        \midrule[fg=dark-blue]
        \panelsteel{Spray arc transfer mode}
           &   &   &   &   &   &   &   \\
        \midrule[fg=dark-blue]
         .028 & 50 - 60 & - & - & - & 120 - 135   & 105 - 115 & - \\
         .036 & 70 - 80 & - & - & - & 150 - 175   & 140 - 160 &   70\\
         .048 & 90 - 110    & - & - & - & 220 - 250   & 180 - 220 & 90 - 110\\
         .064 & 120 - 130   & - & - & - & 250 - 340   & 240 - 260 & 120 - 130\\
         .08 & 140 - 150   & - & - & - & - & 280 - 300   & 140 - 150\\
         .125   & 160 - 170   & - & - &  23 - 24 & - & 320 - 340   & 160 - 175\\
         .1875  & 180 - 190   & - & - &  24 - 25 & - & 360 - 380   & 185 - 195\\
         .25   & 200 - 210   & - & - &  24 - 25 & - & 400 - 420   & 210 - 220\\
         .3125  & 220 - 250   & - & - &  25 - 26 & - & 420 - 520   & 220 - 270\\
         .375   & 300 & - & - &   26 - 27 & - & - & 375\\
         .5   & 315 & - & - &   29 - 30 & - & - & 390\\
        \bottomrule[fg=dark-blue]
    \end{longtblr}    
\end{landscape}
\end{document}
1
  • 1
    Have you tried using the siunitx library for tabulararray? Section 5.7 of the manual. With column S?
    – cfr
    Jul 4, 2023 at 4:27

1 Answer 1

2

You are very generous with the columns using the si option. Rather than using this for all of the columns, you really only want to use it for the first one. Therefore, I replaced

colspec = {*{8}{X[si={table-format=3.4},c, m, cmd={\hskip 0pt}]}},

by

colspec = colspec = {X[si={table-format=3.4},c]*{7}{X[c]}},

Further, as explained in the manual, you need to use triple pairs of curly braces to guard non-numeric cells in that column.

\documentclass{scrartcl}
\usepackage[margin=20mm]{geometry}

\usepackage{pdflscape}
\usepackage[version=4]{mhchem}
\usepackage{xcolor}
\definecolor{dark-blue}{RGB}{28, 69, 135}
\definecolor{purple}{rgb}{.82, .1, .26}
\definecolor{tableLineOne}{RGB}{255, 253, 233}
\definecolor{tableLineTwo}{RGB}{255, 250, 194}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\NewTableCommand\panelsteel{
    \SetCell[c=8]{c,bg=purple,fg=white}}    

\begin{document}
\begin{landscape}
    \begin{longtblr}[
        caption = {Minimal booktabs example.},
        label = {tab:table1}
        ]{
            colspec = {X[si={table-format=3.4},c]*{7}{X[c]}},{X[c]}},
            colsep  = 1.2pt,
            cell{1}{1-2} = {r=2}{m},
            row{even[3]} = {bg= black!30},
            row{odd[3]}  = {bg= black!5},
            row{1,2}= {fg=white,bg=dark-blue},
            rowhead=2
        }
        \toprule[fg=white]
       {{{Thickness (in)}}}
        &   Amperage (\unit{\ampere}) 
        &   \SetCell[c=3]{c}  Voltage (\unit{\volt})& &
        &   \SetCell[c=3]{c}  Wire feed speed (ipm)& &\\
        \midrule[fg=white]
        &   & \ce{CO2}   
        & \ce{Ar} \qty{75}{\%} \ce{CO2} \qty{25}{\%}  
        & \ce{Ar} \qty{98}{\%}+  \ce{O2} \qty{2}{\%} 
        & Steel 0.030  
        & Steel 0.035 
        & Steel 0.045 \\
        \bottomrule[fg=white]
        \panelsteel{{{{Short circuit transfer mode}}}}
          &   &   &   &   &   &   &        \\
        \midrule[fg=dark-blue]
         .028 & 40 - 55   & 16 - 17   & 15 - 16   & -  & 90 - 100  & - & - \\
         .036 & 50 - 60   & 17 - 18   & 15 - 16   & - & 120 - 135 & 105 - 115 & -  \\
         .048 & 70 - 80   & 18 - 19   & 16 - 17   & - & 150 - 175 & 140 - 160 & 70 \\
         .064 & 90 - 110  & 19 - 20   & 17 - 18   & - & 220 - 250 & 180 - 220 & 90 - 110 \\
         .08 & 120 - 130 & 20 - 21   & 17 - 18   & - & 250 - 340 & 240 - 260 & 120 - 130\\
         .125   & 140 - 150 & 21 - 22   & 18 - 19   &   & - & 280 - 300 & 140 - 150\\
         .1875  & 160 - 170 & 21 - 22   & 18 - 19   & - & - & 320 - 340 & 160 - 175\\
         .25   & 180 - 190 & 23 - 24   & 21 - 22   & - & - & 360 - 380 & 185 - 195\\
         .3125  & 200 - 210 & 23 - 24   & 21 - 22   & - & - & 400 - 420 & 210 - 220\\
         .375   & 220 - 250 & 24 - 25   & 23 - 24   & - & - & 420 - 520 & 220 - 270\\
         .5   & 300 & - & - &  - & - & - & 375\\
        \midrule[fg=dark-blue]
        \panelsteel{{{{Spray arc transfer mode}}}}
           &   &   &   &   &   &   &   \\
        \midrule[fg=dark-blue]
         .028 & 50 - 60 & - & - & - & 120 - 135   & 105 - 115 & - \\
         .036 & 70 - 80 & - & - & - & 150 - 175   & 140 - 160 &   70\\
         .048 & 90 - 110    & - & - & - & 220 - 250   & 180 - 220 & 90 - 110\\
         .064 & 120 - 130   & - & - & - & 250 - 340   & 240 - 260 & 120 - 130\\
         .08 & 140 - 150   & - & - & - & - & 280 - 300   & 140 - 150\\
         .125   & 160 - 170   & - & - &  23 - 24 & - & 320 - 340   & 160 - 175\\
         .1875  & 180 - 190   & - & - &  24 - 25 & - & 360 - 380   & 185 - 195\\
         .25   & 200 - 210   & - & - &  24 - 25 & - & 400 - 420   & 210 - 220\\
         .3125  & 220 - 250   & - & - &  25 - 26 & - & 420 - 520   & 220 - 270\\
         .375   & 300 & - & - &   26 - 27 & - & - & 375\\
         .5   & 315 & - & - &   29 - 30 & - & - & 390\\
        \bottomrule[fg=dark-blue]
    \end{longtblr}    
\end{landscape}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .