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

As the image shows, the equations are aligned by "=" but start in different positions.
equations align alignment
add a comment
|
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:

As the image shows, the equations are aligned by "=" but start in different positions.
equations align alignment
To be honest, I would either align like this or to the left, not keeping the equal signs aligned.
– egreg
7 hours ago
add a comment
|
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:

As the image shows, the equations are aligned by "=" but start in different positions.
equations align alignment
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:

As the image shows, the equations are aligned by "=" but start in different positions.
equations align alignment
equations align alignment
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
add a comment
|
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
add a comment
|
2 Answers
2
active
oldest
votes
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:

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
works perfectly!! thanks :)
– Shani Gamrian
8 hours ago
@ShaniGamrian: Bernard's solution is far cleaner withalignat...
– Werner
7 hours ago
add a comment
|
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

add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%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
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:

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
works perfectly!! thanks :)
– Shani Gamrian
8 hours ago
@ShaniGamrian: Bernard's solution is far cleaner withalignat...
– Werner
7 hours ago
add a comment
|
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:

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
works perfectly!! thanks :)
– Shani Gamrian
8 hours ago
@ShaniGamrian: Bernard's solution is far cleaner withalignat...
– Werner
7 hours ago
add a comment
|
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:

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

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
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 withalignat...
– Werner
7 hours ago
add a comment
|
works perfectly!! thanks :)
– Shani Gamrian
8 hours ago
@ShaniGamrian: Bernard's solution is far cleaner withalignat...
– 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
add a comment
|
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

add a comment
|
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

add a comment
|
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

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

answered 8 hours ago
BernardBernard
191k8 gold badges86 silver badges226 bronze badges
191k8 gold badges86 silver badges226 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f507916%2falign-equations-to-start-in-the-same-position%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
To be honest, I would either align like this or to the left, not keeping the equal signs aligned.
– egreg
7 hours ago