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













4















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
align-environment
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?










share|improve this question

















  • 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















4















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
align-environment
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?










share|improve this question

















  • 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













4












4








4








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
align-environment
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?










share|improve this question














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
align-environment
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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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












  • 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










3 Answers
3






active

oldest

votes


















5














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.



enter image description here



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





share|improve this answer























  • 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 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


















5














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


Output of the MWE using <code>tfrac</code> instead of <code>nicefrac</code>.



(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.






share|improve this answer
































    4














    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


    enter image description here






    share|improve this answer

























      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%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









      5














      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.



      enter image description here



      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





      share|improve this answer























      • 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 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















      5














      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.



      enter image description here



      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





      share|improve this answer























      • 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 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













      5












      5








      5







      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.



      enter image description here



      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





      share|improve this answer













      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.



      enter image description here



      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






      share|improve this answer












      share|improve this answer



      share|improve this answer










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

















      • 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 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
















      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











      5














      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


      Output of the MWE using <code>tfrac</code> instead of <code>nicefrac</code>.



      (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.






      share|improve this answer





























        5














        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


        Output of the MWE using <code>tfrac</code> instead of <code>nicefrac</code>.



        (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.






        share|improve this answer



























          5












          5








          5







          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


          Output of the MWE using <code>tfrac</code> instead of <code>nicefrac</code>.



          (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.






          share|improve this answer















          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


          Output of the MWE using <code>tfrac</code> instead of <code>nicefrac</code>.



          (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.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 23 at 6:46

























          answered Jun 22 at 20:45









          MatthiasMatthias

          9755 silver badges16 bronze badges




          9755 silver badges16 bronze badges





















              4














              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


              enter image description here






              share|improve this answer



























                4














                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


                enter image description here






                share|improve this answer

























                  4












                  4








                  4







                  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


                  enter image description here






                  share|improve this answer













                  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


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  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



























                      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%2f496968%2fcorrect-spacing-in-the-alignat-environment%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

                      Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

                      Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

                      Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림