siunitx in tabularx

Multi tool use
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
KreMaster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
KreMaster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
KreMaster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
KreMaster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
KreMaster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
KreMaster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Nov 14 at 17:45
KreMaster
112
112
New contributor
KreMaster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
KreMaster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
KreMaster is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
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
Ew7o,AcOB sf VAAj2Gh,inqW4rTkkMZp,ewwZYy8Y6ZZUTpFVTF3Bu72BKj,W7N03wgp8 X
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