Below is my latex:

    $I \gets \text{Images of objects' plane}$\newline
    $Detector \gets \text{Define detector}$\newline
    $Descriptor \gets \text{Define Descriptor}$\newline

But the first line is un aligned

1 Answer 1


Line-ends within an algorithm environment under algorithm2e require the use of \;, not \newline.

enter image description here




  $I \gets \text{Images of objects' plane}$\;
  $\text{Detector} \gets \text{Define detector}$\;
  $\text{Descriptor} \gets \text{Define Descriptor}$\;


If you don't like the semicolons printed, then add


somewhere after loading algorithm2e.

  • Would \DontPrintSemicolon remove all the semicolons in the text or just in the algorithm section?
    – paul-shuvo
    Commented Feb 20, 2020 at 2:46
  • 1
    @paul-shuvo: Just the semicolons associated with \; within the algorithm environment.
    – Werner
    Commented Feb 20, 2020 at 2:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .