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

Do they still use tiger roars in the 2019 "Lion King" movie?

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

How can I fix a framing mistake so I can drywall?

Maintenance tips to prolong engine lifespan for short trips

How can a Scotland-NI bridge break Brexit impasse?

Why do sellers care about down payments?

Uncovering the Accelerated Dragon opening

How to stabilise the bicycle seatpost and saddle when it is all the way up?

Why does Coq include let-expressions in its core language

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

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

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

Gas pipes - why does gas burn "outwards?"

Align equations to start in the same position

I was promised a work PC but still awaiting approval 3 months later so using my own laptop - Is it fair to ask employer for laptop insurance?

A shy person in a queue

What was the relationship between Einstein and Minkowski?

What officially disallows US presidents from driving?

Can a corpse possessed by a Dybbuk be turned via Turn Undead?

Random point on a sphere

Is it appropriate for a professor to require students to sign a non-disclosure agreement before being taught?

Napkin Folding Problem / Rumpled Ruble Problem

When was the earliest opportunity the Voyager crew had to return to the Alpha quadrant?

What is a realistic time needed to get a properly trained army?



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 &= -logs_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 &= -logs_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 &= -logs_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 &= -logs_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 &=
-logs_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
    7 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 &=
    -logs_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
      7 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 &=
    -logs_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
      7 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 &=
    -logs_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 &=
    -logs_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
      7 hours ago

















    • works perfectly!! thanks :)

      – Shani Gamrian
      8 hours ago











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

      – Werner
      7 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
    7 hours ago





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

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

            Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

            Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

            François Viète Contents Biography Work and thought Bibliography See also Notes Further reading External links Navigation menup. 21Google Bookspp. 75–77Google BooksDe thou (from University of Saint Andrews)ArchivedGoogle BooksGoogle BooksGoogle BooksGoogle booksGoogle Bookscc-parthenay.frL'histoire universelle (fr)Universal History (en)ArchivedAdsabs.harvard.eduPagesperso-orange.frArchive.orgChikara Sasaki. Descartes' mathematical thought p.259Google BooksGoogle BooksGoogle Bookspp. 152 and onwardGoogle BooksGoogle BooksScribd.comGoogle Books1257-7979Google BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGallica.bnf.frGoogle BooksGoogle Books"François Viète"Francois Viète: Father of Modern Algebraic NotationThe Lawyer and the GamblerAbout TarporleySite de Jean-Paul GuichardL'algèbre nouvelle"About the Harmonicon"cb120511976(data)1188044800000 0001 0913 5903n82164680ola2013766880073431702w6vt1sb70287374827140948071409480