Code: Select all
\documentclass{report}
\usepackage{minitoc}
\usepackage{nomencl}
\usepackage{glossaries}
\usepackage[pdftex]{graphicx} % to insert PostScript figures
\usepackage{rotating}
\usepackage{footnote} % for sideways tables/figures
\usepackage{siunitx,amsmath,geometry}
\usepackage{amssymb}
\usepackage{booktabs}
\usepackage[chapter]{algorithm}
\usepackage{algorithmicx,tabularx}
%\usepackage{algorithmicx,tabularx}
\usepackage{rotating,multirow}
\usepackage[format=hang]{caption}
\usepackage{fancybox}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{geometry}
\usepackage{float,array}
\usepackage{algcompatible,enumitem}
\usepackage[compatible]{algpseudocode}
\usepackage{xcolor,colortbl,threeparttable}
\usepackage{filecontents,pgfplotstable,mathtools}
%\usepackage[round]{natbib}
\floatstyle{boxed}
\renewcommand{\baselinestretch}{1.5}
\setlength{\evensidemargin}{3.5cm}
\setlength{\textwidth}{6in}%6 inc
\setlength{\textheight}{8.9in}
\setlength{\topmargin}{-0.6in}
\setlength{\topmargin}{-0.2in}
\setlength{\headsep}{.4in}
\setlength{\footnotesep}{.2in}
\setlength{\parindent}{0.5cm}
%\nofiles
\hyphenpenalty 10000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\let\OldStatex\Statex
\renewcommand{\Statex}[1][6]{%
\setlength\@tempdima{\algorithmicindent}%
\OldStatex\hskip\dimexpr#1\@tempdima\relax}
\makeatother
%%%%%%%%%Customization of my algorithms%%%%%%%%%
%%%%%%%%%%%%%Text circled numbers
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{\node[shape=circle, draw, inner sep=1pt](char){#1};}}
\begin{document}
\algrenewcommand{\alglinenumber}[1]{\scriptsize\circled{#1}}
\renewcommand{\algorithmicforall}{\textbf{For each}}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\subsection*{Proposed algorithm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lipsum[1]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{algorithm}[H]
\caption{Determination of the optimal design parameters of the Bayes-n $np$ control chart}
\begin{algorithmic}[1]
\Require The value of ...
\Ensure The ...
\State...
\State .....
\State ....
\State ...
\State ....
\ForAll{value of ....}
\State ...
\State ...
\If{...}
\State ...
\ElsIf{...}
\State ...
\ForAll{...}
\State ...
\State ...
\State ...
\EndFor
\algstore{NAME}
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\begin{algorithmic}[1]%[1]
\algrestore{NAME}
\State...
\ForAll{...}
\ForAll{...}
\ForAll{...}
\State ...
\While{...}
\State ...
\State ...
\State ...
\State ...
\State ...
\State ...
\EndWhile
\State ...
\EndFor
\EndFor
\EndFor
\Else
\State...
\State ...
\State ...
\ForAll{...}
\ForAll{...}
\ForAll{...}
\State ...
\While{...}
\State...
\State ...
\State ...
\State ...
\State...
\State ...
\algstore{NAME}
\end{algorithmic}
\end{algorithm}
\begin{algorithm}
\begin{algorithmic}[1]
\algrestore{NAME}
\EndWhile
\EndFor
\EndFor
\EndFor
\State ...
\EndIf
\EndFor
\State ...
\State ...
\end{algorithmic}
\end{algorithm}
\lipsum[2]
\end{document}
Is there a solution?