0

I am using the following code borrowed from here and modified accordingly to write down the steps of an algorithm:

\documentclass{article}
\usepackage{booktabs}
\newcommand{\tabitem}{~~\llap{\textbullet}~~}

\begin{document}

\begin{table} \centering \begin{tabular}{l} \toprule \multicolumn{1}{l}{\textbf{Algorithm} } \ \midrule \tabitem This is step 1 \ \tabitem This is step 2 \ \tabitem This is step 3 \ \tabitem This is step 4 \ \hline \end{tabular} \end{table}

\end{document}

I want to have numbered list instead of bullet points. How can this be done? I am not able to use the enumerate environment as the code is not compiling.

Aim
  • 633

1 Answers1

1

Quick 'n' dirty...

\documentclass{article}
\usepackage{booktabs}
\newcommand{\tabitem}[1]{~~\llap{#1.}~~}% <-- Modified

\begin{document}

\begin{table} \centering \begin{tabular}{l} \toprule \multicolumn{1}{l}{\textbf{Algorithm} } \ \midrule \tabitem{1} This is step 1 \ \tabitem{2} This is step 2 \ \tabitem{3} This is step 3 \ \tabitem{4} This is step 4 \ \hline \end{tabular} \end{table}

\end{document}

enter image description here