TransWikia.com

siunitx: aligning infty in an S column

TeX - LaTeX Asked on June 19, 2021

What’s the best way to align infty at the decimal point in an S column when using siunitx? Consider, if you will, the following contrived MWE:

documentclass{article}
usepackage{siunitx}
begin{document}
begin{tabular}{S}
    0.1111111 
    1         
    10        
    $infty$  
    1000
end{tabular}
end{document}

which produces

enter image description here

But that’s not particularly nice, and I’d prefer the following:

enter image description here

Is there a way to achieve this? FWIW I’m not hung up on using siunitx, so feel free to suggest other packages that provide column types for the automatic alignment and formatting of numbers in tabulars.

As always, thanks!

One Answer

You can use

documentclass{article}
usepackage{siunitx}
begin{document}
sisetup{
  input-digits = 0123456789infty
}
begin{tabular}{S}
    0.1111111 
    1         
    10        
    infty  
    1000
end{tabular}
end{document}

See section 8.11, Symbolic digits in the manual (v3)

enter image description here

Correct answer by daleif on June 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP