Correct spacing in the alignat*-environmentAlignement in columns and spacing between columns of an equations environmentHyperref, amsmath, and horizontal spacing at start of a numbered equationwhat is the correct way to typeset equations with a leading indicator/marker on eachDefining new split environment with reduced spacingIncorrect spacing after minus sign with combination of amsmath and hyperrefIs there a cleaner way to get the proper spacing in this alignedat?Number equations and preserving alignment of equal signsSplit an equation into two linesDifferent alignments in alignat environmentInserting spacing between the plus sign and a number
Identifying positions of the last TRUEs in a sequence of TRUEs and FALSEs
Disk usage buggy: 10G missing on Linux home partition on SSD
Tikz radius of the bullets with node
What's the lunar calendar of two moons
What is this fluorinated organic substance?
How soon after takeoff can you recline your airplane seat?
Why are symbols not written in words?
How to track mail undetectably?
Why did the Apple IIe make a hideous noise if you inserted the disk upside down?
Is this house-rule removing the increased effect of cantrips at higher character levels balanced?
German idiomatic equivalents of 能骗就骗 (if you can cheat, then cheat)
Why is my 401k manager recommending me to save more?
ATMEGA328P-U vs ATMEGA328-PU
What would you need merely the term "collection" for pitches, but not "scale"?
Robots in a spaceship
What prevents a US state from colonizing a smaller state?
How do I present a future free of gender stereotypes without being jarring or overpowering the narrative?
What is the lowest possible AC?
Is it beneficial to use a crop sensor camera with a full frame telezoom?
Tricolour nonogram
Time for some proverbs!
Is it OK to throw pebbles and stones in streams, waterfalls, ponds, etc.?
I agreed to cancel a long-planned vacation (with travel costs) due to project deadlines, but now the timeline has all changed again
Why do movie directors use brown tint on Mexico cities?
Correct spacing in the alignat*-environment
Alignement in columns and spacing between columns of an equations environmentHyperref, amsmath, and horizontal spacing at start of a numbered equationwhat is the correct way to typeset equations with a leading indicator/marker on eachDefining new split environment with reduced spacingIncorrect spacing after minus sign with combination of amsmath and hyperrefIs there a cleaner way to get the proper spacing in this alignedat?Number equations and preserving alignment of equal signsSplit an equation into two linesDifferent alignments in alignat environmentInserting spacing between the plus sign and a number
The following code is given:
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
which outputs
The output however should have the same spacing between each number like the first equation h(x) = g_s(x) - g_s(x - 1) has. (In other words, the spacing between the minus sign is too small.) How will I obtain this result?
math-mode equations amsmath alignat
add a comment |
The following code is given:
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
which outputs
The output however should have the same spacing between each number like the first equation h(x) = g_s(x) - g_s(x - 1) has. (In other words, the spacing between the minus sign is too small.) How will I obtain this result?
math-mode equations amsmath alignat
1
as always it's easier to test if you provide a test document not a fragment, but use=
– David Carlisle
Jun 22 at 20:43
I will take this into consideration for my next posts, thanks for pointing that out.
– Doesbaddel
Jun 22 at 21:15
add a comment |
The following code is given:
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
which outputs
The output however should have the same spacing between each number like the first equation h(x) = g_s(x) - g_s(x - 1) has. (In other words, the spacing between the minus sign is too small.) How will I obtain this result?
math-mode equations amsmath alignat
The following code is given:
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
which outputs
The output however should have the same spacing between each number like the first equation h(x) = g_s(x) - g_s(x - 1) has. (In other words, the spacing between the minus sign is too small.) How will I obtain this result?
math-mode equations amsmath alignat
math-mode equations amsmath alignat
asked Jun 22 at 20:39
DoesbaddelDoesbaddel
1578 bronze badges
1578 bronze badges
1
as always it's easier to test if you provide a test document not a fragment, but use=
– David Carlisle
Jun 22 at 20:43
I will take this into consideration for my next posts, thanks for pointing that out.
– Doesbaddel
Jun 22 at 21:15
add a comment |
1
as always it's easier to test if you provide a test document not a fragment, but use=
– David Carlisle
Jun 22 at 20:43
I will take this into consideration for my next posts, thanks for pointing that out.
– Doesbaddel
Jun 22 at 21:15
1
1
as always it's easier to test if you provide a test document not a fragment, but use
=– David Carlisle
Jun 22 at 20:43
as always it's easier to test if you provide a test document not a fragment, but use
=– David Carlisle
Jun 22 at 20:43
I will take this into consideration for my next posts, thanks for pointing that out.
– Doesbaddel
Jun 22 at 21:15
I will take this into consideration for my next posts, thanks for pointing that out.
– Doesbaddel
Jun 22 at 21:15
add a comment |
3 Answers
3
active
oldest
votes
Two ways depending how you think of it - forces a binary - but you could view the form as only having right hand sides of the second and third groups so if you mark the empty lhs with && then the - at the start of the right hand sides get the usual space.

documentclassarticle
usepackageamsmath,nicefrac
begindocument
aaa
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
bbb
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
ccc
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 && - 0.00 && = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 && - 0.25 && = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 && - 0.50 && = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 && - 0.75 && = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 && - 1.00 && = 0
endalignat*
enddocument
Is there a difference between b) and c) or do both variants produce exactly the same result?
– Doesbaddel
Jun 22 at 21:17
1
@Doesbaddel same result here as your numbers are same width but change the0.75to0.7and you will see the&&version keeps them left aligned wehereas your original and the-version right aligns them. I think&&is better actually but...
– David Carlisle
Jun 22 at 21:39
Ok, thank you for clarification!
– Doesbaddel
Jun 22 at 22:07
add a comment |
Using = solves the spacing issue:
documentclassarticle
usepackageamsmath
usepackagenicefrac
begindocument
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
enddocument

(I do not have the package nicefrac installed. I would recommend to use tfrac instead of nicefrac. Most mathematicians prefer a horizontal fraction bar.)
Edit
Here is another version that might make more sense with respect to the structure of the content:
documentclassarticle
usepackageamsmath
usepackagenicefrac
begindocument
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) && = 0.25 - 0.00 && = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) && = 0.50 - 0.25 && = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) && = 0.75 - 0.50 && = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) && = 1.00 - 0.75 && = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) && = 1.00 - 1.00 && = 0
endalignat*
enddocument
David Carlisle shows yet another version for placing the delimiters in his answer to this question. All versions have pros and cons, and it depends, e.g., on the format of the numbers and the other content, which one is best.
add a comment |
A tabstackengine approach. Here, the TABbinary forces the leading negatives to be considered binary, the setstackalingap allows the horizontal gap between align groups to be eliminated and the setsatckgapL allows for the baselineskip to be set.
documentclassarticle
usepackageamsmath,nicefrac,tabstackengine
TABstackMath
begindocument
[
TABbinary
setstackaligngap0pt
setstackgapL1.2baselineskip
alignCenterstack
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
]
enddocument

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%2f496968%2fcorrect-spacing-in-the-alignat-environment%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
Two ways depending how you think of it - forces a binary - but you could view the form as only having right hand sides of the second and third groups so if you mark the empty lhs with && then the - at the start of the right hand sides get the usual space.

documentclassarticle
usepackageamsmath,nicefrac
begindocument
aaa
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
bbb
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
ccc
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 && - 0.00 && = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 && - 0.25 && = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 && - 0.50 && = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 && - 0.75 && = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 && - 1.00 && = 0
endalignat*
enddocument
Is there a difference between b) and c) or do both variants produce exactly the same result?
– Doesbaddel
Jun 22 at 21:17
1
@Doesbaddel same result here as your numbers are same width but change the0.75to0.7and you will see the&&version keeps them left aligned wehereas your original and the-version right aligns them. I think&&is better actually but...
– David Carlisle
Jun 22 at 21:39
Ok, thank you for clarification!
– Doesbaddel
Jun 22 at 22:07
add a comment |
Two ways depending how you think of it - forces a binary - but you could view the form as only having right hand sides of the second and third groups so if you mark the empty lhs with && then the - at the start of the right hand sides get the usual space.

documentclassarticle
usepackageamsmath,nicefrac
begindocument
aaa
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
bbb
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
ccc
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 && - 0.00 && = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 && - 0.25 && = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 && - 0.50 && = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 && - 0.75 && = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 && - 1.00 && = 0
endalignat*
enddocument
Is there a difference between b) and c) or do both variants produce exactly the same result?
– Doesbaddel
Jun 22 at 21:17
1
@Doesbaddel same result here as your numbers are same width but change the0.75to0.7and you will see the&&version keeps them left aligned wehereas your original and the-version right aligns them. I think&&is better actually but...
– David Carlisle
Jun 22 at 21:39
Ok, thank you for clarification!
– Doesbaddel
Jun 22 at 22:07
add a comment |
Two ways depending how you think of it - forces a binary - but you could view the form as only having right hand sides of the second and third groups so if you mark the empty lhs with && then the - at the start of the right hand sides get the usual space.

documentclassarticle
usepackageamsmath,nicefrac
begindocument
aaa
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
bbb
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
ccc
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 && - 0.00 && = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 && - 0.25 && = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 && - 0.50 && = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 && - 0.75 && = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 && - 1.00 && = 0
endalignat*
enddocument
Two ways depending how you think of it - forces a binary - but you could view the form as only having right hand sides of the second and third groups so if you mark the empty lhs with && then the - at the start of the right hand sides get the usual space.

documentclassarticle
usepackageamsmath,nicefrac
begindocument
aaa
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
bbb
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
ccc
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 && - 0.00 && = nicefrac14\
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 && - 0.25 && = nicefrac14\
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 && - 0.50 && = nicefrac14\
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 && - 0.75 && = nicefrac14\
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 && - 1.00 && = 0
endalignat*
enddocument
answered Jun 22 at 20:51
David CarlisleDavid Carlisle
513k44 gold badges1163 silver badges1927 bronze badges
513k44 gold badges1163 silver badges1927 bronze badges
Is there a difference between b) and c) or do both variants produce exactly the same result?
– Doesbaddel
Jun 22 at 21:17
1
@Doesbaddel same result here as your numbers are same width but change the0.75to0.7and you will see the&&version keeps them left aligned wehereas your original and the-version right aligns them. I think&&is better actually but...
– David Carlisle
Jun 22 at 21:39
Ok, thank you for clarification!
– Doesbaddel
Jun 22 at 22:07
add a comment |
Is there a difference between b) and c) or do both variants produce exactly the same result?
– Doesbaddel
Jun 22 at 21:17
1
@Doesbaddel same result here as your numbers are same width but change the0.75to0.7and you will see the&&version keeps them left aligned wehereas your original and the-version right aligns them. I think&&is better actually but...
– David Carlisle
Jun 22 at 21:39
Ok, thank you for clarification!
– Doesbaddel
Jun 22 at 22:07
Is there a difference between b) and c) or do both variants produce exactly the same result?
– Doesbaddel
Jun 22 at 21:17
Is there a difference between b) and c) or do both variants produce exactly the same result?
– Doesbaddel
Jun 22 at 21:17
1
1
@Doesbaddel same result here as your numbers are same width but change the
0.75 to 0.7 and you will see the && version keeps them left aligned wehereas your original and the - version right aligns them. I think && is better actually but...– David Carlisle
Jun 22 at 21:39
@Doesbaddel same result here as your numbers are same width but change the
0.75 to 0.7 and you will see the && version keeps them left aligned wehereas your original and the - version right aligns them. I think && is better actually but...– David Carlisle
Jun 22 at 21:39
Ok, thank you for clarification!
– Doesbaddel
Jun 22 at 22:07
Ok, thank you for clarification!
– Doesbaddel
Jun 22 at 22:07
add a comment |
Using = solves the spacing issue:
documentclassarticle
usepackageamsmath
usepackagenicefrac
begindocument
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
enddocument

(I do not have the package nicefrac installed. I would recommend to use tfrac instead of nicefrac. Most mathematicians prefer a horizontal fraction bar.)
Edit
Here is another version that might make more sense with respect to the structure of the content:
documentclassarticle
usepackageamsmath
usepackagenicefrac
begindocument
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) && = 0.25 - 0.00 && = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) && = 0.50 - 0.25 && = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) && = 0.75 - 0.50 && = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) && = 1.00 - 0.75 && = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) && = 1.00 - 1.00 && = 0
endalignat*
enddocument
David Carlisle shows yet another version for placing the delimiters in his answer to this question. All versions have pros and cons, and it depends, e.g., on the format of the numbers and the other content, which one is best.
add a comment |
Using = solves the spacing issue:
documentclassarticle
usepackageamsmath
usepackagenicefrac
begindocument
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
enddocument

(I do not have the package nicefrac installed. I would recommend to use tfrac instead of nicefrac. Most mathematicians prefer a horizontal fraction bar.)
Edit
Here is another version that might make more sense with respect to the structure of the content:
documentclassarticle
usepackageamsmath
usepackagenicefrac
begindocument
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) && = 0.25 - 0.00 && = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) && = 0.50 - 0.25 && = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) && = 0.75 - 0.50 && = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) && = 1.00 - 0.75 && = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) && = 1.00 - 1.00 && = 0
endalignat*
enddocument
David Carlisle shows yet another version for placing the delimiters in his answer to this question. All versions have pros and cons, and it depends, e.g., on the format of the numbers and the other content, which one is best.
add a comment |
Using = solves the spacing issue:
documentclassarticle
usepackageamsmath
usepackagenicefrac
begindocument
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
enddocument

(I do not have the package nicefrac installed. I would recommend to use tfrac instead of nicefrac. Most mathematicians prefer a horizontal fraction bar.)
Edit
Here is another version that might make more sense with respect to the structure of the content:
documentclassarticle
usepackageamsmath
usepackagenicefrac
begindocument
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) && = 0.25 - 0.00 && = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) && = 0.50 - 0.25 && = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) && = 0.75 - 0.50 && = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) && = 1.00 - 0.75 && = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) && = 1.00 - 1.00 && = 0
endalignat*
enddocument
David Carlisle shows yet another version for placing the delimiters in his answer to this question. All versions have pros and cons, and it depends, e.g., on the format of the numbers and the other content, which one is best.
Using = solves the spacing issue:
documentclassarticle
usepackageamsmath
usepackagenicefrac
begindocument
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
endalignat*
enddocument

(I do not have the package nicefrac installed. I would recommend to use tfrac instead of nicefrac. Most mathematicians prefer a horizontal fraction bar.)
Edit
Here is another version that might make more sense with respect to the structure of the content:
documentclassarticle
usepackageamsmath
usepackagenicefrac
begindocument
beginalignat*3
h(0) & = g_s(0) - g_s(0 - 1) && = 0.25 - 0.00 && = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) && = 0.50 - 0.25 && = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) && = 0.75 - 0.50 && = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) && = 1.00 - 0.75 && = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) && = 1.00 - 1.00 && = 0
endalignat*
enddocument
David Carlisle shows yet another version for placing the delimiters in his answer to this question. All versions have pros and cons, and it depends, e.g., on the format of the numbers and the other content, which one is best.
edited Jun 23 at 6:46
answered Jun 22 at 20:45
MatthiasMatthias
9755 silver badges16 bronze badges
9755 silver badges16 bronze badges
add a comment |
add a comment |
A tabstackengine approach. Here, the TABbinary forces the leading negatives to be considered binary, the setstackalingap allows the horizontal gap between align groups to be eliminated and the setsatckgapL allows for the baselineskip to be set.
documentclassarticle
usepackageamsmath,nicefrac,tabstackengine
TABstackMath
begindocument
[
TABbinary
setstackaligngap0pt
setstackgapL1.2baselineskip
alignCenterstack
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
]
enddocument

add a comment |
A tabstackengine approach. Here, the TABbinary forces the leading negatives to be considered binary, the setstackalingap allows the horizontal gap between align groups to be eliminated and the setsatckgapL allows for the baselineskip to be set.
documentclassarticle
usepackageamsmath,nicefrac,tabstackengine
TABstackMath
begindocument
[
TABbinary
setstackaligngap0pt
setstackgapL1.2baselineskip
alignCenterstack
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
]
enddocument

add a comment |
A tabstackengine approach. Here, the TABbinary forces the leading negatives to be considered binary, the setstackalingap allows the horizontal gap between align groups to be eliminated and the setsatckgapL allows for the baselineskip to be set.
documentclassarticle
usepackageamsmath,nicefrac,tabstackengine
TABstackMath
begindocument
[
TABbinary
setstackaligngap0pt
setstackgapL1.2baselineskip
alignCenterstack
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
]
enddocument

A tabstackengine approach. Here, the TABbinary forces the leading negatives to be considered binary, the setstackalingap allows the horizontal gap between align groups to be eliminated and the setsatckgapL allows for the baselineskip to be set.
documentclassarticle
usepackageamsmath,nicefrac,tabstackengine
TABstackMath
begindocument
[
TABbinary
setstackaligngap0pt
setstackgapL1.2baselineskip
alignCenterstack
h(0) & = g_s(0) - g_s(0 - 1) = 0.25 & - 0.00 & = nicefrac14 \
h(1) & = g_s(1) - g_s(1 - 1) = 0.50 & - 0.25 & = nicefrac14 \
h(2) & = g_s(2) - g_s(2 - 1) = 0.75 & - 0.50 & = nicefrac14 \
h(3) & = g_s(3) - g_s(3 - 1) = 1.00 & - 0.75 & = nicefrac14 \
h(4) & = g_s(4) - g_s(4 - 1) = 1.00 & - 1.00 & = 0
]
enddocument

answered Jun 22 at 20:55
Steven B. SegletesSteven B. Segletes
167k9 gold badges210 silver badges429 bronze badges
167k9 gold badges210 silver badges429 bronze badges
add a comment |
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%2f496968%2fcorrect-spacing-in-the-alignat-environment%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
1
as always it's easier to test if you provide a test document not a fragment, but use
=– David Carlisle
Jun 22 at 20:43
I will take this into consideration for my next posts, thanks for pointing that out.
– Doesbaddel
Jun 22 at 21:15