1

I have some table

\documentclass{article}
\usepackage{siunitx}
\begin{document}

\begin{table}
\begin{tabular}{S[  table-alignment=right, 
                    table-format=5.1,
                    round-mode=places,
                    round-precision=1,
                    round-minimum=1]}
{title}  \\
11111    \\
11.11    \\
0.11     \\
\end{tabular}
\end{table}

\end{document}

in which I would like to show all values below one as <1. I believe to have understood that the argument round-minimum of siunitx can achieve this. However, when using the argument as done above, it prints the last number as 0.1 rather than <1. I wonder what I have misunderstood. Using the argument in \sisetup rather than S[...] does not help, neither does removing the round-precision or round-mode arguments, or both.

bumblebee
  • 270
  • 1
  • 9

1 Answers1

-1

This can be done by adding add-integer-zero=false, but you have to typeset your numbers without the leading zeroes, e.g. <.001 instead of <0.001.

Thanks to @karlkoeller --- https://tex.stackexchange.com/a/227763/197451

And comment of @leandriis

enter image description here

\documentclass{article}

%tables
\usepackage{booktabs}
\usepackage{siunitx} %align numbers by decimal point

\begin{document}

    \begin{tabular}{
            S[table-format = 2]
            S[table-format = -1.2, table-space-text-post = $^{***}$]
            S[table-format = -1.2, table-space-text-post = $^{***}$]
            S[table-format = 2.2]
            S[table-format = <0.3,add-integer-zero=false]}
        \toprule
        {Item} & {$b$} & {$t$} & {$F$} & {$p$}\\
        \midrule
        1 & -1.45{$^{***}$} & -7.44{$^{***}$} & 55.34 & .18  \\
        11 & -.86{$^{*}$} & -2.09{$^{*}$} & 4.36 & .01  \\
        12 & -1.79{$^{***}$} & -3.80{$^{***}$} & 14.47 & .05  \\
        13 & -.56 & -1.34 & 1.80 & .00  \\
        61 & -1.79{$^{***}$} & -5.85{$^{***}$} & 34.20 & .12  \\
        62 & -1.00{$^{**}$} & -3.17{$^{**}$} & 10.05 & .04  \\
        63 & -.27 & -.65 & .43 & <.001  \\
        64 & -.37 & -.97 & .94 & .00  \\
        65 & -.34 & -.85 & .73 & .00  \\
        66 & 1.05{$^{**}$} & 2.70{$^{**}$} & 7.30 & .02  \\
        67 & -1.12{$^{**}$} & -2.90{$^{**}$} & 8.40 & .03  \\
        72 & -.41 & -1.20 & 1.43 & .00  \\
        73 & -.27 & -.82 & .67 & .00  \\
        74 & 2.05{$^{***}$} & 4.99{$^{***}$} & 24.88 & .09  \\
        75 & 1.61{$^{***}$} & 4.41{$^{***}$} & 19.46 & .07  \\
        76 & .29 & .91 & .83 & <.001  \\
        \bottomrule
    \end{tabular}\par\vspace*{2cm}


\begin{tabular}{S[  table-alignment=right, 
            table-format=<0.2,
            round-mode=places,
            round-precision=1,
            round-minimum=1,
            add-integer-zero=false]}
        {title}  \\
        11111    \\
        11.11    \\
        <.11     \\
    \end{tabular}


\end{document} 
js bibra
  • 21,280
  • Did you test your suggestion using the minimal example provided in the question? – leandriis May 01 '20 at 16:28
  • Regarding your edit: 0.11 is definitely not equal to <.1. And also not identical to the desired output (<1) that the op requested. – leandriis May 01 '20 at 16:44
  • I think the OP wants it to be rounded to precision of 1 digit after the decimal point - lets wait for his/her comments – js bibra May 01 '20 at 16:46
  • Thanks but I find it hard to see how this answer relates to my question. In your answer, I would manually type <1 into the table but I am looking for a configuration of siunitx that takes as input a number such as 0.11 and outputs <1 automatically. I had understood the round-minimum function to do this but it does not work, at least not the ways I have tried and described in the question. – bumblebee May 03 '20 at 17:25