siunitx error: Invalid numerical inputHow to print tabular confidence intervals as [x, y] with siunitx?Overfull hbox (3.8889pt too wide) detectedSiunitx: how to deal with invalid numerical input '-'?
Increase speed altering column on large table to NON NULL
Why is long-term living in Almost-Earth causing severe health problems?
Why was this person allowed to become Grand Maester?
Does putting salt first make it easier for attacker to bruteforce the hash?
Are inverted question and exclamation mark supposed to be symmetrical to the "normal" counter-parts?
How creative should the DM let an artificer be in terms of what they can build?
How to publish items after pipeline is finished?
What are some really overused phrases in French that are common nowadays?
How can I use String in enum for Apex?
Should I put programming books I wrote a few years ago on my resume?
Proving that a Russian cryptographic standard is too structured
Is it possible to have 2 different but equal size real number sets that have the same mean and standard deviation?
If I leave the US through an airport, do I have to return through the same airport?
What aircraft was used as Air Force One for the flight between Southampton and Shannon?
How to safely destroy (a large quantity of) valid checks?
Can I utilise a baking stone to make crepes?
Solve Riddle With Algebra
Single-key teletype?
60s or 70s novel about Empire of Man making 1st contact with 1st discovered alien race
Which is the better way to call a method that is only available to one class that implements an interface but not the other one?
Why did Intel abandon unified CPU cache?
A word that means "blending into a community too much"
Can a human be transformed into a Mind Flayer?
Why Does Mama Coco Look Old After Going to the Other World?
siunitx error: Invalid numerical input
How to print tabular confidence intervals as [x, y] with siunitx?Overfull hbox (3.8889pt too wide) detectedSiunitx: how to deal with invalid numerical input '-'?
I use siunitx package to display intervals in tabular, according to this answer. But I use parenthesis instead of square bracket. This is a MWE:
%!TeX program = xelatex
%!TeX encoding = UTF-8
documentclassarticle
usepackagesiunitx
usepackagepdflscape
usepackagebooktabs
begindocument
beginlandscape
begintable
begintabular
l*3
S[table-format=1.3]@hspace0.5em
>(
S[table-format=1.3,table-space-text-pre=(]
@,,
S[table-format=1.3,table-space-text-post=)]
<)@hspace2em
S[table-format=1.3]@hspace0.5em
>(
S[table-format=1.3,table-space-text-pre=(]
@,,
S[table-format=1.3,table-space-text-post=)]
<)
toprule
& multicolumn3c@hspace2em$mathitExp(lambda)$ & multicolumn3c@hspace2.5em$G(2,lambda)$ & multicolumn3c@hspace2.5em$G(3,lambda)$ & multicolumn3@c@hspace0.5em$N^+(mu,omega^2)$ \
midrule
$alpha_0$ & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404 & 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365cr
$alpha_1$ & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025cr
$beta_1$ & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056 & 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057cr
$beta_2$ & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767 & 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767cr
$beta_3$ & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113 & 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113cr
$sigma^2$ & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032 & 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032cr
$lambda$ & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588 & 3.383 & 3.240 & 3.531 & multicolumn3@c@hspace0.5em--cr
$mu$ & multicolumn3c@hspace2em-- & multicolumn3c@hspace2.5em-- & multicolumn3c@hspace2.5em-- & 0.286 & 0.243 & 0.324cr
$omega^2$ & multicolumn3c@hspace2em-- & multicolumn3c@hspace2.5em-- & multicolumn3c@hspace2.5em-- & 0.440 & 0.397 & 0.485cr
DIC & multicolumn3c@hspace2em$-$9687.5 & multicolumn3c@hspace2.5em$-$10274.1 & multicolumn3c@hspace2.5em$-$10592.1 & multicolumn3@c@hspace0.5em$-$10173.7cr
bottomrule
endtabular
endtable
endlandscape
enddocument
Actually, it works well on TeX Live 2017 (the version of siunitx is v2.7g). But when I compile it on TeX Live 2019 (the version of siunitx is v2.7s), an error arises, which says invalid numerical input '(4.150'
. I'm confused. However, if I use square brackets, the error disappears. So I think the problem is that the parenthese are always considered as opening and closing symbols used for uncertainty input, when only left parenthesis used, the siunitx package decides it is an invalid numerical input. Therefore, I change input-open-uncertainty
to [
and input-close-uncertainty
to ]
:
sisetupinput-open-uncertainty=[,input-close-uncertainty=]
And it works! So I want to know why a single parenthesis can not be used with a number even if table-space-text-pre
is specified. Why does this problem happen in the newer version of siunitx package?
tables siunitx
add a comment |
I use siunitx package to display intervals in tabular, according to this answer. But I use parenthesis instead of square bracket. This is a MWE:
%!TeX program = xelatex
%!TeX encoding = UTF-8
documentclassarticle
usepackagesiunitx
usepackagepdflscape
usepackagebooktabs
begindocument
beginlandscape
begintable
begintabular
l*3
S[table-format=1.3]@hspace0.5em
>(
S[table-format=1.3,table-space-text-pre=(]
@,,
S[table-format=1.3,table-space-text-post=)]
<)@hspace2em
S[table-format=1.3]@hspace0.5em
>(
S[table-format=1.3,table-space-text-pre=(]
@,,
S[table-format=1.3,table-space-text-post=)]
<)
toprule
& multicolumn3c@hspace2em$mathitExp(lambda)$ & multicolumn3c@hspace2.5em$G(2,lambda)$ & multicolumn3c@hspace2.5em$G(3,lambda)$ & multicolumn3@c@hspace0.5em$N^+(mu,omega^2)$ \
midrule
$alpha_0$ & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404 & 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365cr
$alpha_1$ & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025cr
$beta_1$ & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056 & 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057cr
$beta_2$ & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767 & 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767cr
$beta_3$ & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113 & 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113cr
$sigma^2$ & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032 & 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032cr
$lambda$ & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588 & 3.383 & 3.240 & 3.531 & multicolumn3@c@hspace0.5em--cr
$mu$ & multicolumn3c@hspace2em-- & multicolumn3c@hspace2.5em-- & multicolumn3c@hspace2.5em-- & 0.286 & 0.243 & 0.324cr
$omega^2$ & multicolumn3c@hspace2em-- & multicolumn3c@hspace2.5em-- & multicolumn3c@hspace2.5em-- & 0.440 & 0.397 & 0.485cr
DIC & multicolumn3c@hspace2em$-$9687.5 & multicolumn3c@hspace2.5em$-$10274.1 & multicolumn3c@hspace2.5em$-$10592.1 & multicolumn3@c@hspace0.5em$-$10173.7cr
bottomrule
endtabular
endtable
endlandscape
enddocument
Actually, it works well on TeX Live 2017 (the version of siunitx is v2.7g). But when I compile it on TeX Live 2019 (the version of siunitx is v2.7s), an error arises, which says invalid numerical input '(4.150'
. I'm confused. However, if I use square brackets, the error disappears. So I think the problem is that the parenthese are always considered as opening and closing symbols used for uncertainty input, when only left parenthesis used, the siunitx package decides it is an invalid numerical input. Therefore, I change input-open-uncertainty
to [
and input-close-uncertainty
to ]
:
sisetupinput-open-uncertainty=[,input-close-uncertainty=]
And it works! So I want to know why a single parenthesis can not be used with a number even if table-space-text-pre
is specified. Why does this problem happen in the newer version of siunitx package?
tables siunitx
The use case for theS
column type isn't clear: Your code compiles fine -- and the ouput looks just fine -- if everyS
column is replaced withc
.
– Mico
Jun 2 at 8:40
@Mico Yeah, in this case,S
column perhaps is not necessary. Actually, I have quite a few tables, and some of them needS
column type. I got this problem incidentally.
– North
Jun 2 at 9:13
add a comment |
I use siunitx package to display intervals in tabular, according to this answer. But I use parenthesis instead of square bracket. This is a MWE:
%!TeX program = xelatex
%!TeX encoding = UTF-8
documentclassarticle
usepackagesiunitx
usepackagepdflscape
usepackagebooktabs
begindocument
beginlandscape
begintable
begintabular
l*3
S[table-format=1.3]@hspace0.5em
>(
S[table-format=1.3,table-space-text-pre=(]
@,,
S[table-format=1.3,table-space-text-post=)]
<)@hspace2em
S[table-format=1.3]@hspace0.5em
>(
S[table-format=1.3,table-space-text-pre=(]
@,,
S[table-format=1.3,table-space-text-post=)]
<)
toprule
& multicolumn3c@hspace2em$mathitExp(lambda)$ & multicolumn3c@hspace2.5em$G(2,lambda)$ & multicolumn3c@hspace2.5em$G(3,lambda)$ & multicolumn3@c@hspace0.5em$N^+(mu,omega^2)$ \
midrule
$alpha_0$ & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404 & 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365cr
$alpha_1$ & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025cr
$beta_1$ & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056 & 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057cr
$beta_2$ & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767 & 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767cr
$beta_3$ & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113 & 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113cr
$sigma^2$ & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032 & 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032cr
$lambda$ & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588 & 3.383 & 3.240 & 3.531 & multicolumn3@c@hspace0.5em--cr
$mu$ & multicolumn3c@hspace2em-- & multicolumn3c@hspace2.5em-- & multicolumn3c@hspace2.5em-- & 0.286 & 0.243 & 0.324cr
$omega^2$ & multicolumn3c@hspace2em-- & multicolumn3c@hspace2.5em-- & multicolumn3c@hspace2.5em-- & 0.440 & 0.397 & 0.485cr
DIC & multicolumn3c@hspace2em$-$9687.5 & multicolumn3c@hspace2.5em$-$10274.1 & multicolumn3c@hspace2.5em$-$10592.1 & multicolumn3@c@hspace0.5em$-$10173.7cr
bottomrule
endtabular
endtable
endlandscape
enddocument
Actually, it works well on TeX Live 2017 (the version of siunitx is v2.7g). But when I compile it on TeX Live 2019 (the version of siunitx is v2.7s), an error arises, which says invalid numerical input '(4.150'
. I'm confused. However, if I use square brackets, the error disappears. So I think the problem is that the parenthese are always considered as opening and closing symbols used for uncertainty input, when only left parenthesis used, the siunitx package decides it is an invalid numerical input. Therefore, I change input-open-uncertainty
to [
and input-close-uncertainty
to ]
:
sisetupinput-open-uncertainty=[,input-close-uncertainty=]
And it works! So I want to know why a single parenthesis can not be used with a number even if table-space-text-pre
is specified. Why does this problem happen in the newer version of siunitx package?
tables siunitx
I use siunitx package to display intervals in tabular, according to this answer. But I use parenthesis instead of square bracket. This is a MWE:
%!TeX program = xelatex
%!TeX encoding = UTF-8
documentclassarticle
usepackagesiunitx
usepackagepdflscape
usepackagebooktabs
begindocument
beginlandscape
begintable
begintabular
l*3
S[table-format=1.3]@hspace0.5em
>(
S[table-format=1.3,table-space-text-pre=(]
@,,
S[table-format=1.3,table-space-text-post=)]
<)@hspace2em
S[table-format=1.3]@hspace0.5em
>(
S[table-format=1.3,table-space-text-pre=(]
@,,
S[table-format=1.3,table-space-text-post=)]
<)
toprule
& multicolumn3c@hspace2em$mathitExp(lambda)$ & multicolumn3c@hspace2.5em$G(2,lambda)$ & multicolumn3c@hspace2.5em$G(3,lambda)$ & multicolumn3@c@hspace0.5em$N^+(mu,omega^2)$ \
midrule
$alpha_0$ & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404 & 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365cr
$alpha_1$ & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025cr
$beta_1$ & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056 & 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057cr
$beta_2$ & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767 & 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767cr
$beta_3$ & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113 & 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113cr
$sigma^2$ & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032 & 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032cr
$lambda$ & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588 & 3.383 & 3.240 & 3.531 & multicolumn3@c@hspace0.5em--cr
$mu$ & multicolumn3c@hspace2em-- & multicolumn3c@hspace2.5em-- & multicolumn3c@hspace2.5em-- & 0.286 & 0.243 & 0.324cr
$omega^2$ & multicolumn3c@hspace2em-- & multicolumn3c@hspace2.5em-- & multicolumn3c@hspace2.5em-- & 0.440 & 0.397 & 0.485cr
DIC & multicolumn3c@hspace2em$-$9687.5 & multicolumn3c@hspace2.5em$-$10274.1 & multicolumn3c@hspace2.5em$-$10592.1 & multicolumn3@c@hspace0.5em$-$10173.7cr
bottomrule
endtabular
endtable
endlandscape
enddocument
Actually, it works well on TeX Live 2017 (the version of siunitx is v2.7g). But when I compile it on TeX Live 2019 (the version of siunitx is v2.7s), an error arises, which says invalid numerical input '(4.150'
. I'm confused. However, if I use square brackets, the error disappears. So I think the problem is that the parenthese are always considered as opening and closing symbols used for uncertainty input, when only left parenthesis used, the siunitx package decides it is an invalid numerical input. Therefore, I change input-open-uncertainty
to [
and input-close-uncertainty
to ]
:
sisetupinput-open-uncertainty=[,input-close-uncertainty=]
And it works! So I want to know why a single parenthesis can not be used with a number even if table-space-text-pre
is specified. Why does this problem happen in the newer version of siunitx package?
tables siunitx
tables siunitx
edited Jun 2 at 8:28
North
asked Jun 2 at 8:00
NorthNorth
385
385
The use case for theS
column type isn't clear: Your code compiles fine -- and the ouput looks just fine -- if everyS
column is replaced withc
.
– Mico
Jun 2 at 8:40
@Mico Yeah, in this case,S
column perhaps is not necessary. Actually, I have quite a few tables, and some of them needS
column type. I got this problem incidentally.
– North
Jun 2 at 9:13
add a comment |
The use case for theS
column type isn't clear: Your code compiles fine -- and the ouput looks just fine -- if everyS
column is replaced withc
.
– Mico
Jun 2 at 8:40
@Mico Yeah, in this case,S
column perhaps is not necessary. Actually, I have quite a few tables, and some of them needS
column type. I got this problem incidentally.
– North
Jun 2 at 9:13
The use case for the
S
column type isn't clear: Your code compiles fine -- and the ouput looks just fine -- if every S
column is replaced with c
.– Mico
Jun 2 at 8:40
The use case for the
S
column type isn't clear: Your code compiles fine -- and the ouput looks just fine -- if every S
column is replaced with c
.– Mico
Jun 2 at 8:40
@Mico Yeah, in this case,
S
column perhaps is not necessary. Actually, I have quite a few tables, and some of them need S
column type. I got this problem incidentally.– North
Jun 2 at 9:13
@Mico Yeah, in this case,
S
column perhaps is not necessary. Actually, I have quite a few tables, and some of them need S
column type. I got this problem incidentally.– North
Jun 2 at 9:13
add a comment |
3 Answers
3
active
oldest
votes
You correctly surmised that the opening parenthesis is always treated as marking the start of the uncertainty. This is necessary for siunitx
to be able to reliably parse numbers. The option table-space-text-pre
does not change this; it only adds the width of its value ((
in this case) to the column, the actual token ((
) is not treated any differently because of this.
You can still achieve your goal without redefining the uncertainty input by hiding the parentheses from the parser. This can be done by putting them inside a group (between and
). It looks like you already tried this in
>(
, but the error message tells you that this group is not there any more when the siunitx
parser reads the parenthesis. How can this be?
When TeX consumes the argument of a macro, it strips it of one layer of braces (if present). This means that sometimes, depending on the implementation of the macros you are using, some of the braces you type disappear before they reach the part of the machine they were meant for.
There are two ways of dealing with this.
- You could add more braces. In your case, one additional layer is enough:
>(
- You can hide your braces from TeX by putting them inside a macro. Define a macro
newcommand*foo(
and use it like>foo
. Now, when this argument is handed through the different macros implementing the table,foo
is still unexpanded. It only gets expanded once thesiunitx
parser tries to make sense of its input and then it finds(
, as desired. In general, this approach is much safer and easier than the first one since you don't have to first find out how many layers of braces you need and your code does not break when this number changes.
As to why this does not occur in older versions of siunitx
I can only guess. To me, it looks like either a bug in the old versions or a new feature in the new ones. (Being able to add parts of the number before parsing using >
and <
is definitely a feature, I would say.)
Thanks for your explanation. I just tried defining a macro, and it works! This is exactly what I want.
– North
Jun 2 at 9:41
add a comment |
You forgot to add option input-symbols = ( )
. With adding it and cleaning a bit of your code, I obtain:
MWE:
documentclassarticle
usepackagesiunitx
usepackagepdflscape
usepackagebooktabs
newcommanddshmulticolumn3c@hspace2em--
newcommandmcc[1]multicolumn3@ c @hspace1em$#1$
begindocument
beginlandscape
begintable
% centering
sisetuptable-format=1.3, % <---
input-symbols = ( ) % <===
begintabular
>$l<$
*3S @hspace0.5em
>(S[table-space-text-pre=(]
@,,
S[table-space-text-post=)]<)@hspace2em
S @hspace0.5em
>(
S[table-space-text-pre=(]
@,,
S[table-space-text-post=)]<)
toprule
& mccmathitExp(lambda) & mccG(2,lambda)
& mccG(3,lambda) & mccN^+(mu,omega^2) \
midrule
alpha_0 & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404
& 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365 cr
alpha_1 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025
& 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025cr
beta_1 & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056
& 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057cr
beta_2 & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767
& 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767cr
beta_3 & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113
& 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113cr
sigma^2 & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032
& 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032cr
lambda & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588
& 3.383 & 3.240 & 3.531 & dshcr
mu & dsh & dsh & dsh & 0.286 & 0.243 & 0.324cr
omega^2 & dsh & dsh & dsh & 0.440 & 0.397 & 0.485cr
omega^2 & multicolumn3c@hspace2em--
& multicolumn3c@hspace2.5em--
& multicolumn3c@hspace2.5em--
& 0.440 & 0.397 & 0.485cr
mathrmDIC& mcc-9687.5 & mcc-10274.1 & mcc-10592.1
& mcc-10173.7cr
bottomrule
endtabular
endtable
endlandscape
enddocument
edit: corrected column specification.
Thanks! Actually, I have seen this question. It's a good solution, but the problem is it produces bad boxes.
– North
Jun 2 at 9:23
add a comment |
Your code doesn't seem to require the siunitx
package and its S
column type. The basic c
column type would appear to perform just as well.
Another suggestion: use an array
environment rather than a tabular
environment; this change will save you from having to type lots of $
symbols.
In addition to replacing S
with c
in the following example, I cleaned up and simplified your code a bit.
documentclassarticle
usepackagearray,amsmath,pdflscape,booktabs
begindocument
beginlandscape
begintable
centering
setlengtharraycolsep1em
$beginarray@
l
*4 c
@hspace1em
>(c
@,,
c<)
@
toprule
& multicolumn3cexp(lambda)
& multicolumn3cG(2,lambda)
& multicolumn3cG(3,lambda)
& multicolumn3c@N^+(mu,omega^2) \
midrule
alpha_0 & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404
& 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365\
alpha_1 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025
& 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025\
beta_1 & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056
& 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057\
beta_2 & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767
& 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767\
beta_3 & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113
& 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113\
sigma^2 & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032
& 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032\
lambda & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588
& 3.383 & 3.240 & 3.531 & multicolumn3c@text--\
mu
& multicolumn3ctext--
& multicolumn3ctext--
& multicolumn3ctext--
& 0.286 & 0.243 & 0.324\
omega^2
& multicolumn3ctext--
& multicolumn3ctext--
& multicolumn3ctext--
& 0.440 & 0.397 & 0.485\
mathrmDIC
& multicolumn3c-9687.5
& multicolumn3c-10274.1
& multicolumn3c-10592.1
& multicolumn3c@-10173.7\
bottomrule
endarray$
endtable
endlandscape
enddocument
Addendum: If you do need to use the S
column type, all you'd have to change in the code above is (a) load the siunitx
package and (b) replace
$beginarray@
l
*4 c
@hspace1em
>(c
@,,
c<)
@
with
sisetupinput-symbols = (), % inform siunitx that "(" and ")" have no special meaning
table-format=1.3
$beginarray@
l
*4 S
@hspace1em
>(S
@,,
S<)
@
1
Thank you Mico. This result looks good, I think I should use the basicc
type in some of my tables.
– North
Jun 2 at 9:34
add a comment |
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',
autoActivateHeartbeat: false,
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f493765%2fsiunitx-error-invalid-numerical-input%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You correctly surmised that the opening parenthesis is always treated as marking the start of the uncertainty. This is necessary for siunitx
to be able to reliably parse numbers. The option table-space-text-pre
does not change this; it only adds the width of its value ((
in this case) to the column, the actual token ((
) is not treated any differently because of this.
You can still achieve your goal without redefining the uncertainty input by hiding the parentheses from the parser. This can be done by putting them inside a group (between and
). It looks like you already tried this in
>(
, but the error message tells you that this group is not there any more when the siunitx
parser reads the parenthesis. How can this be?
When TeX consumes the argument of a macro, it strips it of one layer of braces (if present). This means that sometimes, depending on the implementation of the macros you are using, some of the braces you type disappear before they reach the part of the machine they were meant for.
There are two ways of dealing with this.
- You could add more braces. In your case, one additional layer is enough:
>(
- You can hide your braces from TeX by putting them inside a macro. Define a macro
newcommand*foo(
and use it like>foo
. Now, when this argument is handed through the different macros implementing the table,foo
is still unexpanded. It only gets expanded once thesiunitx
parser tries to make sense of its input and then it finds(
, as desired. In general, this approach is much safer and easier than the first one since you don't have to first find out how many layers of braces you need and your code does not break when this number changes.
As to why this does not occur in older versions of siunitx
I can only guess. To me, it looks like either a bug in the old versions or a new feature in the new ones. (Being able to add parts of the number before parsing using >
and <
is definitely a feature, I would say.)
Thanks for your explanation. I just tried defining a macro, and it works! This is exactly what I want.
– North
Jun 2 at 9:41
add a comment |
You correctly surmised that the opening parenthesis is always treated as marking the start of the uncertainty. This is necessary for siunitx
to be able to reliably parse numbers. The option table-space-text-pre
does not change this; it only adds the width of its value ((
in this case) to the column, the actual token ((
) is not treated any differently because of this.
You can still achieve your goal without redefining the uncertainty input by hiding the parentheses from the parser. This can be done by putting them inside a group (between and
). It looks like you already tried this in
>(
, but the error message tells you that this group is not there any more when the siunitx
parser reads the parenthesis. How can this be?
When TeX consumes the argument of a macro, it strips it of one layer of braces (if present). This means that sometimes, depending on the implementation of the macros you are using, some of the braces you type disappear before they reach the part of the machine they were meant for.
There are two ways of dealing with this.
- You could add more braces. In your case, one additional layer is enough:
>(
- You can hide your braces from TeX by putting them inside a macro. Define a macro
newcommand*foo(
and use it like>foo
. Now, when this argument is handed through the different macros implementing the table,foo
is still unexpanded. It only gets expanded once thesiunitx
parser tries to make sense of its input and then it finds(
, as desired. In general, this approach is much safer and easier than the first one since you don't have to first find out how many layers of braces you need and your code does not break when this number changes.
As to why this does not occur in older versions of siunitx
I can only guess. To me, it looks like either a bug in the old versions or a new feature in the new ones. (Being able to add parts of the number before parsing using >
and <
is definitely a feature, I would say.)
Thanks for your explanation. I just tried defining a macro, and it works! This is exactly what I want.
– North
Jun 2 at 9:41
add a comment |
You correctly surmised that the opening parenthesis is always treated as marking the start of the uncertainty. This is necessary for siunitx
to be able to reliably parse numbers. The option table-space-text-pre
does not change this; it only adds the width of its value ((
in this case) to the column, the actual token ((
) is not treated any differently because of this.
You can still achieve your goal without redefining the uncertainty input by hiding the parentheses from the parser. This can be done by putting them inside a group (between and
). It looks like you already tried this in
>(
, but the error message tells you that this group is not there any more when the siunitx
parser reads the parenthesis. How can this be?
When TeX consumes the argument of a macro, it strips it of one layer of braces (if present). This means that sometimes, depending on the implementation of the macros you are using, some of the braces you type disappear before they reach the part of the machine they were meant for.
There are two ways of dealing with this.
- You could add more braces. In your case, one additional layer is enough:
>(
- You can hide your braces from TeX by putting them inside a macro. Define a macro
newcommand*foo(
and use it like>foo
. Now, when this argument is handed through the different macros implementing the table,foo
is still unexpanded. It only gets expanded once thesiunitx
parser tries to make sense of its input and then it finds(
, as desired. In general, this approach is much safer and easier than the first one since you don't have to first find out how many layers of braces you need and your code does not break when this number changes.
As to why this does not occur in older versions of siunitx
I can only guess. To me, it looks like either a bug in the old versions or a new feature in the new ones. (Being able to add parts of the number before parsing using >
and <
is definitely a feature, I would say.)
You correctly surmised that the opening parenthesis is always treated as marking the start of the uncertainty. This is necessary for siunitx
to be able to reliably parse numbers. The option table-space-text-pre
does not change this; it only adds the width of its value ((
in this case) to the column, the actual token ((
) is not treated any differently because of this.
You can still achieve your goal without redefining the uncertainty input by hiding the parentheses from the parser. This can be done by putting them inside a group (between and
). It looks like you already tried this in
>(
, but the error message tells you that this group is not there any more when the siunitx
parser reads the parenthesis. How can this be?
When TeX consumes the argument of a macro, it strips it of one layer of braces (if present). This means that sometimes, depending on the implementation of the macros you are using, some of the braces you type disappear before they reach the part of the machine they were meant for.
There are two ways of dealing with this.
- You could add more braces. In your case, one additional layer is enough:
>(
- You can hide your braces from TeX by putting them inside a macro. Define a macro
newcommand*foo(
and use it like>foo
. Now, when this argument is handed through the different macros implementing the table,foo
is still unexpanded. It only gets expanded once thesiunitx
parser tries to make sense of its input and then it finds(
, as desired. In general, this approach is much safer and easier than the first one since you don't have to first find out how many layers of braces you need and your code does not break when this number changes.
As to why this does not occur in older versions of siunitx
I can only guess. To me, it looks like either a bug in the old versions or a new feature in the new ones. (Being able to add parts of the number before parsing using >
and <
is definitely a feature, I would say.)
answered Jun 2 at 8:51
schtandardschtandard
3,45211227
3,45211227
Thanks for your explanation. I just tried defining a macro, and it works! This is exactly what I want.
– North
Jun 2 at 9:41
add a comment |
Thanks for your explanation. I just tried defining a macro, and it works! This is exactly what I want.
– North
Jun 2 at 9:41
Thanks for your explanation. I just tried defining a macro, and it works! This is exactly what I want.
– North
Jun 2 at 9:41
Thanks for your explanation. I just tried defining a macro, and it works! This is exactly what I want.
– North
Jun 2 at 9:41
add a comment |
You forgot to add option input-symbols = ( )
. With adding it and cleaning a bit of your code, I obtain:
MWE:
documentclassarticle
usepackagesiunitx
usepackagepdflscape
usepackagebooktabs
newcommanddshmulticolumn3c@hspace2em--
newcommandmcc[1]multicolumn3@ c @hspace1em$#1$
begindocument
beginlandscape
begintable
% centering
sisetuptable-format=1.3, % <---
input-symbols = ( ) % <===
begintabular
>$l<$
*3S @hspace0.5em
>(S[table-space-text-pre=(]
@,,
S[table-space-text-post=)]<)@hspace2em
S @hspace0.5em
>(
S[table-space-text-pre=(]
@,,
S[table-space-text-post=)]<)
toprule
& mccmathitExp(lambda) & mccG(2,lambda)
& mccG(3,lambda) & mccN^+(mu,omega^2) \
midrule
alpha_0 & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404
& 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365 cr
alpha_1 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025
& 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025cr
beta_1 & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056
& 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057cr
beta_2 & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767
& 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767cr
beta_3 & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113
& 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113cr
sigma^2 & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032
& 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032cr
lambda & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588
& 3.383 & 3.240 & 3.531 & dshcr
mu & dsh & dsh & dsh & 0.286 & 0.243 & 0.324cr
omega^2 & dsh & dsh & dsh & 0.440 & 0.397 & 0.485cr
omega^2 & multicolumn3c@hspace2em--
& multicolumn3c@hspace2.5em--
& multicolumn3c@hspace2.5em--
& 0.440 & 0.397 & 0.485cr
mathrmDIC& mcc-9687.5 & mcc-10274.1 & mcc-10592.1
& mcc-10173.7cr
bottomrule
endtabular
endtable
endlandscape
enddocument
edit: corrected column specification.
Thanks! Actually, I have seen this question. It's a good solution, but the problem is it produces bad boxes.
– North
Jun 2 at 9:23
add a comment |
You forgot to add option input-symbols = ( )
. With adding it and cleaning a bit of your code, I obtain:
MWE:
documentclassarticle
usepackagesiunitx
usepackagepdflscape
usepackagebooktabs
newcommanddshmulticolumn3c@hspace2em--
newcommandmcc[1]multicolumn3@ c @hspace1em$#1$
begindocument
beginlandscape
begintable
% centering
sisetuptable-format=1.3, % <---
input-symbols = ( ) % <===
begintabular
>$l<$
*3S @hspace0.5em
>(S[table-space-text-pre=(]
@,,
S[table-space-text-post=)]<)@hspace2em
S @hspace0.5em
>(
S[table-space-text-pre=(]
@,,
S[table-space-text-post=)]<)
toprule
& mccmathitExp(lambda) & mccG(2,lambda)
& mccG(3,lambda) & mccN^+(mu,omega^2) \
midrule
alpha_0 & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404
& 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365 cr
alpha_1 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025
& 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025cr
beta_1 & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056
& 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057cr
beta_2 & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767
& 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767cr
beta_3 & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113
& 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113cr
sigma^2 & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032
& 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032cr
lambda & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588
& 3.383 & 3.240 & 3.531 & dshcr
mu & dsh & dsh & dsh & 0.286 & 0.243 & 0.324cr
omega^2 & dsh & dsh & dsh & 0.440 & 0.397 & 0.485cr
omega^2 & multicolumn3c@hspace2em--
& multicolumn3c@hspace2.5em--
& multicolumn3c@hspace2.5em--
& 0.440 & 0.397 & 0.485cr
mathrmDIC& mcc-9687.5 & mcc-10274.1 & mcc-10592.1
& mcc-10173.7cr
bottomrule
endtabular
endtable
endlandscape
enddocument
edit: corrected column specification.
Thanks! Actually, I have seen this question. It's a good solution, but the problem is it produces bad boxes.
– North
Jun 2 at 9:23
add a comment |
You forgot to add option input-symbols = ( )
. With adding it and cleaning a bit of your code, I obtain:
MWE:
documentclassarticle
usepackagesiunitx
usepackagepdflscape
usepackagebooktabs
newcommanddshmulticolumn3c@hspace2em--
newcommandmcc[1]multicolumn3@ c @hspace1em$#1$
begindocument
beginlandscape
begintable
% centering
sisetuptable-format=1.3, % <---
input-symbols = ( ) % <===
begintabular
>$l<$
*3S @hspace0.5em
>(S[table-space-text-pre=(]
@,,
S[table-space-text-post=)]<)@hspace2em
S @hspace0.5em
>(
S[table-space-text-pre=(]
@,,
S[table-space-text-post=)]<)
toprule
& mccmathitExp(lambda) & mccG(2,lambda)
& mccG(3,lambda) & mccN^+(mu,omega^2) \
midrule
alpha_0 & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404
& 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365 cr
alpha_1 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025
& 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025cr
beta_1 & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056
& 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057cr
beta_2 & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767
& 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767cr
beta_3 & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113
& 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113cr
sigma^2 & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032
& 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032cr
lambda & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588
& 3.383 & 3.240 & 3.531 & dshcr
mu & dsh & dsh & dsh & 0.286 & 0.243 & 0.324cr
omega^2 & dsh & dsh & dsh & 0.440 & 0.397 & 0.485cr
omega^2 & multicolumn3c@hspace2em--
& multicolumn3c@hspace2.5em--
& multicolumn3c@hspace2.5em--
& 0.440 & 0.397 & 0.485cr
mathrmDIC& mcc-9687.5 & mcc-10274.1 & mcc-10592.1
& mcc-10173.7cr
bottomrule
endtabular
endtable
endlandscape
enddocument
edit: corrected column specification.
You forgot to add option input-symbols = ( )
. With adding it and cleaning a bit of your code, I obtain:
MWE:
documentclassarticle
usepackagesiunitx
usepackagepdflscape
usepackagebooktabs
newcommanddshmulticolumn3c@hspace2em--
newcommandmcc[1]multicolumn3@ c @hspace1em$#1$
begindocument
beginlandscape
begintable
% centering
sisetuptable-format=1.3, % <---
input-symbols = ( ) % <===
begintabular
>$l<$
*3S @hspace0.5em
>(S[table-space-text-pre=(]
@,,
S[table-space-text-post=)]<)@hspace2em
S @hspace0.5em
>(
S[table-space-text-pre=(]
@,,
S[table-space-text-post=)]<)
toprule
& mccmathitExp(lambda) & mccG(2,lambda)
& mccG(3,lambda) & mccN^+(mu,omega^2) \
midrule
alpha_0 & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404
& 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365 cr
alpha_1 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025
& 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025cr
beta_1 & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056
& 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057cr
beta_2 & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767
& 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767cr
beta_3 & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113
& 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113cr
sigma^2 & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032
& 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032cr
lambda & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588
& 3.383 & 3.240 & 3.531 & dshcr
mu & dsh & dsh & dsh & 0.286 & 0.243 & 0.324cr
omega^2 & dsh & dsh & dsh & 0.440 & 0.397 & 0.485cr
omega^2 & multicolumn3c@hspace2em--
& multicolumn3c@hspace2.5em--
& multicolumn3c@hspace2.5em--
& 0.440 & 0.397 & 0.485cr
mathrmDIC& mcc-9687.5 & mcc-10274.1 & mcc-10592.1
& mcc-10173.7cr
bottomrule
endtabular
endtable
endlandscape
enddocument
edit: corrected column specification.
edited Jun 2 at 9:35
answered Jun 2 at 8:50
ZarkoZarko
137k872180
137k872180
Thanks! Actually, I have seen this question. It's a good solution, but the problem is it produces bad boxes.
– North
Jun 2 at 9:23
add a comment |
Thanks! Actually, I have seen this question. It's a good solution, but the problem is it produces bad boxes.
– North
Jun 2 at 9:23
Thanks! Actually, I have seen this question. It's a good solution, but the problem is it produces bad boxes.
– North
Jun 2 at 9:23
Thanks! Actually, I have seen this question. It's a good solution, but the problem is it produces bad boxes.
– North
Jun 2 at 9:23
add a comment |
Your code doesn't seem to require the siunitx
package and its S
column type. The basic c
column type would appear to perform just as well.
Another suggestion: use an array
environment rather than a tabular
environment; this change will save you from having to type lots of $
symbols.
In addition to replacing S
with c
in the following example, I cleaned up and simplified your code a bit.
documentclassarticle
usepackagearray,amsmath,pdflscape,booktabs
begindocument
beginlandscape
begintable
centering
setlengtharraycolsep1em
$beginarray@
l
*4 c
@hspace1em
>(c
@,,
c<)
@
toprule
& multicolumn3cexp(lambda)
& multicolumn3cG(2,lambda)
& multicolumn3cG(3,lambda)
& multicolumn3c@N^+(mu,omega^2) \
midrule
alpha_0 & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404
& 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365\
alpha_1 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025
& 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025\
beta_1 & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056
& 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057\
beta_2 & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767
& 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767\
beta_3 & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113
& 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113\
sigma^2 & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032
& 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032\
lambda & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588
& 3.383 & 3.240 & 3.531 & multicolumn3c@text--\
mu
& multicolumn3ctext--
& multicolumn3ctext--
& multicolumn3ctext--
& 0.286 & 0.243 & 0.324\
omega^2
& multicolumn3ctext--
& multicolumn3ctext--
& multicolumn3ctext--
& 0.440 & 0.397 & 0.485\
mathrmDIC
& multicolumn3c-9687.5
& multicolumn3c-10274.1
& multicolumn3c-10592.1
& multicolumn3c@-10173.7\
bottomrule
endarray$
endtable
endlandscape
enddocument
Addendum: If you do need to use the S
column type, all you'd have to change in the code above is (a) load the siunitx
package and (b) replace
$beginarray@
l
*4 c
@hspace1em
>(c
@,,
c<)
@
with
sisetupinput-symbols = (), % inform siunitx that "(" and ")" have no special meaning
table-format=1.3
$beginarray@
l
*4 S
@hspace1em
>(S
@,,
S<)
@
1
Thank you Mico. This result looks good, I think I should use the basicc
type in some of my tables.
– North
Jun 2 at 9:34
add a comment |
Your code doesn't seem to require the siunitx
package and its S
column type. The basic c
column type would appear to perform just as well.
Another suggestion: use an array
environment rather than a tabular
environment; this change will save you from having to type lots of $
symbols.
In addition to replacing S
with c
in the following example, I cleaned up and simplified your code a bit.
documentclassarticle
usepackagearray,amsmath,pdflscape,booktabs
begindocument
beginlandscape
begintable
centering
setlengtharraycolsep1em
$beginarray@
l
*4 c
@hspace1em
>(c
@,,
c<)
@
toprule
& multicolumn3cexp(lambda)
& multicolumn3cG(2,lambda)
& multicolumn3cG(3,lambda)
& multicolumn3c@N^+(mu,omega^2) \
midrule
alpha_0 & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404
& 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365\
alpha_1 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025
& 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025\
beta_1 & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056
& 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057\
beta_2 & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767
& 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767\
beta_3 & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113
& 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113\
sigma^2 & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032
& 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032\
lambda & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588
& 3.383 & 3.240 & 3.531 & multicolumn3c@text--\
mu
& multicolumn3ctext--
& multicolumn3ctext--
& multicolumn3ctext--
& 0.286 & 0.243 & 0.324\
omega^2
& multicolumn3ctext--
& multicolumn3ctext--
& multicolumn3ctext--
& 0.440 & 0.397 & 0.485\
mathrmDIC
& multicolumn3c-9687.5
& multicolumn3c-10274.1
& multicolumn3c-10592.1
& multicolumn3c@-10173.7\
bottomrule
endarray$
endtable
endlandscape
enddocument
Addendum: If you do need to use the S
column type, all you'd have to change in the code above is (a) load the siunitx
package and (b) replace
$beginarray@
l
*4 c
@hspace1em
>(c
@,,
c<)
@
with
sisetupinput-symbols = (), % inform siunitx that "(" and ")" have no special meaning
table-format=1.3
$beginarray@
l
*4 S
@hspace1em
>(S
@,,
S<)
@
1
Thank you Mico. This result looks good, I think I should use the basicc
type in some of my tables.
– North
Jun 2 at 9:34
add a comment |
Your code doesn't seem to require the siunitx
package and its S
column type. The basic c
column type would appear to perform just as well.
Another suggestion: use an array
environment rather than a tabular
environment; this change will save you from having to type lots of $
symbols.
In addition to replacing S
with c
in the following example, I cleaned up and simplified your code a bit.
documentclassarticle
usepackagearray,amsmath,pdflscape,booktabs
begindocument
beginlandscape
begintable
centering
setlengtharraycolsep1em
$beginarray@
l
*4 c
@hspace1em
>(c
@,,
c<)
@
toprule
& multicolumn3cexp(lambda)
& multicolumn3cG(2,lambda)
& multicolumn3cG(3,lambda)
& multicolumn3c@N^+(mu,omega^2) \
midrule
alpha_0 & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404
& 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365\
alpha_1 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025
& 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025\
beta_1 & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056
& 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057\
beta_2 & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767
& 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767\
beta_3 & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113
& 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113\
sigma^2 & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032
& 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032\
lambda & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588
& 3.383 & 3.240 & 3.531 & multicolumn3c@text--\
mu
& multicolumn3ctext--
& multicolumn3ctext--
& multicolumn3ctext--
& 0.286 & 0.243 & 0.324\
omega^2
& multicolumn3ctext--
& multicolumn3ctext--
& multicolumn3ctext--
& 0.440 & 0.397 & 0.485\
mathrmDIC
& multicolumn3c-9687.5
& multicolumn3c-10274.1
& multicolumn3c-10592.1
& multicolumn3c@-10173.7\
bottomrule
endarray$
endtable
endlandscape
enddocument
Addendum: If you do need to use the S
column type, all you'd have to change in the code above is (a) load the siunitx
package and (b) replace
$beginarray@
l
*4 c
@hspace1em
>(c
@,,
c<)
@
with
sisetupinput-symbols = (), % inform siunitx that "(" and ")" have no special meaning
table-format=1.3
$beginarray@
l
*4 S
@hspace1em
>(S
@,,
S<)
@
Your code doesn't seem to require the siunitx
package and its S
column type. The basic c
column type would appear to perform just as well.
Another suggestion: use an array
environment rather than a tabular
environment; this change will save you from having to type lots of $
symbols.
In addition to replacing S
with c
in the following example, I cleaned up and simplified your code a bit.
documentclassarticle
usepackagearray,amsmath,pdflscape,booktabs
begindocument
beginlandscape
begintable
centering
setlengtharraycolsep1em
$beginarray@
l
*4 c
@hspace1em
>(c
@,,
c<)
@
toprule
& multicolumn3cexp(lambda)
& multicolumn3cG(2,lambda)
& multicolumn3cG(3,lambda)
& multicolumn3c@N^+(mu,omega^2) \
midrule
alpha_0 & 4.239 & 4.150 & 4.330 & 4.315 & 4.225 & 4.404
& 4.371 & 4.281 & 4.459 & 4.273 & 4.183 & 4.365\
alpha_1 & 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025
& 0.024 & 0.024 & 0.025 & 0.024 & 0.024 & 0.025\
beta_1 & 0.054 & 0.049 & 0.060 & 0.051 & 0.045 & 0.056
& 0.049 & 0.043 & 0.054 & 0.051 & 0.046 & 0.057\
beta_2 & 0.755 & 0.749 & 0.761 & 0.761 & 0.755 & 0.767
& 0.765 & 0.758 & 0.771 & 0.761 & 0.755 & 0.767\
beta_3 & 0.109 & 0.102 & 0.116 & 0.106 & 0.099 & 0.113
& 0.105 & 0.098 & 0.112 & 0.106 & 0.099 & 0.113\
sigma^2 & 0.032 & 0.031 & 0.033 & 0.031 & 0.030 & 0.032
& 0.030 & 0.030 & 0.031 & 0.031 & 0.030 & 0.032\
lambda & 1.426 & 1.352 & 1.502 & 2.468 & 2.356 & 2.588
& 3.383 & 3.240 & 3.531 & multicolumn3c@text--\
mu
& multicolumn3ctext--
& multicolumn3ctext--
& multicolumn3ctext--
& 0.286 & 0.243 & 0.324\
omega^2
& multicolumn3ctext--
& multicolumn3ctext--
& multicolumn3ctext--
& 0.440 & 0.397 & 0.485\
mathrmDIC
& multicolumn3c-9687.5
& multicolumn3c-10274.1
& multicolumn3c-10592.1
& multicolumn3c@-10173.7\
bottomrule
endarray$
endtable
endlandscape
enddocument
Addendum: If you do need to use the S
column type, all you'd have to change in the code above is (a) load the siunitx
package and (b) replace
$beginarray@
l
*4 c
@hspace1em
>(c
@,,
c<)
@
with
sisetupinput-symbols = (), % inform siunitx that "(" and ")" have no special meaning
table-format=1.3
$beginarray@
l
*4 S
@hspace1em
>(S
@,,
S<)
@
edited Jun 2 at 9:36
answered Jun 2 at 9:13
MicoMico
293k32403792
293k32403792
1
Thank you Mico. This result looks good, I think I should use the basicc
type in some of my tables.
– North
Jun 2 at 9:34
add a comment |
1
Thank you Mico. This result looks good, I think I should use the basicc
type in some of my tables.
– North
Jun 2 at 9:34
1
1
Thank you Mico. This result looks good, I think I should use the basic
c
type in some of my tables.– North
Jun 2 at 9:34
Thank you Mico. This result looks good, I think I should use the basic
c
type in some of my tables.– North
Jun 2 at 9:34
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f493765%2fsiunitx-error-invalid-numerical-input%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
The use case for the
S
column type isn't clear: Your code compiles fine -- and the ouput looks just fine -- if everyS
column is replaced withc
.– Mico
Jun 2 at 8:40
@Mico Yeah, in this case,
S
column perhaps is not necessary. Actually, I have quite a few tables, and some of them needS
column type. I got this problem incidentally.– North
Jun 2 at 9:13