Saturday, July 2, 2016

Latex : Part - 5 : Writing Algorithm/Pseudocode in Latex


Requirement :
  • You should have updated Latex repository
  • Any editor for writing latex code, such as TexStudio, Notepad++, Sublime Text etc.
Step:
  • In order to write a pseudo code or an algorithm in Latex , you must use algorithm package at the beginning of the document 
  • Below are some examples, you can follow.
Example - 1
Output
Figure-1.a : Example 1 output
Source Code 



Figure-1.b : Source code for the output given in Figure-1.a


Note:
  1. Please insert \; at end of each statement.
  2. "\qquad" command is used to give a horizontal tab at the beginning of the line.
Example - 2
   Note:

  • Use algorithmic package 
                          
Output

Figure 2.a: Example 2

Source Code 




Figure 2.b :  Source code for output in Figure 2.a 
Example - 3
Note:
  • Use following packages
Output





Source Code




No comments:

Post a Comment