Align equations to start in the same positionThe mysteries of mathpaletteAlignment of two equations on LaTeXframe more than 1 equation (but not all) of an align environmentAlign equations at equal sign with more than one &Align different equations on different equal signsflush text on the left and centre equation of the same line (not working!)How to align multiple separate equations by equal sign to center of pageAligning equal signs in long equationsSplit equations inside align environment with amsmath and mathtools

Uncovering the Accelerated Dragon opening

What jurisdiction do Scottish courts have over the Westminster parliament?

My research paper filed as a patent in China by my Chinese supervisor without me as inventor

Why did they ever make smaller than full-frame sensors?

Linear Programming with additional "if-then"/"Default to zero" constraints?

Why island and not light?

What is my breathable atmosphere composed of?

How is Team Scooby Doo (Mystery Inc.) funded?

How to say "quirky" in German without sounding derogatory?

Where can I get an anonymous Rav Kav card issued?

Mean π: Archimedes vs. Gauss - π computation through generalized means

Does a gnoll speak both Gnoll and Abyssal, or is Gnoll a dialect of Abyssal?

Should I leave the first authorship of our paper to the student who did the project whereas I solved it?

Gravity on an Orbital Ring

Will replacing a fake visa with a different fake visa cause me problems when applying for a legal study permit?

What are uses of the byte after BRK instruction on 6502?

What's the biggest organic molecule that could have a smell?

Is there a reliable way to hide/convey a message in vocal expressions (speech, song,...)

Can the UK veto its own extension request?

What officially disallows US presidents from driving?

Have there been any countries that voted themselves out of existence?

In Germany, how can I maximize the impact of my charitable donations?

How to work with a technician hired with a grant who argues everything

Parallel resistance in electric circuits



Align equations to start in the same position


The mysteries of mathpaletteAlignment of two equations on LaTeXframe more than 1 equation (but not all) of an align environmentAlign equations at equal sign with more than one &Align different equations on different equal signsflush text on the left and centre equation of the same line (not working!)How to align multiple separate equations by equal sign to center of pageAligning equal signs in long equationsSplit equations inside align environment with amsmath and mathtools






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have a list of equations and I want them to be centered and aligned to the beginning of the equation and by the equal sign. This is what I tried so far:



beginalign*
mathcalL_a2c &= mathbbE_s_t,a_tsimpi_theta[mathcalL_a2c_policy + frac12mathcalL_a2c_value]\
mathcalL_a2c_policy &= -logpi_theta(a_t(V_t^n-V_theta(s_t)) - alphamathcalH_t^pi_theta\
mathcalL_a2c_value &= (V_t^n-V_theta(s_t))^2
endalign*


but unfortunately, I get:



enter image description here



As the image shows, the equations are aligned by "=" but start in different positions.










share|improve this question
























  • To be honest, I would either align like this or to the left, not keeping the equal signs aligned.

    – egreg
    7 hours ago

















1















I have a list of equations and I want them to be centered and aligned to the beginning of the equation and by the equal sign. This is what I tried so far:



beginalign*
mathcalL_a2c &= mathbbE_s_t,a_tsimpi_theta[mathcalL_a2c_policy + frac12mathcalL_a2c_value]\
mathcalL_a2c_policy &= -logpi_theta(a_t(V_t^n-V_theta(s_t)) - alphamathcalH_t^pi_theta\
mathcalL_a2c_value &= (V_t^n-V_theta(s_t))^2
endalign*


but unfortunately, I get:



enter image description here



As the image shows, the equations are aligned by "=" but start in different positions.










share|improve this question
























  • To be honest, I would either align like this or to the left, not keeping the equal signs aligned.

    – egreg
    7 hours ago













1












1








1








I have a list of equations and I want them to be centered and aligned to the beginning of the equation and by the equal sign. This is what I tried so far:



beginalign*
mathcalL_a2c &= mathbbE_s_t,a_tsimpi_theta[mathcalL_a2c_policy + frac12mathcalL_a2c_value]\
mathcalL_a2c_policy &= -logpi_theta(a_t(V_t^n-V_theta(s_t)) - alphamathcalH_t^pi_theta\
mathcalL_a2c_value &= (V_t^n-V_theta(s_t))^2
endalign*


but unfortunately, I get:



enter image description here



As the image shows, the equations are aligned by "=" but start in different positions.










share|improve this question














I have a list of equations and I want them to be centered and aligned to the beginning of the equation and by the equal sign. This is what I tried so far:



beginalign*
mathcalL_a2c &= mathbbE_s_t,a_tsimpi_theta[mathcalL_a2c_policy + frac12mathcalL_a2c_value]\
mathcalL_a2c_policy &= -logpi_theta(a_t(V_t^n-V_theta(s_t)) - alphamathcalH_t^pi_theta\
mathcalL_a2c_value &= (V_t^n-V_theta(s_t))^2
endalign*


but unfortunately, I get:



enter image description here



As the image shows, the equations are aligned by "=" but start in different positions.







equations align alignment






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 8 hours ago









Shani GamrianShani Gamrian

223 bronze badges




223 bronze badges















  • To be honest, I would either align like this or to the left, not keeping the equal signs aligned.

    – egreg
    7 hours ago

















  • To be honest, I would either align like this or to the left, not keeping the equal signs aligned.

    – egreg
    7 hours ago
















To be honest, I would either align like this or to the left, not keeping the equal signs aligned.

– egreg
7 hours ago





To be honest, I would either align like this or to the left, not keeping the equal signs aligned.

– egreg
7 hours ago










2 Answers
2






active

oldest

votes


















2
















One option is to place each of the left-hand sides of te equations in equally-sized boxes, and <align> each element to the left. eqmathbox[LHS][l]<lhs>, as defined below, will help with that:



enter image description here



documentclassarticle

usepackageeqparbox,xparse,amsmath,amsfonts

% https://tex.stackexchange.com/a/34412/5764
makeatletter
% eqmathbox[<tag>][<align>]<math>
NewDocumentCommandeqmathboxo Oc m%
IfValueTF#1
defeqmathbox@##1##2eqmakebox[#1][#2]$##1##2$
defeqmathbox@##1##2eqmakebox$##1##2$
mathpaletteeqmathbox@#3

makeatother

begindocument

beginalign*
eqmathbox[LHS][l]mathcalL_a2c &=
mathbbE_s_t, a_t sim pi_theta[mathcalL_a2c_textpolicy + tfrac12mathcalL_a2c_textvalue] \
eqmathbox[LHS][l]mathcalL_a2c_textpolicy &=
-logpi_theta(a_t(V_t^n - V_theta(s_t)) - alphamathcalH_t^pi_theta \
eqmathbox[LHS][l]mathcalL_a2c_textvalue &= (V_t^n - V_theta(s_t))^2
endalign*

enddocument





share|improve this answer

























  • works perfectly!! thanks :)

    – Shani Gamrian
    8 hours ago











  • @ShaniGamrian: Bernard's solution is far cleaner with alignat...

    – Werner
    8 hours ago


















5
















A solution with alignat, and some improvements (in particular, fractional coefficients in medium size look better, in my opinion):



documentclass[11pt]book
usepackagemathtools, amssymb, nccmath

begindocument

beginalignat*2
& mathcalL_a2c & &= mathbbE_s_t,a_tsimpi_thetaBigl[mathcalL_a2c_textpolicy + mfrac12mathcalL_a2c_textvalueBigr]\
& mathcalL_a2c_textpolicy & &= -logpi_theta(a_tmid s_t)bigl(V_t^n-V_theta(s_t)bigr) - alphamathcalH_t^pi_theta\
& mathcalL_a2c_textvalue & &= bigl(V_t^n-V_theta(s_t)bigr)^2
endalignat*

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/4.0/"u003ecc by-sa 4.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%2f507916%2falign-equations-to-start-in-the-same-position%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2
















    One option is to place each of the left-hand sides of te equations in equally-sized boxes, and <align> each element to the left. eqmathbox[LHS][l]<lhs>, as defined below, will help with that:



    enter image description here



    documentclassarticle

    usepackageeqparbox,xparse,amsmath,amsfonts

    % https://tex.stackexchange.com/a/34412/5764
    makeatletter
    % eqmathbox[<tag>][<align>]<math>
    NewDocumentCommandeqmathboxo Oc m%
    IfValueTF#1
    defeqmathbox@##1##2eqmakebox[#1][#2]$##1##2$
    defeqmathbox@##1##2eqmakebox$##1##2$
    mathpaletteeqmathbox@#3

    makeatother

    begindocument

    beginalign*
    eqmathbox[LHS][l]mathcalL_a2c &=
    mathbbE_s_t, a_t sim pi_theta[mathcalL_a2c_textpolicy + tfrac12mathcalL_a2c_textvalue] \
    eqmathbox[LHS][l]mathcalL_a2c_textpolicy &=
    -logpi_theta(a_t(V_t^n - V_theta(s_t)) - alphamathcalH_t^pi_theta \
    eqmathbox[LHS][l]mathcalL_a2c_textvalue &= (V_t^n - V_theta(s_t))^2
    endalign*

    enddocument





    share|improve this answer

























    • works perfectly!! thanks :)

      – Shani Gamrian
      8 hours ago











    • @ShaniGamrian: Bernard's solution is far cleaner with alignat...

      – Werner
      8 hours ago















    2
















    One option is to place each of the left-hand sides of te equations in equally-sized boxes, and <align> each element to the left. eqmathbox[LHS][l]<lhs>, as defined below, will help with that:



    enter image description here



    documentclassarticle

    usepackageeqparbox,xparse,amsmath,amsfonts

    % https://tex.stackexchange.com/a/34412/5764
    makeatletter
    % eqmathbox[<tag>][<align>]<math>
    NewDocumentCommandeqmathboxo Oc m%
    IfValueTF#1
    defeqmathbox@##1##2eqmakebox[#1][#2]$##1##2$
    defeqmathbox@##1##2eqmakebox$##1##2$
    mathpaletteeqmathbox@#3

    makeatother

    begindocument

    beginalign*
    eqmathbox[LHS][l]mathcalL_a2c &=
    mathbbE_s_t, a_t sim pi_theta[mathcalL_a2c_textpolicy + tfrac12mathcalL_a2c_textvalue] \
    eqmathbox[LHS][l]mathcalL_a2c_textpolicy &=
    -logpi_theta(a_t(V_t^n - V_theta(s_t)) - alphamathcalH_t^pi_theta \
    eqmathbox[LHS][l]mathcalL_a2c_textvalue &= (V_t^n - V_theta(s_t))^2
    endalign*

    enddocument





    share|improve this answer

























    • works perfectly!! thanks :)

      – Shani Gamrian
      8 hours ago











    • @ShaniGamrian: Bernard's solution is far cleaner with alignat...

      – Werner
      8 hours ago













    2














    2










    2









    One option is to place each of the left-hand sides of te equations in equally-sized boxes, and <align> each element to the left. eqmathbox[LHS][l]<lhs>, as defined below, will help with that:



    enter image description here



    documentclassarticle

    usepackageeqparbox,xparse,amsmath,amsfonts

    % https://tex.stackexchange.com/a/34412/5764
    makeatletter
    % eqmathbox[<tag>][<align>]<math>
    NewDocumentCommandeqmathboxo Oc m%
    IfValueTF#1
    defeqmathbox@##1##2eqmakebox[#1][#2]$##1##2$
    defeqmathbox@##1##2eqmakebox$##1##2$
    mathpaletteeqmathbox@#3

    makeatother

    begindocument

    beginalign*
    eqmathbox[LHS][l]mathcalL_a2c &=
    mathbbE_s_t, a_t sim pi_theta[mathcalL_a2c_textpolicy + tfrac12mathcalL_a2c_textvalue] \
    eqmathbox[LHS][l]mathcalL_a2c_textpolicy &=
    -logpi_theta(a_t(V_t^n - V_theta(s_t)) - alphamathcalH_t^pi_theta \
    eqmathbox[LHS][l]mathcalL_a2c_textvalue &= (V_t^n - V_theta(s_t))^2
    endalign*

    enddocument





    share|improve this answer













    One option is to place each of the left-hand sides of te equations in equally-sized boxes, and <align> each element to the left. eqmathbox[LHS][l]<lhs>, as defined below, will help with that:



    enter image description here



    documentclassarticle

    usepackageeqparbox,xparse,amsmath,amsfonts

    % https://tex.stackexchange.com/a/34412/5764
    makeatletter
    % eqmathbox[<tag>][<align>]<math>
    NewDocumentCommandeqmathboxo Oc m%
    IfValueTF#1
    defeqmathbox@##1##2eqmakebox[#1][#2]$##1##2$
    defeqmathbox@##1##2eqmakebox$##1##2$
    mathpaletteeqmathbox@#3

    makeatother

    begindocument

    beginalign*
    eqmathbox[LHS][l]mathcalL_a2c &=
    mathbbE_s_t, a_t sim pi_theta[mathcalL_a2c_textpolicy + tfrac12mathcalL_a2c_textvalue] \
    eqmathbox[LHS][l]mathcalL_a2c_textpolicy &=
    -logpi_theta(a_t(V_t^n - V_theta(s_t)) - alphamathcalH_t^pi_theta \
    eqmathbox[LHS][l]mathcalL_a2c_textvalue &= (V_t^n - V_theta(s_t))^2
    endalign*

    enddocument






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 8 hours ago









    WernerWerner

    462k77 gold badges1038 silver badges1784 bronze badges




    462k77 gold badges1038 silver badges1784 bronze badges















    • works perfectly!! thanks :)

      – Shani Gamrian
      8 hours ago











    • @ShaniGamrian: Bernard's solution is far cleaner with alignat...

      – Werner
      8 hours ago

















    • works perfectly!! thanks :)

      – Shani Gamrian
      8 hours ago











    • @ShaniGamrian: Bernard's solution is far cleaner with alignat...

      – Werner
      8 hours ago
















    works perfectly!! thanks :)

    – Shani Gamrian
    8 hours ago





    works perfectly!! thanks :)

    – Shani Gamrian
    8 hours ago













    @ShaniGamrian: Bernard's solution is far cleaner with alignat...

    – Werner
    8 hours ago





    @ShaniGamrian: Bernard's solution is far cleaner with alignat...

    – Werner
    8 hours ago













    5
















    A solution with alignat, and some improvements (in particular, fractional coefficients in medium size look better, in my opinion):



    documentclass[11pt]book
    usepackagemathtools, amssymb, nccmath

    begindocument

    beginalignat*2
    & mathcalL_a2c & &= mathbbE_s_t,a_tsimpi_thetaBigl[mathcalL_a2c_textpolicy + mfrac12mathcalL_a2c_textvalueBigr]\
    & mathcalL_a2c_textpolicy & &= -logpi_theta(a_tmid s_t)bigl(V_t^n-V_theta(s_t)bigr) - alphamathcalH_t^pi_theta\
    & mathcalL_a2c_textvalue & &= bigl(V_t^n-V_theta(s_t)bigr)^2
    endalignat*

    enddocument


    enter image description here






    share|improve this answer





























      5
















      A solution with alignat, and some improvements (in particular, fractional coefficients in medium size look better, in my opinion):



      documentclass[11pt]book
      usepackagemathtools, amssymb, nccmath

      begindocument

      beginalignat*2
      & mathcalL_a2c & &= mathbbE_s_t,a_tsimpi_thetaBigl[mathcalL_a2c_textpolicy + mfrac12mathcalL_a2c_textvalueBigr]\
      & mathcalL_a2c_textpolicy & &= -logpi_theta(a_tmid s_t)bigl(V_t^n-V_theta(s_t)bigr) - alphamathcalH_t^pi_theta\
      & mathcalL_a2c_textvalue & &= bigl(V_t^n-V_theta(s_t)bigr)^2
      endalignat*

      enddocument


      enter image description here






      share|improve this answer



























        5














        5










        5









        A solution with alignat, and some improvements (in particular, fractional coefficients in medium size look better, in my opinion):



        documentclass[11pt]book
        usepackagemathtools, amssymb, nccmath

        begindocument

        beginalignat*2
        & mathcalL_a2c & &= mathbbE_s_t,a_tsimpi_thetaBigl[mathcalL_a2c_textpolicy + mfrac12mathcalL_a2c_textvalueBigr]\
        & mathcalL_a2c_textpolicy & &= -logpi_theta(a_tmid s_t)bigl(V_t^n-V_theta(s_t)bigr) - alphamathcalH_t^pi_theta\
        & mathcalL_a2c_textvalue & &= bigl(V_t^n-V_theta(s_t)bigr)^2
        endalignat*

        enddocument


        enter image description here






        share|improve this answer













        A solution with alignat, and some improvements (in particular, fractional coefficients in medium size look better, in my opinion):



        documentclass[11pt]book
        usepackagemathtools, amssymb, nccmath

        begindocument

        beginalignat*2
        & mathcalL_a2c & &= mathbbE_s_t,a_tsimpi_thetaBigl[mathcalL_a2c_textpolicy + mfrac12mathcalL_a2c_textvalueBigr]\
        & mathcalL_a2c_textpolicy & &= -logpi_theta(a_tmid s_t)bigl(V_t^n-V_theta(s_t)bigr) - alphamathcalH_t^pi_theta\
        & mathcalL_a2c_textvalue & &= bigl(V_t^n-V_theta(s_t)bigr)^2
        endalignat*

        enddocument


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 8 hours ago









        BernardBernard

        191k8 gold badges86 silver badges226 bronze badges




        191k8 gold badges86 silver badges226 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%2f507916%2falign-equations-to-start-in-the-same-position%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

            Sahara Skak | Bilen | Luke uk diar | NawigatsjuunCommonskategorii: SaharaWikivoyage raisfeerer: Sahara26° N, 13° O

            The fall designs the understood secretary. Looking glass Science Shock Discovery Hot Everybody Loves Raymond Smile 곳 서비스 성실하다 Defas Kaloolon Definition: To combine or impregnate with sulphur or any of its compounds as to sulphurize caoutchouc in vulcanizing Flame colored Reason Useful Thin Help 갖다 유명하다 낙엽 장례식 Country Iron Definition: A fencer a gladiator one who exhibits his skill in the use of the sword Definition: The American black throated bunting Spiza Americana Nostalgic Needy Method to my madness 시키다 평가되다 전부 소설가 우아하다 Argument Tin Feeling Representative Gym Music Gaur Chicken 일쑤 코치 편 학생증 The harbor values the sugar. Vasagle Yammoe Enstatite Definition: Capable of being limited Road Neighborly Five Refer Built Kangaroo 비비다 Degree Release Bargain Horse 하루 형님 유교 석 동부 괴롭히다 경제력

            19. јануар Садржај Догађаји Рођења Смрти Празници и дани сећања Види још Референце Мени за навигацијуу