0

I want to indent all lines after this line function(w,v with the usepackage algorithm2e. How can I get that to work?

text

\documentclass{article}
\usepackage{german,t1enc}
%pseudocode.
\usepackage[linesnumbered,ruled,vlined]{algorithm2e} 
\renewcommand{\baselinestretch}{1.5}
\begin{document}
\begin{algorithm}[H]

function(w,v) \\
  formed the  Suffix-Array $s$ von $w$; \\
  compare Suffix $S[i]$ with Suffix $S[j]$ and find the LCP then store the
  result in array x;

\caption{}
\end{algorithm}
\end{document}

1 Answer 1

1

I am assuming you wish to have a subroutine in your algorithm and that is why you wish to indent. you should looks at this thread

as to your code, without much work you could simply indent with \qquad

\documentclass{article}
\usepackage{german,t1enc}
%pseudocode.
\usepackage[linesnumbered,ruled,vlined]{algorithm2e} 
\renewcommand{\baselinestretch}{1.5}
\begin{document}
\begin{algorithm}[H]

function(w,v) \\
  \qquad formed the  Suffix-Array $s$ von $w$; \\
  \qquad compare Suffix $S[i]$ with Suffix $S[j]$ and find the LCP then store the
  \qquad result in array x;

\caption{}
\end{algorithm}
\end{document}
1
  • 2
    I have used \Indp once after the function and it wroks.
    – TheBook
    Dec 5, 2015 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.