siunitx squashing columns











up vote
3
down vote

favorite












I have a table that I've formatted like this:



begin{table}[h!]
begin{center}
begin{tabular}[t]{cccc}
hline
{Combo} & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
hline
{U-V} & 0.558545 & 11640 & 3631.36 \
{U-R} & 0.567270 & 11632 & 3743.12 \
{U-I} & 0.579188 & 11626 & 3900.04 \
{U-J} & 0.536106 & 3709 & 1066 \
{U-K} & 0.535644 & 3730 & 1070.19 \
{B-V} & 0.580019 & 11884 & 3998.04 \
{B-R} & 0.574867 & 11763 & 3887.34 \
{B-I} & 0.591288 & 11749 & 4107.7 \
{V-U} & -0.558545 & 11640 & 3631.36 \
{V-B} & -0.580019 & 11884 & 3998.04 \
{R-U} & -0.567270 & 11632 & 3743.12 \
{R-B} & -0.574867 & 11763 & 3887.34 \
{R-W2} & -0.535443 & 4022 & 1153.1 \
{I-U} & -0.579188 & 11626 & 3900.04 \
{I-B} & -0.591288 & 11749 & 4107.7 \
{I-W2} & -0.574056 & 4020 & 1324.75 \
{J-U} & -0.536106 & 3709 & 1066 \
{J-W2} & -0.577232 & 1943 & 647.401 \
{K-U} & -0.535644 & 3730 & 1070.19 \
{K-W1} & -0.512554 & 1938 & 509.136 \
{K-W2} & -0.591156 & 1960 & 684.953 \
{W1-K} & 0.512554 & 1938 & 509.136 \
{W2-R} & 0.535443 & 4022 & 1153.1 \
{W2-I} & 0.574056 & 4020 & 1324.75 \
{W2-J} & 0.577232 & 1943 & 647.401 \
{W2-K} & 0.591156 & 1960 & 684.953 \
hline
end{tabular}
caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
label{table:MgII_colours}
end{center}
end{table}


to produce:



enter image description here



but I need the numerical columns aligned on the decimal points. From this question I tried formatting it as



    begin{table}
centering
addtolength{tabcolsep}{-0.3pt}
begin{tabular}{
@{}
l
S[table-format=1.2]
S[table-format=1.2]
S[table-format=2.3]
@{}
}
hline
{Combo} & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
hline
{U-V} & 0.558545 & 11640 & 3631.36 \
{U-R} & 0.567270 & 11632 & 3743.12 \
{U-I} & 0.579188 & 11626 & 3900.04 \
{U-J} & 0.536106 & 3709 & 1066 \
{U-K} & 0.535644 & 3730 & 1070.19 \
{B-V} & 0.580019 & 11884 & 3998.04 \
{B-R} & 0.574867 & 11763 & 3887.34 \
{B-I} & 0.591288 & 11749 & 4107.7 \
{V-U} & -0.558545 & 11640 & 3631.36 \
{V-B} & -0.580019 & 11884 & 3998.04 \
{R-U} & -0.567270 & 11632 & 3743.12 \
{R-B} & -0.574867 & 11763 & 3887.34 \
{R-W2} & -0.535443 & 4022 & 1153.1 \
{I-U} & -0.579188 & 11626 & 3900.04 \
{I-B} & -0.591288 & 11749 & 4107.7 \
{I-W2} & -0.574056 & 4020 & 1324.75 \
{J-U} & -0.536106 & 3709 & 1066 \
{J-W2} & -0.577232 & 1943 & 647.401 \
{K-U} & -0.535644 & 3730 & 1070.19 \
{K-W1} & -0.512554 & 1938 & 509.136 \
{K-W2} & -0.591156 & 1960 & 684.953 \
{W1-K} & 0.512554 & 1938 & 509.136 \
{W2-R} & 0.535443 & 4022 & 1153.1 \
{W2-I} & 0.574056 & 4020 & 1324.75 \
{W2-J} & 0.577232 & 1943 & 647.401 \
{W2-K} & 0.591156 & 1960 & 684.953 \
hline
end{tabular}
caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
label{table:MgII_colours}

end{table}


but it made this:



enter image description here



Why has it squashed up the middle two columns? I'm quite new to LaTex, and very new to siunitx.
Also, is there any way to avoid having to put the braces around the textual column entries? It's kind of a pain when there are a lot of rows.










share|improve this question


























    up vote
    3
    down vote

    favorite












    I have a table that I've formatted like this:



    begin{table}[h!]
    begin{center}
    begin{tabular}[t]{cccc}
    hline
    {Combo} & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
    hline
    {U-V} & 0.558545 & 11640 & 3631.36 \
    {U-R} & 0.567270 & 11632 & 3743.12 \
    {U-I} & 0.579188 & 11626 & 3900.04 \
    {U-J} & 0.536106 & 3709 & 1066 \
    {U-K} & 0.535644 & 3730 & 1070.19 \
    {B-V} & 0.580019 & 11884 & 3998.04 \
    {B-R} & 0.574867 & 11763 & 3887.34 \
    {B-I} & 0.591288 & 11749 & 4107.7 \
    {V-U} & -0.558545 & 11640 & 3631.36 \
    {V-B} & -0.580019 & 11884 & 3998.04 \
    {R-U} & -0.567270 & 11632 & 3743.12 \
    {R-B} & -0.574867 & 11763 & 3887.34 \
    {R-W2} & -0.535443 & 4022 & 1153.1 \
    {I-U} & -0.579188 & 11626 & 3900.04 \
    {I-B} & -0.591288 & 11749 & 4107.7 \
    {I-W2} & -0.574056 & 4020 & 1324.75 \
    {J-U} & -0.536106 & 3709 & 1066 \
    {J-W2} & -0.577232 & 1943 & 647.401 \
    {K-U} & -0.535644 & 3730 & 1070.19 \
    {K-W1} & -0.512554 & 1938 & 509.136 \
    {K-W2} & -0.591156 & 1960 & 684.953 \
    {W1-K} & 0.512554 & 1938 & 509.136 \
    {W2-R} & 0.535443 & 4022 & 1153.1 \
    {W2-I} & 0.574056 & 4020 & 1324.75 \
    {W2-J} & 0.577232 & 1943 & 647.401 \
    {W2-K} & 0.591156 & 1960 & 684.953 \
    hline
    end{tabular}
    caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
    label{table:MgII_colours}
    end{center}
    end{table}


    to produce:



    enter image description here



    but I need the numerical columns aligned on the decimal points. From this question I tried formatting it as



        begin{table}
    centering
    addtolength{tabcolsep}{-0.3pt}
    begin{tabular}{
    @{}
    l
    S[table-format=1.2]
    S[table-format=1.2]
    S[table-format=2.3]
    @{}
    }
    hline
    {Combo} & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
    hline
    {U-V} & 0.558545 & 11640 & 3631.36 \
    {U-R} & 0.567270 & 11632 & 3743.12 \
    {U-I} & 0.579188 & 11626 & 3900.04 \
    {U-J} & 0.536106 & 3709 & 1066 \
    {U-K} & 0.535644 & 3730 & 1070.19 \
    {B-V} & 0.580019 & 11884 & 3998.04 \
    {B-R} & 0.574867 & 11763 & 3887.34 \
    {B-I} & 0.591288 & 11749 & 4107.7 \
    {V-U} & -0.558545 & 11640 & 3631.36 \
    {V-B} & -0.580019 & 11884 & 3998.04 \
    {R-U} & -0.567270 & 11632 & 3743.12 \
    {R-B} & -0.574867 & 11763 & 3887.34 \
    {R-W2} & -0.535443 & 4022 & 1153.1 \
    {I-U} & -0.579188 & 11626 & 3900.04 \
    {I-B} & -0.591288 & 11749 & 4107.7 \
    {I-W2} & -0.574056 & 4020 & 1324.75 \
    {J-U} & -0.536106 & 3709 & 1066 \
    {J-W2} & -0.577232 & 1943 & 647.401 \
    {K-U} & -0.535644 & 3730 & 1070.19 \
    {K-W1} & -0.512554 & 1938 & 509.136 \
    {K-W2} & -0.591156 & 1960 & 684.953 \
    {W1-K} & 0.512554 & 1938 & 509.136 \
    {W2-R} & 0.535443 & 4022 & 1153.1 \
    {W2-I} & 0.574056 & 4020 & 1324.75 \
    {W2-J} & 0.577232 & 1943 & 647.401 \
    {W2-K} & 0.591156 & 1960 & 684.953 \
    hline
    end{tabular}
    caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
    label{table:MgII_colours}

    end{table}


    but it made this:



    enter image description here



    Why has it squashed up the middle two columns? I'm quite new to LaTex, and very new to siunitx.
    Also, is there any way to avoid having to put the braces around the textual column entries? It's kind of a pain when there are a lot of rows.










    share|improve this question
























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I have a table that I've formatted like this:



      begin{table}[h!]
      begin{center}
      begin{tabular}[t]{cccc}
      hline
      {Combo} & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
      hline
      {U-V} & 0.558545 & 11640 & 3631.36 \
      {U-R} & 0.567270 & 11632 & 3743.12 \
      {U-I} & 0.579188 & 11626 & 3900.04 \
      {U-J} & 0.536106 & 3709 & 1066 \
      {U-K} & 0.535644 & 3730 & 1070.19 \
      {B-V} & 0.580019 & 11884 & 3998.04 \
      {B-R} & 0.574867 & 11763 & 3887.34 \
      {B-I} & 0.591288 & 11749 & 4107.7 \
      {V-U} & -0.558545 & 11640 & 3631.36 \
      {V-B} & -0.580019 & 11884 & 3998.04 \
      {R-U} & -0.567270 & 11632 & 3743.12 \
      {R-B} & -0.574867 & 11763 & 3887.34 \
      {R-W2} & -0.535443 & 4022 & 1153.1 \
      {I-U} & -0.579188 & 11626 & 3900.04 \
      {I-B} & -0.591288 & 11749 & 4107.7 \
      {I-W2} & -0.574056 & 4020 & 1324.75 \
      {J-U} & -0.536106 & 3709 & 1066 \
      {J-W2} & -0.577232 & 1943 & 647.401 \
      {K-U} & -0.535644 & 3730 & 1070.19 \
      {K-W1} & -0.512554 & 1938 & 509.136 \
      {K-W2} & -0.591156 & 1960 & 684.953 \
      {W1-K} & 0.512554 & 1938 & 509.136 \
      {W2-R} & 0.535443 & 4022 & 1153.1 \
      {W2-I} & 0.574056 & 4020 & 1324.75 \
      {W2-J} & 0.577232 & 1943 & 647.401 \
      {W2-K} & 0.591156 & 1960 & 684.953 \
      hline
      end{tabular}
      caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
      label{table:MgII_colours}
      end{center}
      end{table}


      to produce:



      enter image description here



      but I need the numerical columns aligned on the decimal points. From this question I tried formatting it as



          begin{table}
      centering
      addtolength{tabcolsep}{-0.3pt}
      begin{tabular}{
      @{}
      l
      S[table-format=1.2]
      S[table-format=1.2]
      S[table-format=2.3]
      @{}
      }
      hline
      {Combo} & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
      hline
      {U-V} & 0.558545 & 11640 & 3631.36 \
      {U-R} & 0.567270 & 11632 & 3743.12 \
      {U-I} & 0.579188 & 11626 & 3900.04 \
      {U-J} & 0.536106 & 3709 & 1066 \
      {U-K} & 0.535644 & 3730 & 1070.19 \
      {B-V} & 0.580019 & 11884 & 3998.04 \
      {B-R} & 0.574867 & 11763 & 3887.34 \
      {B-I} & 0.591288 & 11749 & 4107.7 \
      {V-U} & -0.558545 & 11640 & 3631.36 \
      {V-B} & -0.580019 & 11884 & 3998.04 \
      {R-U} & -0.567270 & 11632 & 3743.12 \
      {R-B} & -0.574867 & 11763 & 3887.34 \
      {R-W2} & -0.535443 & 4022 & 1153.1 \
      {I-U} & -0.579188 & 11626 & 3900.04 \
      {I-B} & -0.591288 & 11749 & 4107.7 \
      {I-W2} & -0.574056 & 4020 & 1324.75 \
      {J-U} & -0.536106 & 3709 & 1066 \
      {J-W2} & -0.577232 & 1943 & 647.401 \
      {K-U} & -0.535644 & 3730 & 1070.19 \
      {K-W1} & -0.512554 & 1938 & 509.136 \
      {K-W2} & -0.591156 & 1960 & 684.953 \
      {W1-K} & 0.512554 & 1938 & 509.136 \
      {W2-R} & 0.535443 & 4022 & 1153.1 \
      {W2-I} & 0.574056 & 4020 & 1324.75 \
      {W2-J} & 0.577232 & 1943 & 647.401 \
      {W2-K} & 0.591156 & 1960 & 684.953 \
      hline
      end{tabular}
      caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
      label{table:MgII_colours}

      end{table}


      but it made this:



      enter image description here



      Why has it squashed up the middle two columns? I'm quite new to LaTex, and very new to siunitx.
      Also, is there any way to avoid having to put the braces around the textual column entries? It's kind of a pain when there are a lot of rows.










      share|improve this question













      I have a table that I've formatted like this:



      begin{table}[h!]
      begin{center}
      begin{tabular}[t]{cccc}
      hline
      {Combo} & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
      hline
      {U-V} & 0.558545 & 11640 & 3631.36 \
      {U-R} & 0.567270 & 11632 & 3743.12 \
      {U-I} & 0.579188 & 11626 & 3900.04 \
      {U-J} & 0.536106 & 3709 & 1066 \
      {U-K} & 0.535644 & 3730 & 1070.19 \
      {B-V} & 0.580019 & 11884 & 3998.04 \
      {B-R} & 0.574867 & 11763 & 3887.34 \
      {B-I} & 0.591288 & 11749 & 4107.7 \
      {V-U} & -0.558545 & 11640 & 3631.36 \
      {V-B} & -0.580019 & 11884 & 3998.04 \
      {R-U} & -0.567270 & 11632 & 3743.12 \
      {R-B} & -0.574867 & 11763 & 3887.34 \
      {R-W2} & -0.535443 & 4022 & 1153.1 \
      {I-U} & -0.579188 & 11626 & 3900.04 \
      {I-B} & -0.591288 & 11749 & 4107.7 \
      {I-W2} & -0.574056 & 4020 & 1324.75 \
      {J-U} & -0.536106 & 3709 & 1066 \
      {J-W2} & -0.577232 & 1943 & 647.401 \
      {K-U} & -0.535644 & 3730 & 1070.19 \
      {K-W1} & -0.512554 & 1938 & 509.136 \
      {K-W2} & -0.591156 & 1960 & 684.953 \
      {W1-K} & 0.512554 & 1938 & 509.136 \
      {W2-R} & 0.535443 & 4022 & 1153.1 \
      {W2-I} & 0.574056 & 4020 & 1324.75 \
      {W2-J} & 0.577232 & 1943 & 647.401 \
      {W2-K} & 0.591156 & 1960 & 684.953 \
      hline
      end{tabular}
      caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
      label{table:MgII_colours}
      end{center}
      end{table}


      to produce:



      enter image description here



      but I need the numerical columns aligned on the decimal points. From this question I tried formatting it as



          begin{table}
      centering
      addtolength{tabcolsep}{-0.3pt}
      begin{tabular}{
      @{}
      l
      S[table-format=1.2]
      S[table-format=1.2]
      S[table-format=2.3]
      @{}
      }
      hline
      {Combo} & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
      hline
      {U-V} & 0.558545 & 11640 & 3631.36 \
      {U-R} & 0.567270 & 11632 & 3743.12 \
      {U-I} & 0.579188 & 11626 & 3900.04 \
      {U-J} & 0.536106 & 3709 & 1066 \
      {U-K} & 0.535644 & 3730 & 1070.19 \
      {B-V} & 0.580019 & 11884 & 3998.04 \
      {B-R} & 0.574867 & 11763 & 3887.34 \
      {B-I} & 0.591288 & 11749 & 4107.7 \
      {V-U} & -0.558545 & 11640 & 3631.36 \
      {V-B} & -0.580019 & 11884 & 3998.04 \
      {R-U} & -0.567270 & 11632 & 3743.12 \
      {R-B} & -0.574867 & 11763 & 3887.34 \
      {R-W2} & -0.535443 & 4022 & 1153.1 \
      {I-U} & -0.579188 & 11626 & 3900.04 \
      {I-B} & -0.591288 & 11749 & 4107.7 \
      {I-W2} & -0.574056 & 4020 & 1324.75 \
      {J-U} & -0.536106 & 3709 & 1066 \
      {J-W2} & -0.577232 & 1943 & 647.401 \
      {K-U} & -0.535644 & 3730 & 1070.19 \
      {K-W1} & -0.512554 & 1938 & 509.136 \
      {K-W2} & -0.591156 & 1960 & 684.953 \
      {W1-K} & 0.512554 & 1938 & 509.136 \
      {W2-R} & 0.535443 & 4022 & 1153.1 \
      {W2-I} & 0.574056 & 4020 & 1324.75 \
      {W2-J} & 0.577232 & 1943 & 647.401 \
      {W2-K} & 0.591156 & 1960 & 684.953 \
      hline
      end{tabular}
      caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
      label{table:MgII_colours}

      end{table}


      but it made this:



      enter image description here



      Why has it squashed up the middle two columns? I'm quite new to LaTex, and very new to siunitx.
      Also, is there any way to avoid having to put the braces around the textual column entries? It's kind of a pain when there are a lot of rows.







      tables siunitx alignment






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 13 at 20:31









      Jim421616

      1306




      1306






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          You just need to set appropriate values in your table-formats. In your case, you have to worry about the number of digits before and after the decimal separator and, in the second column, the presence of the sign.



          documentclass{article}

          usepackage{siunitx}
          usepackage{booktabs}

          begin{document}
          begin{table}
          centering
          addtolength{tabcolsep}{-0.3pt}
          sisetup{group-digits=integer}
          begin{tabular}{
          @{}
          l
          S[table-format=+1.6]
          S[table-format=5.0]
          S[table-format=4.3]
          @{}
          }
          toprule
          Combo & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
          midrule
          U-V & 0.558545 & 11640 & 3631.36 \
          U-R & 0.567270 & 11632 & 3743.12 \
          U-I & 0.579188 & 11626 & 3900.04 \
          U-J & 0.536106 & 3709 & 1066 \
          U-K & 0.535644 & 3730 & 1070.19 \
          B-V & 0.580019 & 11884 & 3998.04 \
          B-R & 0.574867 & 11763 & 3887.34 \
          B-I & 0.591288 & 11749 & 4107.7 \
          V-U & -0.558545 & 11640 & 3631.36 \
          V-B & -0.580019 & 11884 & 3998.04 \
          R-U & -0.567270 & 11632 & 3743.12 \
          R-B & -0.574867 & 11763 & 3887.34 \
          R-W2 & -0.535443 & 4022 & 1153.1 \
          I-U & -0.579188 & 11626 & 3900.04 \
          I-B & -0.591288 & 11749 & 4107.7 \
          I-W2 & -0.574056 & 4020 & 1324.75 \
          J-U & -0.536106 & 3709 & 1066 \
          J-W2 & -0.577232 & 1943 & 647.401 \
          K-U & -0.535644 & 3730 & 1070.19 \
          K-W1 & -0.512554 & 1938 & 509.136 \
          K-W2 & -0.591156 & 1960 & 684.953 \
          W1-K & 0.512554 & 1938 & 509.136 \
          W2-R & 0.535443 & 4022 & 1153.1 \
          W2-I & 0.574056 & 4020 & 1324.75 \
          W2-J & 0.577232 & 1943 & 647.401 \
          W2-K & 0.591156 & 1960 & 684.953 \
          bottomrule
          end{tabular}
          caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
          label{table:MgII_colours}
          end{table}

          end{document}


          enter image description here






          share|improve this answer























          • Ah that's better! Is there any way to avoid having to put the braces around the text values in the first column? Maybe a column format specifier or something?
            – Jim421616
            Nov 13 at 20:41






          • 1




            @Jim421616 Your first column is an l type column, so as far as I know, you don't need the brace protection there already.
            – gusbrs
            Nov 13 at 20:43












          • @Jim421616 I've added some small improvements (booktabs, in particular, but also better digit groupint).
            – gusbrs
            Nov 13 at 20:57










          • Ok, so what does the line sisetup{group-digits=integer} do exactly?
            – Jim421616
            Nov 13 at 23:38






          • 1




            @Jim421616 It introduces grouping for larger numbers, but only for the integer part. siunitx's default is to put a thin space between groups and to group by three digits, but doesn't separate a single digit (that is, you must have at least five numbers for the grouping to take place). Notice the five digit numbers in your third column, and you'll see what's going on.
            – gusbrs
            Nov 13 at 23:47













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459842%2fsiunitx-squashing-columns%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          You just need to set appropriate values in your table-formats. In your case, you have to worry about the number of digits before and after the decimal separator and, in the second column, the presence of the sign.



          documentclass{article}

          usepackage{siunitx}
          usepackage{booktabs}

          begin{document}
          begin{table}
          centering
          addtolength{tabcolsep}{-0.3pt}
          sisetup{group-digits=integer}
          begin{tabular}{
          @{}
          l
          S[table-format=+1.6]
          S[table-format=5.0]
          S[table-format=4.3]
          @{}
          }
          toprule
          Combo & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
          midrule
          U-V & 0.558545 & 11640 & 3631.36 \
          U-R & 0.567270 & 11632 & 3743.12 \
          U-I & 0.579188 & 11626 & 3900.04 \
          U-J & 0.536106 & 3709 & 1066 \
          U-K & 0.535644 & 3730 & 1070.19 \
          B-V & 0.580019 & 11884 & 3998.04 \
          B-R & 0.574867 & 11763 & 3887.34 \
          B-I & 0.591288 & 11749 & 4107.7 \
          V-U & -0.558545 & 11640 & 3631.36 \
          V-B & -0.580019 & 11884 & 3998.04 \
          R-U & -0.567270 & 11632 & 3743.12 \
          R-B & -0.574867 & 11763 & 3887.34 \
          R-W2 & -0.535443 & 4022 & 1153.1 \
          I-U & -0.579188 & 11626 & 3900.04 \
          I-B & -0.591288 & 11749 & 4107.7 \
          I-W2 & -0.574056 & 4020 & 1324.75 \
          J-U & -0.536106 & 3709 & 1066 \
          J-W2 & -0.577232 & 1943 & 647.401 \
          K-U & -0.535644 & 3730 & 1070.19 \
          K-W1 & -0.512554 & 1938 & 509.136 \
          K-W2 & -0.591156 & 1960 & 684.953 \
          W1-K & 0.512554 & 1938 & 509.136 \
          W2-R & 0.535443 & 4022 & 1153.1 \
          W2-I & 0.574056 & 4020 & 1324.75 \
          W2-J & 0.577232 & 1943 & 647.401 \
          W2-K & 0.591156 & 1960 & 684.953 \
          bottomrule
          end{tabular}
          caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
          label{table:MgII_colours}
          end{table}

          end{document}


          enter image description here






          share|improve this answer























          • Ah that's better! Is there any way to avoid having to put the braces around the text values in the first column? Maybe a column format specifier or something?
            – Jim421616
            Nov 13 at 20:41






          • 1




            @Jim421616 Your first column is an l type column, so as far as I know, you don't need the brace protection there already.
            – gusbrs
            Nov 13 at 20:43












          • @Jim421616 I've added some small improvements (booktabs, in particular, but also better digit groupint).
            – gusbrs
            Nov 13 at 20:57










          • Ok, so what does the line sisetup{group-digits=integer} do exactly?
            – Jim421616
            Nov 13 at 23:38






          • 1




            @Jim421616 It introduces grouping for larger numbers, but only for the integer part. siunitx's default is to put a thin space between groups and to group by three digits, but doesn't separate a single digit (that is, you must have at least five numbers for the grouping to take place). Notice the five digit numbers in your third column, and you'll see what's going on.
            – gusbrs
            Nov 13 at 23:47

















          up vote
          2
          down vote



          accepted










          You just need to set appropriate values in your table-formats. In your case, you have to worry about the number of digits before and after the decimal separator and, in the second column, the presence of the sign.



          documentclass{article}

          usepackage{siunitx}
          usepackage{booktabs}

          begin{document}
          begin{table}
          centering
          addtolength{tabcolsep}{-0.3pt}
          sisetup{group-digits=integer}
          begin{tabular}{
          @{}
          l
          S[table-format=+1.6]
          S[table-format=5.0]
          S[table-format=4.3]
          @{}
          }
          toprule
          Combo & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
          midrule
          U-V & 0.558545 & 11640 & 3631.36 \
          U-R & 0.567270 & 11632 & 3743.12 \
          U-I & 0.579188 & 11626 & 3900.04 \
          U-J & 0.536106 & 3709 & 1066 \
          U-K & 0.535644 & 3730 & 1070.19 \
          B-V & 0.580019 & 11884 & 3998.04 \
          B-R & 0.574867 & 11763 & 3887.34 \
          B-I & 0.591288 & 11749 & 4107.7 \
          V-U & -0.558545 & 11640 & 3631.36 \
          V-B & -0.580019 & 11884 & 3998.04 \
          R-U & -0.567270 & 11632 & 3743.12 \
          R-B & -0.574867 & 11763 & 3887.34 \
          R-W2 & -0.535443 & 4022 & 1153.1 \
          I-U & -0.579188 & 11626 & 3900.04 \
          I-B & -0.591288 & 11749 & 4107.7 \
          I-W2 & -0.574056 & 4020 & 1324.75 \
          J-U & -0.536106 & 3709 & 1066 \
          J-W2 & -0.577232 & 1943 & 647.401 \
          K-U & -0.535644 & 3730 & 1070.19 \
          K-W1 & -0.512554 & 1938 & 509.136 \
          K-W2 & -0.591156 & 1960 & 684.953 \
          W1-K & 0.512554 & 1938 & 509.136 \
          W2-R & 0.535443 & 4022 & 1153.1 \
          W2-I & 0.574056 & 4020 & 1324.75 \
          W2-J & 0.577232 & 1943 & 647.401 \
          W2-K & 0.591156 & 1960 & 684.953 \
          bottomrule
          end{tabular}
          caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
          label{table:MgII_colours}
          end{table}

          end{document}


          enter image description here






          share|improve this answer























          • Ah that's better! Is there any way to avoid having to put the braces around the text values in the first column? Maybe a column format specifier or something?
            – Jim421616
            Nov 13 at 20:41






          • 1




            @Jim421616 Your first column is an l type column, so as far as I know, you don't need the brace protection there already.
            – gusbrs
            Nov 13 at 20:43












          • @Jim421616 I've added some small improvements (booktabs, in particular, but also better digit groupint).
            – gusbrs
            Nov 13 at 20:57










          • Ok, so what does the line sisetup{group-digits=integer} do exactly?
            – Jim421616
            Nov 13 at 23:38






          • 1




            @Jim421616 It introduces grouping for larger numbers, but only for the integer part. siunitx's default is to put a thin space between groups and to group by three digits, but doesn't separate a single digit (that is, you must have at least five numbers for the grouping to take place). Notice the five digit numbers in your third column, and you'll see what's going on.
            – gusbrs
            Nov 13 at 23:47















          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          You just need to set appropriate values in your table-formats. In your case, you have to worry about the number of digits before and after the decimal separator and, in the second column, the presence of the sign.



          documentclass{article}

          usepackage{siunitx}
          usepackage{booktabs}

          begin{document}
          begin{table}
          centering
          addtolength{tabcolsep}{-0.3pt}
          sisetup{group-digits=integer}
          begin{tabular}{
          @{}
          l
          S[table-format=+1.6]
          S[table-format=5.0]
          S[table-format=4.3]
          @{}
          }
          toprule
          Combo & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
          midrule
          U-V & 0.558545 & 11640 & 3631.36 \
          U-R & 0.567270 & 11632 & 3743.12 \
          U-I & 0.579188 & 11626 & 3900.04 \
          U-J & 0.536106 & 3709 & 1066 \
          U-K & 0.535644 & 3730 & 1070.19 \
          B-V & 0.580019 & 11884 & 3998.04 \
          B-R & 0.574867 & 11763 & 3887.34 \
          B-I & 0.591288 & 11749 & 4107.7 \
          V-U & -0.558545 & 11640 & 3631.36 \
          V-B & -0.580019 & 11884 & 3998.04 \
          R-U & -0.567270 & 11632 & 3743.12 \
          R-B & -0.574867 & 11763 & 3887.34 \
          R-W2 & -0.535443 & 4022 & 1153.1 \
          I-U & -0.579188 & 11626 & 3900.04 \
          I-B & -0.591288 & 11749 & 4107.7 \
          I-W2 & -0.574056 & 4020 & 1324.75 \
          J-U & -0.536106 & 3709 & 1066 \
          J-W2 & -0.577232 & 1943 & 647.401 \
          K-U & -0.535644 & 3730 & 1070.19 \
          K-W1 & -0.512554 & 1938 & 509.136 \
          K-W2 & -0.591156 & 1960 & 684.953 \
          W1-K & 0.512554 & 1938 & 509.136 \
          W2-R & 0.535443 & 4022 & 1153.1 \
          W2-I & 0.574056 & 4020 & 1324.75 \
          W2-J & 0.577232 & 1943 & 647.401 \
          W2-K & 0.591156 & 1960 & 684.953 \
          bottomrule
          end{tabular}
          caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
          label{table:MgII_colours}
          end{table}

          end{document}


          enter image description here






          share|improve this answer














          You just need to set appropriate values in your table-formats. In your case, you have to worry about the number of digits before and after the decimal separator and, in the second column, the presence of the sign.



          documentclass{article}

          usepackage{siunitx}
          usepackage{booktabs}

          begin{document}
          begin{table}
          centering
          addtolength{tabcolsep}{-0.3pt}
          sisetup{group-digits=integer}
          begin{tabular}{
          @{}
          l
          S[table-format=+1.6]
          S[table-format=5.0]
          S[table-format=4.3]
          @{}
          }
          toprule
          Combo & {$|r|>0.5$} & {$n>100$} & {$r^2n$} \
          midrule
          U-V & 0.558545 & 11640 & 3631.36 \
          U-R & 0.567270 & 11632 & 3743.12 \
          U-I & 0.579188 & 11626 & 3900.04 \
          U-J & 0.536106 & 3709 & 1066 \
          U-K & 0.535644 & 3730 & 1070.19 \
          B-V & 0.580019 & 11884 & 3998.04 \
          B-R & 0.574867 & 11763 & 3887.34 \
          B-I & 0.591288 & 11749 & 4107.7 \
          V-U & -0.558545 & 11640 & 3631.36 \
          V-B & -0.580019 & 11884 & 3998.04 \
          R-U & -0.567270 & 11632 & 3743.12 \
          R-B & -0.574867 & 11763 & 3887.34 \
          R-W2 & -0.535443 & 4022 & 1153.1 \
          I-U & -0.579188 & 11626 & 3900.04 \
          I-B & -0.591288 & 11749 & 4107.7 \
          I-W2 & -0.574056 & 4020 & 1324.75 \
          J-U & -0.536106 & 3709 & 1066 \
          J-W2 & -0.577232 & 1943 & 647.401 \
          K-U & -0.535644 & 3730 & 1070.19 \
          K-W1 & -0.512554 & 1938 & 509.136 \
          K-W2 & -0.591156 & 1960 & 684.953 \
          W1-K & 0.512554 & 1938 & 509.136 \
          W2-R & 0.535443 & 4022 & 1153.1 \
          W2-I & 0.574056 & 4020 & 1324.75 \
          W2-J & 0.577232 & 1943 & 647.401 \
          W2-K & 0.591156 & 1960 & 684.953 \
          bottomrule
          end{tabular}
          caption[Best photometric colours from the MgII dataset]{Photometric colours with highest r-value from the MgII dataset.}
          label{table:MgII_colours}
          end{table}

          end{document}


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 13 at 21:36

























          answered Nov 13 at 20:36









          gusbrs

          6,0492838




          6,0492838












          • Ah that's better! Is there any way to avoid having to put the braces around the text values in the first column? Maybe a column format specifier or something?
            – Jim421616
            Nov 13 at 20:41






          • 1




            @Jim421616 Your first column is an l type column, so as far as I know, you don't need the brace protection there already.
            – gusbrs
            Nov 13 at 20:43












          • @Jim421616 I've added some small improvements (booktabs, in particular, but also better digit groupint).
            – gusbrs
            Nov 13 at 20:57










          • Ok, so what does the line sisetup{group-digits=integer} do exactly?
            – Jim421616
            Nov 13 at 23:38






          • 1




            @Jim421616 It introduces grouping for larger numbers, but only for the integer part. siunitx's default is to put a thin space between groups and to group by three digits, but doesn't separate a single digit (that is, you must have at least five numbers for the grouping to take place). Notice the five digit numbers in your third column, and you'll see what's going on.
            – gusbrs
            Nov 13 at 23:47




















          • Ah that's better! Is there any way to avoid having to put the braces around the text values in the first column? Maybe a column format specifier or something?
            – Jim421616
            Nov 13 at 20:41






          • 1




            @Jim421616 Your first column is an l type column, so as far as I know, you don't need the brace protection there already.
            – gusbrs
            Nov 13 at 20:43












          • @Jim421616 I've added some small improvements (booktabs, in particular, but also better digit groupint).
            – gusbrs
            Nov 13 at 20:57










          • Ok, so what does the line sisetup{group-digits=integer} do exactly?
            – Jim421616
            Nov 13 at 23:38






          • 1




            @Jim421616 It introduces grouping for larger numbers, but only for the integer part. siunitx's default is to put a thin space between groups and to group by three digits, but doesn't separate a single digit (that is, you must have at least five numbers for the grouping to take place). Notice the five digit numbers in your third column, and you'll see what's going on.
            – gusbrs
            Nov 13 at 23:47


















          Ah that's better! Is there any way to avoid having to put the braces around the text values in the first column? Maybe a column format specifier or something?
          – Jim421616
          Nov 13 at 20:41




          Ah that's better! Is there any way to avoid having to put the braces around the text values in the first column? Maybe a column format specifier or something?
          – Jim421616
          Nov 13 at 20:41




          1




          1




          @Jim421616 Your first column is an l type column, so as far as I know, you don't need the brace protection there already.
          – gusbrs
          Nov 13 at 20:43






          @Jim421616 Your first column is an l type column, so as far as I know, you don't need the brace protection there already.
          – gusbrs
          Nov 13 at 20:43














          @Jim421616 I've added some small improvements (booktabs, in particular, but also better digit groupint).
          – gusbrs
          Nov 13 at 20:57




          @Jim421616 I've added some small improvements (booktabs, in particular, but also better digit groupint).
          – gusbrs
          Nov 13 at 20:57












          Ok, so what does the line sisetup{group-digits=integer} do exactly?
          – Jim421616
          Nov 13 at 23:38




          Ok, so what does the line sisetup{group-digits=integer} do exactly?
          – Jim421616
          Nov 13 at 23:38




          1




          1




          @Jim421616 It introduces grouping for larger numbers, but only for the integer part. siunitx's default is to put a thin space between groups and to group by three digits, but doesn't separate a single digit (that is, you must have at least five numbers for the grouping to take place). Notice the five digit numbers in your third column, and you'll see what's going on.
          – gusbrs
          Nov 13 at 23:47






          @Jim421616 It introduces grouping for larger numbers, but only for the integer part. siunitx's default is to put a thin space between groups and to group by three digits, but doesn't separate a single digit (that is, you must have at least five numbers for the grouping to take place). Notice the five digit numbers in your third column, and you'll see what's going on.
          – gusbrs
          Nov 13 at 23:47




















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459842%2fsiunitx-squashing-columns%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to send String Array data to Server using php in android

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Is anime1.com a legal site for watching anime?