TeX - LaTeX Asked by Duke Le on March 14, 2021
documentclass{article}
usepackage{algorithm}
usepackage{algorithmicx}
usepackage{algpseudocode}%
begin{document}
begin{algorithm}
State textbf{Inputs:}
begin{itemize}
item Input 1
item Input 2
end{itemize}
For{each pixel at row, column (x,y)}
State Formula 1
State Formula 2
State Formula 3
State Formula 4
EndFor
end{algorithm}
end{document}
I want the text to look exactly like the image here. However, the above latex file gives error "Lonely item–perhaps a missing list environment". It still compiles and gives the correct output, but the error keeps popping up.
The other answer I found on StackExchange either have no text bullet, or all text bullet.
How can I put itemize inside algorithm
like this?
algorithm
just provide the algorithm
float. You need an algorithmic
environment to set the algorithm:
documentclass{article}
usepackage{algorithm}
usepackage{algpseudocode}%
begin{document}
begin{algorithm}
begin{algorithmic}[0]
State textbf{Inputs:}
begin{itemize}
item Input 1
item Input 2
end{itemize}
For{each pixel at row, column $(x,y)$}
State Formula 1
State Formula 2
State Formula 3
State Formula 4
EndFor
end{algorithmic}
end{algorithm}
end{document}
Correct answer by Werner on March 14, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP