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

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

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

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

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