LaTeX forum ⇒ Math & Science ⇒ Align equations in pseudocode Topic is solved

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
loujing
Posts: 9
Joined: Mon Jun 01, 2015 7:13 pm

Align equations in pseudocode

Hello,

Sorry, my english is poor.
I have written a pseudocode in which there are some equations like the figure blow.
QQ截图20150602005659.png (34.45 KiB) Viewed 5419 times

Now i would like the equations from lines #4-#7 to align at \leftarrow , and the symbols on the left size of \leftarrow are right aligned. The others remain unchanged.

The attachment is my source file.

Thank you for your kind help.


Tags:

Johannes_B
Site Moderator
Posts: 4097
Joined: Thu Nov 01, 2012 4:08 pm
Hi and welcome,

very good that you provided an example code. It is much more comfortable if a helper does not have to retype text and knows exactely how the output is generated.

So far, i could come up with the following. The symbols are not aligned to the right, but looks much better know. Maybe someone else has a better idea.

The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

loujing
Posts: 9
Joined: Mon Jun 01, 2015 7:13 pm
Johannes_B wrote:Hi and welcome,

very good that you provided an example code. It is much more comfortable if a helper does not have to retype text and knows exactely how the output is generated.

So far, i could come up with the following. The symbols are not aligned to the right, but looks much better know. Maybe someone else has a better idea.

Ok, it's very nice!
Thank you for your kind help.