Re: Un bug di siuntix

#48085
lorenzo.pantieri
Partecipante
    Up
    0
    Down
    ::


    Cioa vi riporto la risposta di Joseph Wright:

    Hello Lorenzo,

    I have to start by saying that this is not a bug, it’s a deliberate
    design decision. I’ll explain the reasoning, but first I’ll point out
    that for cases such as your own you can use the ‘table-parse-only’
    option in siunitx version 2:
    `\documentclass{article}
    \usepackage{booktabs}
    \usepackage{siunitx}
    \sisetup{output-decimal-marker = {,},table-parse-only}
    \begin{document}

    \begin{tabular}{cSSSS}
    \toprule
    $D$& {$P$}& {$u$}& {$\beta$}& {$G$} \\
    (m)& {(kg)}& {(m)}& & {(Pa)} \\
    \midrule
    $5$& 269.8& 0.000674& 1.79& 0.04089 \\
    $10$& 421.0& 0.001035& 3.59& 0.04089 \\
    $20$& 640.2& 0.001565& 7.18& 0.04089 \\
    \bottomrule
    \end{tabular}

    \end{document}`

    (Version 2 of siunitx was released about two months ago.)

    The reason siunitx works in the way it does is because of the
    information you need in order to lay out numbers aligning on decimal
    markers. The default is to always put the marker at the middle of the
    column, and to allow each side to expand flexibly. That is relatively
    easy to do, as you only need a fill on both sides.

    However, life is much more complex when you want variable placement of
    the marker. In your examples, you’ve got ‘nice’ columns where each entry
    in a column has the same number of digits. For those, you can not worry
    about controlling the alignment, which is why the ‘c’ column type works.
    The ‘table-parse-only’ option does a very similar thing but with the
    digit formatting of siunitx.

    siunitx can’t make the assumption that each column is ‘well behaved’.
    There may be different numbers to print in each column, for example

    10.123
    4.56
    2.345

    So siunitx has to box things up to maintain alignment. That means that
    it needs to know how many digits to allow for, hence the need for the
    ‘table-format’ option (known as ‘tabformat’ in version 1 of siunitx).
    The way that tables are constructed by LaTeX means that this is not
    available at the start of a column, hence needing it from the user as an
    option. (I’ve thought about a two-pass automated system, but it’s a
    complicated issue.)

    Regards,

    Joseph

    Aspetto la Tex Live 2010 per probare l’opzione table-parse-only di siunitx 2.0.

    Ciao,
    L.

    Go to top