Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Using the siunitx package. I have a table with column specifier S if I then put an imaginary number in it comes up with a compile time error:

! siunitx error: "table-partial-number"
!
! No space reserved for a complex on line 20.
!
! See the siunitx documentation for further information.
...
| The number in the current table cell contains a complex part,
| but you did not reserve any space to print it:
| it will be missing in the output.

It sounds like I need to enter in some optional argument to make this work but I don't know what that is from reading the manual.

Here's some code (remove the i in the left column to make to compile):

\documentclass{article}
\usepackage{siunitx}
\usepackage{booktabs}


\begin{document}


\begin{table}
   \centering
   \sisetup{table-alignment=center}
   \begin{tabular}{ S S S S }
   \toprule
      \multicolumn{3}{c}{things} & \\
          a             &  b             &  c             & {related things}\\
   \midrule
          1             &  1             &  1             &   1    \\
          2             &  1             &  2             &   4    \\
          3i             &  2             &  3             &  18    \\
          4             &  2             &  4             &  32    \\
      \bottomrule
   \end{tabular}
\end{table}

\end{document}
share|improve this question
4  
Currently "this won't work". I added complex numbers to support certain edge-case uses where you see, for example, imaginary frequencies. Dealing with these in tables has not exactly been a priority: there are a large number of possible alignment cases that I'm not too keen on taking on. I've always imagined that in a table, the complex part would in any case have a column to itself and be divide by i, for example 'Imaginary frequency/i cm^-1'. –  Joseph Wright May 25 '11 at 19:45
    
To elaborate further, what alignment would you expect in column 1? Should the 3 come under the 2, or after it? If the former happens, what then occurs if the input is 1 + i? –  Joseph Wright May 25 '11 at 19:48
    
Indeed, I see the general alignment problem when a real component is included. In this case I imagined the numbers being aligned as though there were no i' after and then the i' being appended to the right. In the case of this table with nothing after the radix, i could set table-figures-decimal=0' and add \textit{i}' after the imaginary frequencies. –  aghsmith May 25 '11 at 20:13
    
What do you think, is this sensible or am i missing a trick. –  aghsmith May 25 '11 at 20:14
1  
@User1269: The problem for me (as a package author) is that simplifications which seems okay to individual end-users tend to come back to bother me! I've got 'look at tables again' pencilled in for v2.3, so I will see what I can do for imaginary numbers. I'm hoping to have a go at this next month. –  Joseph Wright May 25 '11 at 20:18

1 Answer 1

(More of a comment, but converted to an answer as there is not a better one.)

Currently "this won't work". I added complex numbers to support certain edge-case uses where you see, for example, imaginary frequencies. Dealing with these in tables has not exactly been a priority: there are a large number of possible alignment cases that I'm not too keen on taking on. I've always imagined that in a table, the complex part would in any case have a column to itself and be divide by i, for example Imaginary frequency/i cm$^-1$.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.