Problems with numbers (result of calculations) alignment using siunitx package inside tabular environmentsiunitx: Alignment Problems with numbers in parenthesisTabular and grid typesettingProblems with siunitx package?siunitx tabular numbers with separated uncertaintyBasic S Column Alignment with siunitx packagephantomsection inside tabular: alignment problems`siunitx` interferes with `array` and `tabular environment`Problems loading siunitx package“Undefined control sequence” Regression table from StataTable using siunitx number alignment affecting rows without numbers

Causes of bimodal distributions when bootstrapping a meta-analysis model

I need a disease

What does 'made on' mean here?

What exactly are the `size issues' preventing formation of presheaves being a left adjoint to some forgetful functor?

Should I dumb down my writing in a foreign country?

US born but as a child of foreign diplomat

What was the first story to feature the plot "the monsters were human all along"?

Does a picture or painting work with Wild Shape?

Does it make sense for a function to return a rvalue reference

Find the cheapest shipping option based on item weight

Are the Night's Watch still required?

How long would it take for people to notice a mass disappearance?

Did we get closer to another plane than we were supposed to, or was the pilot just protecting our delicate sensibilities?

SafeCracker #3 - We've Been Blocked

Why did the Apollo 13 crew extend the LM landing gear?

Why aren't nationalizations in Russia described as socialist?

How to increase the size of the cursor in Lubuntu 19.04?

Out of scope work duties and resignation

Are Finitely generated modules over a ring also finitely generated over a subring containing the identity?

Decoupling cap routing on a 4 layer PCB

Why does sound not move through a wall?

What does "Managed by Windows" do in the Power options for network connection?

How can I support myself financially as a 17 year old with a loan?

Copy previous line to current line from text file



Problems with numbers (result of calculations) alignment using siunitx package inside tabular environment


siunitx: Alignment Problems with numbers in parenthesisTabular and grid typesettingProblems with siunitx package?siunitx tabular numbers with separated uncertaintyBasic S Column Alignment with siunitx packagephantomsection inside tabular: alignment problems`siunitx` interferes with `array` and `tabular environment`Problems loading siunitx package“Undefined control sequence” Regression table from StataTable using siunitx number alignment affecting rows without numbers













3















I'm having some problems when try align numbers, results from calculations, using siunitx package. That is my code.



documentclassarticle
usepackagesiunitx
usepackagefp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
newcommand*KelvinToCelsius[2][2]%
FPevaltempKtoCround((#2-273.15):#1)%
numtempKtoC%


begindocument
begintabularS S
toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
1200.5 & KelvinToCelsius[1]1200.5\
12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular
enddocument


Which produces:



output image



Note that the numbers in second column don't be align.



How to solve this?










share|improve this question






















  • Maybe section 7.2 "Expanding content in tables" of the siunitx manual can help you.

    – leandriis
    Apr 29 at 17:32











  • You need something expandable, use the xfp package instead of fp and avoid optional arguments.

    – Ulrike Fischer
    Apr 29 at 17:35















3















I'm having some problems when try align numbers, results from calculations, using siunitx package. That is my code.



documentclassarticle
usepackagesiunitx
usepackagefp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
newcommand*KelvinToCelsius[2][2]%
FPevaltempKtoCround((#2-273.15):#1)%
numtempKtoC%


begindocument
begintabularS S
toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
1200.5 & KelvinToCelsius[1]1200.5\
12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular
enddocument


Which produces:



output image



Note that the numbers in second column don't be align.



How to solve this?










share|improve this question






















  • Maybe section 7.2 "Expanding content in tables" of the siunitx manual can help you.

    – leandriis
    Apr 29 at 17:32











  • You need something expandable, use the xfp package instead of fp and avoid optional arguments.

    – Ulrike Fischer
    Apr 29 at 17:35













3












3








3








I'm having some problems when try align numbers, results from calculations, using siunitx package. That is my code.



documentclassarticle
usepackagesiunitx
usepackagefp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
newcommand*KelvinToCelsius[2][2]%
FPevaltempKtoCround((#2-273.15):#1)%
numtempKtoC%


begindocument
begintabularS S
toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
1200.5 & KelvinToCelsius[1]1200.5\
12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular
enddocument


Which produces:



output image



Note that the numbers in second column don't be align.



How to solve this?










share|improve this question














I'm having some problems when try align numbers, results from calculations, using siunitx package. That is my code.



documentclassarticle
usepackagesiunitx
usepackagefp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
newcommand*KelvinToCelsius[2][2]%
FPevaltempKtoCround((#2-273.15):#1)%
numtempKtoC%


begindocument
begintabularS S
toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
1200.5 & KelvinToCelsius[1]1200.5\
12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular
enddocument


Which produces:



output image



Note that the numbers in second column don't be align.



How to solve this?







tables siunitx






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 29 at 17:13









GRSousaJrGRSousaJr

3579




3579












  • Maybe section 7.2 "Expanding content in tables" of the siunitx manual can help you.

    – leandriis
    Apr 29 at 17:32











  • You need something expandable, use the xfp package instead of fp and avoid optional arguments.

    – Ulrike Fischer
    Apr 29 at 17:35

















  • Maybe section 7.2 "Expanding content in tables" of the siunitx manual can help you.

    – leandriis
    Apr 29 at 17:32











  • You need something expandable, use the xfp package instead of fp and avoid optional arguments.

    – Ulrike Fischer
    Apr 29 at 17:35
















Maybe section 7.2 "Expanding content in tables" of the siunitx manual can help you.

– leandriis
Apr 29 at 17:32





Maybe section 7.2 "Expanding content in tables" of the siunitx manual can help you.

– leandriis
Apr 29 at 17:32













You need something expandable, use the xfp package instead of fp and avoid optional arguments.

– Ulrike Fischer
Apr 29 at 17:35





You need something expandable, use the xfp package instead of fp and avoid optional arguments.

– Ulrike Fischer
Apr 29 at 17:35










2 Answers
2






active

oldest

votes


















4














Use the full power of expl3; the KelvinToCelsius command must be expandable and you can have it even with an optional argument.



Using fpeval frees you from fp.



documentclassarticle
usepackagesiunitx,xfp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
NewExpandableDocumentCommandKelvinToCelsiusO2m%
fpevalround(#2-273.15,#1)%


begindocument

begintabular
S[table-format=5.2]
S[table-format=5.2]

toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
1200.5 & KelvinToCelsius[1]1200.5\
12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular

enddocument


enter image description here






share|improve this answer























  • Works perfectly!

    – GRSousaJr
    Apr 29 at 22:24


















2














The commands must be expandable so that siunitx sees "pure numbers". Better use the xfp package for the calculations and avoid optional arguments.



documentclassarticle
usepackagesiunitx
usepackagexfp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
newcommand*KelvinToCelsius[1]% no optional argument
fpevalround((#1-273.15)/2,2)%


begindocument
begintabularS S
toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
%1200.5 & KelvinToCelsius[1]1200.5\
%12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular
enddocument


enter image description here






share|improve this answer























  • Why no optional argument? ;-)

    – egreg
    Apr 29 at 17:50











  • @egreg because I was too lazy to check if it would work with xparse.

    – Ulrike Fischer
    Apr 29 at 17:53











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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f488277%2fproblems-with-numbers-result-of-calculations-alignment-using-siunitx-package-i%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














Use the full power of expl3; the KelvinToCelsius command must be expandable and you can have it even with an optional argument.



Using fpeval frees you from fp.



documentclassarticle
usepackagesiunitx,xfp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
NewExpandableDocumentCommandKelvinToCelsiusO2m%
fpevalround(#2-273.15,#1)%


begindocument

begintabular
S[table-format=5.2]
S[table-format=5.2]

toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
1200.5 & KelvinToCelsius[1]1200.5\
12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular

enddocument


enter image description here






share|improve this answer























  • Works perfectly!

    – GRSousaJr
    Apr 29 at 22:24















4














Use the full power of expl3; the KelvinToCelsius command must be expandable and you can have it even with an optional argument.



Using fpeval frees you from fp.



documentclassarticle
usepackagesiunitx,xfp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
NewExpandableDocumentCommandKelvinToCelsiusO2m%
fpevalround(#2-273.15,#1)%


begindocument

begintabular
S[table-format=5.2]
S[table-format=5.2]

toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
1200.5 & KelvinToCelsius[1]1200.5\
12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular

enddocument


enter image description here






share|improve this answer























  • Works perfectly!

    – GRSousaJr
    Apr 29 at 22:24













4












4








4







Use the full power of expl3; the KelvinToCelsius command must be expandable and you can have it even with an optional argument.



Using fpeval frees you from fp.



documentclassarticle
usepackagesiunitx,xfp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
NewExpandableDocumentCommandKelvinToCelsiusO2m%
fpevalround(#2-273.15,#1)%


begindocument

begintabular
S[table-format=5.2]
S[table-format=5.2]

toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
1200.5 & KelvinToCelsius[1]1200.5\
12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular

enddocument


enter image description here






share|improve this answer













Use the full power of expl3; the KelvinToCelsius command must be expandable and you can have it even with an optional argument.



Using fpeval frees you from fp.



documentclassarticle
usepackagesiunitx,xfp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
NewExpandableDocumentCommandKelvinToCelsiusO2m%
fpevalround(#2-273.15,#1)%


begindocument

begintabular
S[table-format=5.2]
S[table-format=5.2]

toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
1200.5 & KelvinToCelsius[1]1200.5\
12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular

enddocument


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 29 at 17:49









egregegreg

738k8919393269




738k8919393269












  • Works perfectly!

    – GRSousaJr
    Apr 29 at 22:24

















  • Works perfectly!

    – GRSousaJr
    Apr 29 at 22:24
















Works perfectly!

– GRSousaJr
Apr 29 at 22:24





Works perfectly!

– GRSousaJr
Apr 29 at 22:24











2














The commands must be expandable so that siunitx sees "pure numbers". Better use the xfp package for the calculations and avoid optional arguments.



documentclassarticle
usepackagesiunitx
usepackagexfp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
newcommand*KelvinToCelsius[1]% no optional argument
fpevalround((#1-273.15)/2,2)%


begindocument
begintabularS S
toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
%1200.5 & KelvinToCelsius[1]1200.5\
%12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular
enddocument


enter image description here






share|improve this answer























  • Why no optional argument? ;-)

    – egreg
    Apr 29 at 17:50











  • @egreg because I was too lazy to check if it would work with xparse.

    – Ulrike Fischer
    Apr 29 at 17:53















2














The commands must be expandable so that siunitx sees "pure numbers". Better use the xfp package for the calculations and avoid optional arguments.



documentclassarticle
usepackagesiunitx
usepackagexfp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
newcommand*KelvinToCelsius[1]% no optional argument
fpevalround((#1-273.15)/2,2)%


begindocument
begintabularS S
toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
%1200.5 & KelvinToCelsius[1]1200.5\
%12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular
enddocument


enter image description here






share|improve this answer























  • Why no optional argument? ;-)

    – egreg
    Apr 29 at 17:50











  • @egreg because I was too lazy to check if it would work with xparse.

    – Ulrike Fischer
    Apr 29 at 17:53













2












2








2







The commands must be expandable so that siunitx sees "pure numbers". Better use the xfp package for the calculations and avoid optional arguments.



documentclassarticle
usepackagesiunitx
usepackagexfp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
newcommand*KelvinToCelsius[1]% no optional argument
fpevalround((#1-273.15)/2,2)%


begindocument
begintabularS S
toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
%1200.5 & KelvinToCelsius[1]1200.5\
%12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular
enddocument


enter image description here






share|improve this answer













The commands must be expandable so that siunitx sees "pure numbers". Better use the xfp package for the calculations and avoid optional arguments.



documentclassarticle
usepackagesiunitx
usepackagexfp
usepackagebooktabs

% #1: decimal places (default=2), #2: value
newcommand*KelvinToCelsius[1]% no optional argument
fpevalround((#1-273.15)/2,2)%


begindocument
begintabularS S
toprule
sikelvin & sicelsius \
midrule
10.3 & KelvinToCelsius10.3 \
200.34 & KelvinToCelsius200.34 \
500.26 & KelvinToCelsius500.26 \
%1200.5 & KelvinToCelsius[1]1200.5\
%12345 & KelvinToCelsius[0]12345 \
bottomrule
endtabular
enddocument


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 29 at 17:44









Ulrike FischerUlrike Fischer

202k9310697




202k9310697












  • Why no optional argument? ;-)

    – egreg
    Apr 29 at 17:50











  • @egreg because I was too lazy to check if it would work with xparse.

    – Ulrike Fischer
    Apr 29 at 17:53

















  • Why no optional argument? ;-)

    – egreg
    Apr 29 at 17:50











  • @egreg because I was too lazy to check if it would work with xparse.

    – Ulrike Fischer
    Apr 29 at 17:53
















Why no optional argument? ;-)

– egreg
Apr 29 at 17:50





Why no optional argument? ;-)

– egreg
Apr 29 at 17:50













@egreg because I was too lazy to check if it would work with xparse.

– Ulrike Fischer
Apr 29 at 17:53





@egreg because I was too lazy to check if it would work with xparse.

– Ulrike Fischer
Apr 29 at 17:53

















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f488277%2fproblems-with-numbers-result-of-calculations-alignment-using-siunitx-package-i%23new-answer', 'question_page');

);

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







Popular posts from this blog

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form