[Tex/LaTex] How to remove header and line numbering from algorithmic

algorithmicpseudocode

I created a pseudocode algorithm like this:

enter image description here

% Pseudo code %
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\algdef{SE}{Begin}{End}{\textbf{begin}}{\textbf{end}}

\begin{algorithm}
\caption{Pseudocodice algoritmo Apriori}
\label{alg:pseudoApriori}
\renewcommand{\thealgorithm}{}
\floatname{algorithm}{}
\begin{algorithmic}[1]
    \Begin
    \State $L_{1} = \{Frequent - 1itemset\} $
    \State $k \leftarrow 2$
    \While {$L_{k-1} \neq \phi$}
    \State $Temp \leftarrow candidateItemSet (L_{k-1})$
    \State $C_{k} \leftarrow frequencyOfItemSet (Temp)$
    \State $L_{k} \leftarrow compareItemSetWithMinSup (C_{k}, minsup) $
    \State $k \leftarrow k + 1$
    \EndWhile
    \State \Return L
    \End
\end{algorithmic}\end{algorithm}

Now I'd like to remove the header (above the first line of code) and remove the line numbering; How could I do these two things easily (being a latex/algorithmc newbie)?

The thing is I'd like to use this kind of style not only for writing algoritms but for random lines of code too.

Best Answer

To remove the caption just don't write a caption command. To remove line numbers, omit the option argument [1] at the \begin{algorithmic}:

Sample output

\documentclass{article}

\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\algdef{SE}{Begin}{End}{\textbf{begin}}{\textbf{end}}

\begin{document}

\begin{algorithm}
  \begin{algorithmic}
    \Begin
    \State $L_{1} = \{Frequent - 1itemset\} $
    \State $k \leftarrow 2$
    \While {$L_{k-1} \neq \phi$}
    \State $Temp \leftarrow candidateItemSet (L_{k-1})$
    \State $C_{k} \leftarrow frequencyOfItemSet (Temp)$
    \State $L_{k} \leftarrow compareItemSetWithMinSup (C_{k}, minsup) $
    \State $k \leftarrow k + 1$
    \EndWhile
    \State \Return L
    \End
  \end{algorithmic}
\end{algorithm}

\end{document}
Related Question