1

I want to write a procedure in latex. I know the algorithmic package. But I want my function should not come with a name Algorithm 1 Func_name.

I want this.

Func_name(parameter)
{
   statement 1;
   statement 2;
}

Please help.

  • 1
    Welcome to TeX.SX! Please provide a minimal code example of what you've tried (MWE). – TeXnician Aug 7 '17 at 13:38
  • 1
    The listings package might be what you're after, especially if you have a specific programming language in mind. – David R Aug 7 '17 at 13:44
1

You can use algpseudocode.sty from algorithmicx package.

\documentclass{article}

\usepackage{algorithm}
\usepackage{algpseudocode}

\begin{document}

\begin{algorithm}
  \begin{algorithmic}[1]
    \Function{Func\_name}{parameter}
      \State statement 1
      \State statement 2    
    \EndFunction
  \end{algorithmic}
\end{algorithm}

\end{document}

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.