siunitx in tabularx
up vote
2
down vote
favorite
I have a tabularx-table with a lot of SI values. For this, I wanted to define a new column type u which places the contents of the column into a SI{XXX}{cm} expression.
newcolumntype{u}{>{SIbegingroup}{X}<{endgroup{cm}}}
Using this in a tabularx-table throws me an "Illegal pream token X" and "invalid-token-in-number" exception. Replacing X with c leaves me with only the "invalid-token"-exception.
What can I do to make this work?
tables tabularx siunitx
New contributor
add a comment |
up vote
2
down vote
favorite
I have a tabularx-table with a lot of SI values. For this, I wanted to define a new column type u which places the contents of the column into a SI{XXX}{cm} expression.
newcolumntype{u}{>{SIbegingroup}{X}<{endgroup{cm}}}
Using this in a tabularx-table throws me an "Illegal pream token X" and "invalid-token-in-number" exception. Replacing X with c leaves me with only the "invalid-token"-exception.
What can I do to make this work?
tables tabularx siunitx
New contributor
2
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. In particular, please add a minimal working example (MWE) which reproduces your error.
– CarLaTeX
Nov 14 at 18:02
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have a tabularx-table with a lot of SI values. For this, I wanted to define a new column type u which places the contents of the column into a SI{XXX}{cm} expression.
newcolumntype{u}{>{SIbegingroup}{X}<{endgroup{cm}}}
Using this in a tabularx-table throws me an "Illegal pream token X" and "invalid-token-in-number" exception. Replacing X with c leaves me with only the "invalid-token"-exception.
What can I do to make this work?
tables tabularx siunitx
New contributor
I have a tabularx-table with a lot of SI values. For this, I wanted to define a new column type u which places the contents of the column into a SI{XXX}{cm} expression.
newcolumntype{u}{>{SIbegingroup}{X}<{endgroup{cm}}}
Using this in a tabularx-table throws me an "Illegal pream token X" and "invalid-token-in-number" exception. Replacing X with c leaves me with only the "invalid-token"-exception.
What can I do to make this work?
tables tabularx siunitx
tables tabularx siunitx
New contributor
New contributor
New contributor
asked Nov 14 at 17:45
KreMaster
112
112
New contributor
New contributor
2
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. In particular, please add a minimal working example (MWE) which reproduces your error.
– CarLaTeX
Nov 14 at 18:02
add a comment |
2
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. In particular, please add a minimal working example (MWE) which reproduces your error.
– CarLaTeX
Nov 14 at 18:02
2
2
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. In particular, please add a minimal working example (MWE) which reproduces your error.
– CarLaTeX
Nov 14 at 18:02
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. In particular, please add a minimal working example (MWE) which reproduces your error.
– CarLaTeX
Nov 14 at 18:02
add a comment |
1 Answer
1
active
oldest
votes
up vote
4
down vote
One way to do what you desire is to use the collcell
package:
Code:
documentclass{article}
usepackage{booktabs}
usepackage{siunitx}
usepackage{collcell}
newcommand{MyCommand}[1]{SI{#1}{cm}}
newcolumntype{u}{>{collectcellMyCommand}{l}<{endcollectcell}}
begin{document}
begin{tabular}{l u}
toprule
1 inch & 2.54 \
1 meter & 100 \
bottomrule
end{tabular}
end{document}
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
One way to do what you desire is to use the collcell
package:
Code:
documentclass{article}
usepackage{booktabs}
usepackage{siunitx}
usepackage{collcell}
newcommand{MyCommand}[1]{SI{#1}{cm}}
newcolumntype{u}{>{collectcellMyCommand}{l}<{endcollectcell}}
begin{document}
begin{tabular}{l u}
toprule
1 inch & 2.54 \
1 meter & 100 \
bottomrule
end{tabular}
end{document}
add a comment |
up vote
4
down vote
One way to do what you desire is to use the collcell
package:
Code:
documentclass{article}
usepackage{booktabs}
usepackage{siunitx}
usepackage{collcell}
newcommand{MyCommand}[1]{SI{#1}{cm}}
newcolumntype{u}{>{collectcellMyCommand}{l}<{endcollectcell}}
begin{document}
begin{tabular}{l u}
toprule
1 inch & 2.54 \
1 meter & 100 \
bottomrule
end{tabular}
end{document}
add a comment |
up vote
4
down vote
up vote
4
down vote
One way to do what you desire is to use the collcell
package:
Code:
documentclass{article}
usepackage{booktabs}
usepackage{siunitx}
usepackage{collcell}
newcommand{MyCommand}[1]{SI{#1}{cm}}
newcolumntype{u}{>{collectcellMyCommand}{l}<{endcollectcell}}
begin{document}
begin{tabular}{l u}
toprule
1 inch & 2.54 \
1 meter & 100 \
bottomrule
end{tabular}
end{document}
One way to do what you desire is to use the collcell
package:
Code:
documentclass{article}
usepackage{booktabs}
usepackage{siunitx}
usepackage{collcell}
newcommand{MyCommand}[1]{SI{#1}{cm}}
newcolumntype{u}{>{collectcellMyCommand}{l}<{endcollectcell}}
begin{document}
begin{tabular}{l u}
toprule
1 inch & 2.54 \
1 meter & 100 \
bottomrule
end{tabular}
end{document}
answered Nov 14 at 18:21
Peter Grill
163k24432740
163k24432740
add a comment |
add a comment |
KreMaster is a new contributor. Be nice, and check out our Code of Conduct.
KreMaster is a new contributor. Be nice, and check out our Code of Conduct.
KreMaster is a new contributor. Be nice, and check out our Code of Conduct.
KreMaster is a new contributor. Be nice, and check out our Code of Conduct.
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%2f459987%2fsiunitx-in-tabularx%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
2
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. In particular, please add a minimal working example (MWE) which reproduces your error.
– CarLaTeX
Nov 14 at 18:02