Algoritmo_látex
1.0.0
PROBLEMA 1: Como remover o número do algoritmo da legenda de um algoritmo?
SOLUÇÃO: Adicione renewcommand{thealgorithm}{}
após begin{algorithm}
Veja o exemplo de arquivo Latex algoritmo_caption_no_number.tex e sua saída em PDF
documentclass[11pt]{article}
usepackage{algorithmicx}
usepackage{algorithm}
usepackage{algpseudocode}
begin{document}
begin{algorithm}
renewcommand{thealgorithm}{}
caption{Test Algorithm}label{euclid}
begin{algorithmic}[1]
Procedure{Euclid}{$a,b$}Comment{The g.c.d. of a and b}
State $rgets abmod b$
While{$rnot=0$}Comment{We have the answer if r is 0}
State $agets b$
State $bgets r$
State $rgets abmod b$
EndWhilelabel{euclidendwhile}
State textbf{return} $b$Comment{The gcd is b}
EndProcedure
end{algorithmic}
end{algorithm}
end{document}
PROBLEMA 2: Como remover o número da linha do corpo de um algoritmo?
SOLUÇÃO:
defNoNumber#1{{defalglinenumber##1{}State #1}addtocounter{ALG@line}{-1}}
NoNumber{}
Veja o exemplo de arquivo Latex algoritmo_line_no_number.tex e sua saída em PDF
documentclass[11pt]{article}
usepackage{algorithmicx}
usepackage{algorithm}
usepackage{algpseudocode}
usepackage{color}
defNoNumber#1{{defalglinenumber##1{}State #1}addtocounter{ALG@line}{-1}}
begin{document}
begin{algorithm}
caption{Test Algorithm}label{euclid}
begin{algorithmic}[1]
Procedure{Euclid}{$a,b$}Comment{The g.c.d. of a and b}
State $rgets abmod b$
While{$rnot=0$}Comment{We have the answer if r is 0}
State $agets b$
State $bgets r$
State $rgets abmod b$
EndWhilelabel{euclidendwhile}
State textbf{return} $b$Comment{The gcd is b}
NoNumber{color{red} This line will not have a number!}
EndProcedure
end{algorithmic}
end{algorithm}
end{document}