Guest User

Untitled

a guest
Jan 27th, 2020
88
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. \documentclass{article}
  2.  
  3. \usepackage[ruled,lined,linesnumbered]{algorithm2e}
  4. \DontPrintSemicolon
  5. \usepackage{xcolor}
  6.  
  7. \newcounter{storealgline}
  8. \IncMargin{.5em}
  9. \newenvironment{alglist}
  10.  {\setcounter{storealgline}{\value{AlgoLine}}%
  11.    \setcounter{AlgoLine}{0}%
  12.    \renewcommand{\theAlgoLine}{\thestorealgline.\arabic{AlgoLine}}%
  13.    \Indp}
  14.   {\setcounter{AlgoLine}{\value{storealgline}}}
  15.  
  16. \begin{document}
  17.  
  18. \begin{algorithm}
  19.  \caption{A plain algorithm}
  20.  \SetKwInOut{KwIn}{Input}
  21.  \SetKwInOut{KwOut}{Output}
  22.  
  23.  \KwIn{A list where each element is an integer.}
  24.  \KwOut{Processed list.}
  25.  
  26.  First List is follows\;
  27.  \begin{alglist}
  28.    One\;
  29.    Two\;
  30.    Three\;
  31.  \end{alglist}
  32.  
  33.  Second List is follows\;
  34.  \begin{alglist}
  35.    Four\;
  36.    Five\;
  37.    Six\;
  38.  \end{alglist}
  39. \end{algorithm}
  40.  
  41. \end{document}
RAW Paste Data