[Tex/LaTex] How to split two steps in one algorithm box for LaTeX algorithms How can I split two steps in one algorithm box for LaTeX like below image? Is it impossible? If possible, please answer me. Thank you very much. Best Answer Perhaps you can use \Statex from algpseudocode to "comment" a step or break: \documentclass{article} \usepackage{algorithm,algpseudocode} \algnewcommand{\And}{\textbf{and}} \begin{document} \begin{algorithm} \caption{A two-step algorithm} \begin{algorithmic}[1] \Statex \textit{First step} \While{$X\ \And\ Y$} \State Statement~1 \If{$Z$} \State Statement~2 \EndIf \EndWhile \Statex \textit{Second step} \While{$Y\ \And\ X$} \State Statement~3 \If{$Z$} \State Statement~4 \EndIf \EndWhile \end{algorithmic} \end{algorithm} \end{document} Related Solutions[Tex/LaTex] How to very long algorithms be automatically split over multiple pages It looks from your \State command that you are using the package algorithmicx as algorithmic defines \STATE \documentclass{article} \usepackage{algorithmicx} \addtolength\textheight{-32\baselineskip} \addtolength\paperheight{-32\baselineskip} \pdfpageheight\paperheight \renewcommand\labelenumi{\textbf{\theenumi) }} \begin{document} \subsection*{Algorithm} \begin{enumerate} \item Step aaa \begin{algorithmic}[1] \State \textit{code} \State \textit{pseudo code} \begin{itemize} \item{item 1} \item{Item 2} \end{itemize} \State \textit{pseudo code} \begin{itemize} \item{item 1} \item{Item 2} \end{itemize} \end{algorithmic} \item Step bbb \begin{algorithmic}[1] \State \textit{code} \State \textit{code} \State \textit{code} \State \textit{code} \State \textit{code} \end{algorithmic} \item Step ccc \begin{algorithmic} \State \textit{code} \end{algorithmic} \end{enumerate} \end{document} [Tex/LaTex] How to put algorithm and figure side by side in two column document Here's one possibility: \documentclass[conference]{IEEEtran} \usepackage[ruled]{algorithm} \usepackage{algpseudocode} %\usepackage{subfigure} \usepackage[demo]{graphicx} \usepackage{times} \usepackage{amssymb} \usepackage{url} \usepackage{hyperref} \usepackage{amsmath} \usepackage{multirow} \usepackage{graphicx} \usepackage{setspace} \usepackage{wrapfig} \newcounter{tmp} \begin{document} \title{xxx} \maketitle \begin{figure*} \centering \begin{minipage}[t]{0.32\textwidth} \centering \raisebox{-\height}{\includegraphics[width=1\textwidth]{xx.eps}} \vspace{-0.4cm}% \caption{THis is figure xx}\label{fig:xx} \end{minipage}\hfill \begin{minipage}[t]{0.32\textwidth} \centering \raisebox{-\height}{\includegraphics[width=1\textwidth]{yy.eps}} \vspace{-0.4cm}% \caption{This is figure yy.}\label{fig:yy} \end{minipage}\hfill \begin{minipage}[t]{0.32\textwidth} \alglanguage{pseudocode} \renewcommand\figurename{Algorithm} \setcounter{tmp}{\value{figure}} \setcounter{figure}{\value{algorithm}} \small \caption{\small Insert item into Hash Table (with mCBF and aCBF)} \label{Algorithm:insert_mCBF_aCBF} \begin{algorithmic}[1] \Procedure{$\mathbf{InsertItem}$}{item $x$} \For {$i = 1 \to k$} \State $mCBF.C_{f_i(x)\%N}$ ++ \EndFor \State $C_{min} = MAX\_VALUE$ %\Comment{Get minimum value of $k$ counters in mCBF} \For {$i = 1 \to k$} \If {$C_{min} > mCBF.C_{f_i(x)\%N}$} \State $C_{min} \gets mCBF.C_{f_i(x)\%N}$ \State $j \gets f_i(x)\%N$ \State $m \gets i$ \EndIf \EndFor %\State $C_{min} = min\{mCBF.C_{f_1(x)\%N},\cdot\cdot\cdot,mCBF.C_{f_k(x)\%N}\}$ %\State $i = \textbf{SubscriptOf}(C_{min})$ \State $B_j = B_j \cup x$ \Comment \emph{Insert $x$ into $B_j$} \For {$i = 1 \to k$} \State $aCBF_m.C_{f_i(x)\%\textbf{LengthOf}(aCBF_m)}$ ++ \EndFor \EndProcedure \Statex \end{algorithmic} \end{minipage} \setcounter{figure}{\value{tmp}} \end{figure*} \end{document} The demo option for graphicx simply replaces actual figures with black rectangles; do not use that option in your actual document. Related Question[Tex/LaTex] How to write sentences in an algorithm in latex[Tex/LaTex] Two algorithm counters for different types of algorithms[Tex/LaTex] How to typeset an algorithm with columns as in CLRS (Introduction to Algorithms)[Tex/LaTex] Split algorithm in two slides with beamer[Tex/LaTex] Add Caption below algorithm environment
Best Answer
Perhaps you can use
\Statex
fromalgpseudocode
to "comment" a step or break: