Left aligned equations

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












In my document, I have a block of 3 equations that need to be aligned on the = sign. This is the code:



 documentclass[a4paper, 11pt]book
usepackageamsmath
begindocument

beginalignat2
&textxxxxxxx1 &&= 1/y \
&textx2 &&=y \
&textx3 &&=y^2+x2
endalignat

enddocument


However, I'd also like this block of equations to be left-aligned. Instead, with that code, it is centered on the page.



In a related post, someone suggested to use fleqn as a document class. Nevertheless, I cannot use that, because some of the equations in my document have to be centered, not all of them have to be left-aligned.










share|improve this question





















  • You want just these three to be aligned on the left margin, but still numbered at the right margin?
    – Steven B. Segletes
    3 hours ago










  • Yes, exactly. All equations in my document are numbered at the right margin, but I do not want all of them to be aligned at the left margin
    – Mary
    3 hours ago














up vote
3
down vote

favorite












In my document, I have a block of 3 equations that need to be aligned on the = sign. This is the code:



 documentclass[a4paper, 11pt]book
usepackageamsmath
begindocument

beginalignat2
&textxxxxxxx1 &&= 1/y \
&textx2 &&=y \
&textx3 &&=y^2+x2
endalignat

enddocument


However, I'd also like this block of equations to be left-aligned. Instead, with that code, it is centered on the page.



In a related post, someone suggested to use fleqn as a document class. Nevertheless, I cannot use that, because some of the equations in my document have to be centered, not all of them have to be left-aligned.










share|improve this question





















  • You want just these three to be aligned on the left margin, but still numbered at the right margin?
    – Steven B. Segletes
    3 hours ago










  • Yes, exactly. All equations in my document are numbered at the right margin, but I do not want all of them to be aligned at the left margin
    – Mary
    3 hours ago












up vote
3
down vote

favorite









up vote
3
down vote

favorite











In my document, I have a block of 3 equations that need to be aligned on the = sign. This is the code:



 documentclass[a4paper, 11pt]book
usepackageamsmath
begindocument

beginalignat2
&textxxxxxxx1 &&= 1/y \
&textx2 &&=y \
&textx3 &&=y^2+x2
endalignat

enddocument


However, I'd also like this block of equations to be left-aligned. Instead, with that code, it is centered on the page.



In a related post, someone suggested to use fleqn as a document class. Nevertheless, I cannot use that, because some of the equations in my document have to be centered, not all of them have to be left-aligned.










share|improve this question













In my document, I have a block of 3 equations that need to be aligned on the = sign. This is the code:



 documentclass[a4paper, 11pt]book
usepackageamsmath
begindocument

beginalignat2
&textxxxxxxx1 &&= 1/y \
&textx2 &&=y \
&textx3 &&=y^2+x2
endalignat

enddocument


However, I'd also like this block of equations to be left-aligned. Instead, with that code, it is centered on the page.



In a related post, someone suggested to use fleqn as a document class. Nevertheless, I cannot use that, because some of the equations in my document have to be centered, not all of them have to be left-aligned.







alignat alignment






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 3 hours ago









Mary

604




604











  • You want just these three to be aligned on the left margin, but still numbered at the right margin?
    – Steven B. Segletes
    3 hours ago










  • Yes, exactly. All equations in my document are numbered at the right margin, but I do not want all of them to be aligned at the left margin
    – Mary
    3 hours ago
















  • You want just these three to be aligned on the left margin, but still numbered at the right margin?
    – Steven B. Segletes
    3 hours ago










  • Yes, exactly. All equations in my document are numbered at the right margin, but I do not want all of them to be aligned at the left margin
    – Mary
    3 hours ago















You want just these three to be aligned on the left margin, but still numbered at the right margin?
– Steven B. Segletes
3 hours ago




You want just these three to be aligned on the left margin, but still numbered at the right margin?
– Steven B. Segletes
3 hours ago












Yes, exactly. All equations in my document are numbered at the right margin, but I do not want all of them to be aligned at the left margin
– Mary
3 hours ago




Yes, exactly. All equations in my document are numbered at the right margin, but I do not want all of them to be aligned at the left margin
– Mary
3 hours ago










2 Answers
2






active

oldest

votes

















up vote
3
down vote













it is not very clear to me what you like to obtain, so below are two options which cross my mind:



  • in the first is used flalign math environment from the amsmath package

  • in second the gather environment (also from amsmat) is enclosed in fleqn environment proviedad by he package nccmath

enter image description here



(red lines indicate text borders)



 documentclass[a4paper, 11pt]book
usepackageamsmath
usepackagenccmath

%---------------- show page layout. don't use in a real document!
usepackageshowframe
renewcommandShowFrameLinethickness0.15pt
renewcommand*ShowFrameColorcolorred
%---------------------------------------------------------------%

begindocument

beginflalign
textxxxxxxx1 &= 1/y &\
textx2 &= y &\
textx3 &= y^2+x2 &
endflalign

or

beginfleqn
begingather
textxxxxxxx1 = 1/y \
textx2 = y \
textx3 = y^2+x2
endgather
endfleqn

enddocument


edit:
from your comments follows that you like to have something like this:



enter image description here



documentclass[a4paper, 11pt]book
usepackageamsmath
usepackagenccmath

%---------------- show page layout. don't use in a real document!
usepackageshowframe
renewcommandShowFrameLinethickness0.15pt
renewcommand*ShowFrameColorcolorred
%---------------------------------------------------------------%

begindocument

beginfleqn
beginalignat2
&textxxxxxxx1 &&= 1/y \
&textx2 &&= y \
&textx3 &&= y^2+x2
endalignat
endfleqn

enddocument





share|improve this answer






















  • The first option is the most similar to what I'd like to obtain; however I'd like to also have x2 and x3 aligned at the left margin
    – Mary
    2 hours ago










  • this means, that you like to big space between left side of equations and = sign?
    – Zarko
    2 hours ago










  • Exactly. I cannot manage to do that with alignat, nor with flalign
    – Mary
    2 hours ago










  • I took the liberty of simplifying the last code also to get the spacing right. ;-)
    – egreg
    1 hour ago










  • @egreg, thank you very much. i now is better!
    – Zarko
    1 hour ago

















up vote
1
down vote













A solution not really completely automated, but you can do your job till find a completed automated method:



documentclass[a4paper, 11pt]book
usepackageamsmath
usepackagelipsum

newsaveboxmylongbox
newsaveboxmybox
newcommandlonger[1]saveboxmylongboxhbox$#1$
newcommandforceLeft[1]saveboxmybox$#1$useboxmyboxhspacedimexprwdmylongbox-wdmybox

begindocument
lipsum[2]

%Store the longer item
longertextxxxxxxx1
beginflalign
textxxxxxxx1 &= 1/y &\
%Use forceleft command for the others
forceLefttextx2 &= y &\
forceLeftfrac13cdot x_2 &= y^2+x2 &
endflalign


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',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    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%2f450921%2fleft-aligned-equations%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote













    it is not very clear to me what you like to obtain, so below are two options which cross my mind:



    • in the first is used flalign math environment from the amsmath package

    • in second the gather environment (also from amsmat) is enclosed in fleqn environment proviedad by he package nccmath

    enter image description here



    (red lines indicate text borders)



     documentclass[a4paper, 11pt]book
    usepackageamsmath
    usepackagenccmath

    %---------------- show page layout. don't use in a real document!
    usepackageshowframe
    renewcommandShowFrameLinethickness0.15pt
    renewcommand*ShowFrameColorcolorred
    %---------------------------------------------------------------%

    begindocument

    beginflalign
    textxxxxxxx1 &= 1/y &\
    textx2 &= y &\
    textx3 &= y^2+x2 &
    endflalign

    or

    beginfleqn
    begingather
    textxxxxxxx1 = 1/y \
    textx2 = y \
    textx3 = y^2+x2
    endgather
    endfleqn

    enddocument


    edit:
    from your comments follows that you like to have something like this:



    enter image description here



    documentclass[a4paper, 11pt]book
    usepackageamsmath
    usepackagenccmath

    %---------------- show page layout. don't use in a real document!
    usepackageshowframe
    renewcommandShowFrameLinethickness0.15pt
    renewcommand*ShowFrameColorcolorred
    %---------------------------------------------------------------%

    begindocument

    beginfleqn
    beginalignat2
    &textxxxxxxx1 &&= 1/y \
    &textx2 &&= y \
    &textx3 &&= y^2+x2
    endalignat
    endfleqn

    enddocument





    share|improve this answer






















    • The first option is the most similar to what I'd like to obtain; however I'd like to also have x2 and x3 aligned at the left margin
      – Mary
      2 hours ago










    • this means, that you like to big space between left side of equations and = sign?
      – Zarko
      2 hours ago










    • Exactly. I cannot manage to do that with alignat, nor with flalign
      – Mary
      2 hours ago










    • I took the liberty of simplifying the last code also to get the spacing right. ;-)
      – egreg
      1 hour ago










    • @egreg, thank you very much. i now is better!
      – Zarko
      1 hour ago














    up vote
    3
    down vote













    it is not very clear to me what you like to obtain, so below are two options which cross my mind:



    • in the first is used flalign math environment from the amsmath package

    • in second the gather environment (also from amsmat) is enclosed in fleqn environment proviedad by he package nccmath

    enter image description here



    (red lines indicate text borders)



     documentclass[a4paper, 11pt]book
    usepackageamsmath
    usepackagenccmath

    %---------------- show page layout. don't use in a real document!
    usepackageshowframe
    renewcommandShowFrameLinethickness0.15pt
    renewcommand*ShowFrameColorcolorred
    %---------------------------------------------------------------%

    begindocument

    beginflalign
    textxxxxxxx1 &= 1/y &\
    textx2 &= y &\
    textx3 &= y^2+x2 &
    endflalign

    or

    beginfleqn
    begingather
    textxxxxxxx1 = 1/y \
    textx2 = y \
    textx3 = y^2+x2
    endgather
    endfleqn

    enddocument


    edit:
    from your comments follows that you like to have something like this:



    enter image description here



    documentclass[a4paper, 11pt]book
    usepackageamsmath
    usepackagenccmath

    %---------------- show page layout. don't use in a real document!
    usepackageshowframe
    renewcommandShowFrameLinethickness0.15pt
    renewcommand*ShowFrameColorcolorred
    %---------------------------------------------------------------%

    begindocument

    beginfleqn
    beginalignat2
    &textxxxxxxx1 &&= 1/y \
    &textx2 &&= y \
    &textx3 &&= y^2+x2
    endalignat
    endfleqn

    enddocument





    share|improve this answer






















    • The first option is the most similar to what I'd like to obtain; however I'd like to also have x2 and x3 aligned at the left margin
      – Mary
      2 hours ago










    • this means, that you like to big space between left side of equations and = sign?
      – Zarko
      2 hours ago










    • Exactly. I cannot manage to do that with alignat, nor with flalign
      – Mary
      2 hours ago










    • I took the liberty of simplifying the last code also to get the spacing right. ;-)
      – egreg
      1 hour ago










    • @egreg, thank you very much. i now is better!
      – Zarko
      1 hour ago












    up vote
    3
    down vote










    up vote
    3
    down vote









    it is not very clear to me what you like to obtain, so below are two options which cross my mind:



    • in the first is used flalign math environment from the amsmath package

    • in second the gather environment (also from amsmat) is enclosed in fleqn environment proviedad by he package nccmath

    enter image description here



    (red lines indicate text borders)



     documentclass[a4paper, 11pt]book
    usepackageamsmath
    usepackagenccmath

    %---------------- show page layout. don't use in a real document!
    usepackageshowframe
    renewcommandShowFrameLinethickness0.15pt
    renewcommand*ShowFrameColorcolorred
    %---------------------------------------------------------------%

    begindocument

    beginflalign
    textxxxxxxx1 &= 1/y &\
    textx2 &= y &\
    textx3 &= y^2+x2 &
    endflalign

    or

    beginfleqn
    begingather
    textxxxxxxx1 = 1/y \
    textx2 = y \
    textx3 = y^2+x2
    endgather
    endfleqn

    enddocument


    edit:
    from your comments follows that you like to have something like this:



    enter image description here



    documentclass[a4paper, 11pt]book
    usepackageamsmath
    usepackagenccmath

    %---------------- show page layout. don't use in a real document!
    usepackageshowframe
    renewcommandShowFrameLinethickness0.15pt
    renewcommand*ShowFrameColorcolorred
    %---------------------------------------------------------------%

    begindocument

    beginfleqn
    beginalignat2
    &textxxxxxxx1 &&= 1/y \
    &textx2 &&= y \
    &textx3 &&= y^2+x2
    endalignat
    endfleqn

    enddocument





    share|improve this answer














    it is not very clear to me what you like to obtain, so below are two options which cross my mind:



    • in the first is used flalign math environment from the amsmath package

    • in second the gather environment (also from amsmat) is enclosed in fleqn environment proviedad by he package nccmath

    enter image description here



    (red lines indicate text borders)



     documentclass[a4paper, 11pt]book
    usepackageamsmath
    usepackagenccmath

    %---------------- show page layout. don't use in a real document!
    usepackageshowframe
    renewcommandShowFrameLinethickness0.15pt
    renewcommand*ShowFrameColorcolorred
    %---------------------------------------------------------------%

    begindocument

    beginflalign
    textxxxxxxx1 &= 1/y &\
    textx2 &= y &\
    textx3 &= y^2+x2 &
    endflalign

    or

    beginfleqn
    begingather
    textxxxxxxx1 = 1/y \
    textx2 = y \
    textx3 = y^2+x2
    endgather
    endfleqn

    enddocument


    edit:
    from your comments follows that you like to have something like this:



    enter image description here



    documentclass[a4paper, 11pt]book
    usepackageamsmath
    usepackagenccmath

    %---------------- show page layout. don't use in a real document!
    usepackageshowframe
    renewcommandShowFrameLinethickness0.15pt
    renewcommand*ShowFrameColorcolorred
    %---------------------------------------------------------------%

    begindocument

    beginfleqn
    beginalignat2
    &textxxxxxxx1 &&= 1/y \
    &textx2 &&= y \
    &textx3 &&= y^2+x2
    endalignat
    endfleqn

    enddocument






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 1 hour ago









    egreg

    682k8318123060




    682k8318123060










    answered 2 hours ago









    Zarko

    112k861150




    112k861150











    • The first option is the most similar to what I'd like to obtain; however I'd like to also have x2 and x3 aligned at the left margin
      – Mary
      2 hours ago










    • this means, that you like to big space between left side of equations and = sign?
      – Zarko
      2 hours ago










    • Exactly. I cannot manage to do that with alignat, nor with flalign
      – Mary
      2 hours ago










    • I took the liberty of simplifying the last code also to get the spacing right. ;-)
      – egreg
      1 hour ago










    • @egreg, thank you very much. i now is better!
      – Zarko
      1 hour ago
















    • The first option is the most similar to what I'd like to obtain; however I'd like to also have x2 and x3 aligned at the left margin
      – Mary
      2 hours ago










    • this means, that you like to big space between left side of equations and = sign?
      – Zarko
      2 hours ago










    • Exactly. I cannot manage to do that with alignat, nor with flalign
      – Mary
      2 hours ago










    • I took the liberty of simplifying the last code also to get the spacing right. ;-)
      – egreg
      1 hour ago










    • @egreg, thank you very much. i now is better!
      – Zarko
      1 hour ago















    The first option is the most similar to what I'd like to obtain; however I'd like to also have x2 and x3 aligned at the left margin
    – Mary
    2 hours ago




    The first option is the most similar to what I'd like to obtain; however I'd like to also have x2 and x3 aligned at the left margin
    – Mary
    2 hours ago












    this means, that you like to big space between left side of equations and = sign?
    – Zarko
    2 hours ago




    this means, that you like to big space between left side of equations and = sign?
    – Zarko
    2 hours ago












    Exactly. I cannot manage to do that with alignat, nor with flalign
    – Mary
    2 hours ago




    Exactly. I cannot manage to do that with alignat, nor with flalign
    – Mary
    2 hours ago












    I took the liberty of simplifying the last code also to get the spacing right. ;-)
    – egreg
    1 hour ago




    I took the liberty of simplifying the last code also to get the spacing right. ;-)
    – egreg
    1 hour ago












    @egreg, thank you very much. i now is better!
    – Zarko
    1 hour ago




    @egreg, thank you very much. i now is better!
    – Zarko
    1 hour ago










    up vote
    1
    down vote













    A solution not really completely automated, but you can do your job till find a completed automated method:



    documentclass[a4paper, 11pt]book
    usepackageamsmath
    usepackagelipsum

    newsaveboxmylongbox
    newsaveboxmybox
    newcommandlonger[1]saveboxmylongboxhbox$#1$
    newcommandforceLeft[1]saveboxmybox$#1$useboxmyboxhspacedimexprwdmylongbox-wdmybox

    begindocument
    lipsum[2]

    %Store the longer item
    longertextxxxxxxx1
    beginflalign
    textxxxxxxx1 &= 1/y &\
    %Use forceleft command for the others
    forceLefttextx2 &= y &\
    forceLeftfrac13cdot x_2 &= y^2+x2 &
    endflalign


    enddocument


    enter image description here






    share|improve this answer
























      up vote
      1
      down vote













      A solution not really completely automated, but you can do your job till find a completed automated method:



      documentclass[a4paper, 11pt]book
      usepackageamsmath
      usepackagelipsum

      newsaveboxmylongbox
      newsaveboxmybox
      newcommandlonger[1]saveboxmylongboxhbox$#1$
      newcommandforceLeft[1]saveboxmybox$#1$useboxmyboxhspacedimexprwdmylongbox-wdmybox

      begindocument
      lipsum[2]

      %Store the longer item
      longertextxxxxxxx1
      beginflalign
      textxxxxxxx1 &= 1/y &\
      %Use forceleft command for the others
      forceLefttextx2 &= y &\
      forceLeftfrac13cdot x_2 &= y^2+x2 &
      endflalign


      enddocument


      enter image description here






      share|improve this answer






















        up vote
        1
        down vote










        up vote
        1
        down vote









        A solution not really completely automated, but you can do your job till find a completed automated method:



        documentclass[a4paper, 11pt]book
        usepackageamsmath
        usepackagelipsum

        newsaveboxmylongbox
        newsaveboxmybox
        newcommandlonger[1]saveboxmylongboxhbox$#1$
        newcommandforceLeft[1]saveboxmybox$#1$useboxmyboxhspacedimexprwdmylongbox-wdmybox

        begindocument
        lipsum[2]

        %Store the longer item
        longertextxxxxxxx1
        beginflalign
        textxxxxxxx1 &= 1/y &\
        %Use forceleft command for the others
        forceLefttextx2 &= y &\
        forceLeftfrac13cdot x_2 &= y^2+x2 &
        endflalign


        enddocument


        enter image description here






        share|improve this answer












        A solution not really completely automated, but you can do your job till find a completed automated method:



        documentclass[a4paper, 11pt]book
        usepackageamsmath
        usepackagelipsum

        newsaveboxmylongbox
        newsaveboxmybox
        newcommandlonger[1]saveboxmylongboxhbox$#1$
        newcommandforceLeft[1]saveboxmybox$#1$useboxmyboxhspacedimexprwdmylongbox-wdmybox

        begindocument
        lipsum[2]

        %Store the longer item
        longertextxxxxxxx1
        beginflalign
        textxxxxxxx1 &= 1/y &\
        %Use forceleft command for the others
        forceLefttextx2 &= y &\
        forceLeftfrac13cdot x_2 &= y^2+x2 &
        endflalign


        enddocument


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 1 hour ago









        koleygr

        9,5551634




        9,5551634



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f450921%2fleft-aligned-equations%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            Installing NextGIS Connect into QGIS 3?

            One-line joke