División del algoritmo largo en dos páginas

División del algoritmo largo en dos páginas

Estoy formateando mi tesis. Durante el formateo, me enfrento al problema de cómo dividir un algoritmo largo en dos páginas. A continuación se muestra el código de algoritmo ficticio. He proporcionado todos los paquetes utilizados en la tesis para que cualquier solución proporcionada aquí no contradiga ninguno de los paquetes utilizados. Originalmente tengo una clase de documento diferente: '\documentclass[12pt,openright,twoside]{ducs}'.

Antes de publicar esta pregunta, probé varias soluciones proporcionadas en los siguientes enlaces:

Algoritmo de división dentro de If EndIf

Dividir un algoritmo en dos páginas.

algoritmo2e dividido en varias páginas

Intenté resolverlo usando tamaños de fuente más pequeños pero mi problema aún no se ha resuelto. Estoy totalmente confundido ahora.

\documentclass{article}
\usepackage{ragged2e}
\usepackage{placeins}
\usepackage{enumitem}
%\usepackage[algo2e]{algorithm2e}
\usepackage{graphicx}
%\usepackage{subfigure}
\usepackage{multirow}
\usepackage{multicol}
%\usepackage{titlesec}
\setcounter{secnumdepth}{5}
\usepackage{longtable}
\usepackage{subfloat}
\usepackage{tabularx}
\usepackage{subfig}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{longtable}
\usepackage[lined,linesnumbered,ruled,resetcount,longend]{algorithm2e}
\usepackage{textgreek}
%\usepackage{enumerate}
\usepackage{caption}
\usepackage{csquotes}
\usepackage[T1]{fontenc}
\usepackage{scalerel}
\usepackage[utf8]{inputenc}
\usepackage[german,french,italian,welsh,greek,russian,portuguese,spanish,english]{babel}
\usepackage[tablename=Table]{caption}
\usepackage[dvipsnames,table,xcdraw]{xcolor}

\usepackage[UTF8]{ctex}
\newcommand{\nextnr}{\stepcounter{AlgoLine}\ShowLn}
\usepackage{epsfig}
\usepackage{times}
\usepackage{rotating}
\usepackage{comment}
%\usepackage{algorithm}
%\usepackage{algpseudocode}
%\algrenewcommand\textproc{}
\usepackage{epsfig}
\usepackage{amssymb}
\usepackage[black-square]{QED}
\usepackage{slashbox}
\usepackage{caption}
\captionsetup{font={small, singlespacing}}
%\usepackage {subcaption}
\usepackage{psfig}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{verbatim}
\usepackage{psfig}
\usepackage[a4paper,left=1.5in, right=1.1in, top=1.0in, bottom=.90in]{geometry}
\usepackage[numbers]{natbib}
\usepackage[T1]{fontenc} % important if your docs contain special characters
\usepackage{epstopdf}%
\usepackage{units} % for solidus fractions %
\usepackage{array,booktabs,ragged2e}
\usepackage{multirow}
\usepackage{pdflscape}
\usepackage{placeins}
\usepackage{float, caption}
\floatstyle{boxed} 
\usepackage{framed}
\usepackage[framemethod=tikz]{mdframed}

\mdfdefinestyle{myFigureBoxStyle}{tikzsetting={draw=black, line width=1pt}}%
\makeatletter
\newcommand\fs@myRoundBox{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@plain
\def\@fs@pre{\begin{mdframed}[style=myFigureBoxStyle]}%
\def\@fs@mid{\vspace{\abovecaptionskip}}%
\def\@fs@post{\end{mdframed}}\let\@fs@iftopcapt\iffalse}
\makeatother
\usepackage{footnote}

\usepackage{threeparttable}
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\newcolumntype{L}{>{\centering\arraybackslash}m{6cm}}
\newcolumntype{L}{>{\centering\arraybackslash}m{6cm}}
\newcolumntype{C}{>{\centering\arraybackslash}m{3cm}}

\usepackage{longtable}
\makesavenoteenv{tabular}
\usepackage{color} %May be necessary if you want to color links
\usepackage[breaklinks=true]{hyperref}
\hypersetup{
linktoc=all, %set to all if you want both sections and subsections linked
}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{2}

%\floatname {algorithm}{Procedure}
%\renewcommand {\algorithmicrequire} {\textbf{Input:}}
%\renewcommand {\algorithmicensure} {\textbf{Output:}}
\newtheorem{defn}{Definition} 
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\newfont{\mycrnotice}{ptmr8t at 7pt}
\newfont{\myconfname}{ptmri8t at 7pt}
\let\crnotice\mycrnotice%
\let\confname\myconfname%
\graphicspath{ {images/} }

\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{assertion}[theorem]{Assertion} 
\newtheorem{claim}[theorem]{Claim}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{example}[theorem]{Example}
\newtheorem{figger}[theorem]{Figure}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{prop}[theorem]{Proposition}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{definition}{Definition}[section]
\renewcommand {\nomenclature} {Notations}
\renewcommand\floatpagefraction{.9}
\renewcommand\topfraction{.9}
\renewcommand\bottomfraction{.9}
\renewcommand\textfraction{.1} 
\setcounter{totalnumber}{50}
\setcounter{topnumber}{50}
\setcounter{bottomnumber}{50}

\hyphenation{semi-blind Bi-directional}
\usepackage{url}
\urlstyle{same}
\listfiles
\begin{document}
\begin{algorithm}[H]

\SetKwInOut{KwIn}{Input}
\SetKwInOut{KwOut}{Output}
\KwIn{Text Input.}
\KwOut{Text Output.}

\nextnr \For{each condition1 }{
Obtain TR
}
\nextnr \For{each condition2 }{
\nextnr Obtain TR corresponding to the code.
\end{algorithm}
\begin{algorithm}[H]
\nextnr \uIf{ condition3 }{
goto step 11.
}

\Else{
\uIf{condition4}{
go to step 7.
}
\Else{
Find the compound score.
Append TR.
%\end{enumerate}
}
}
\nextnr \uIf{ condition5}{
go to step 8.
}
\Else{
go to step 9.
}
\nextnr Obtain TR. \\

\nextnr Find the sum. \\
\nextnr \uIf{condition 6 }{
Find the score, \textit{score}.\\
}
\Else {
Find the compound score.\\
}

\nextnr \uIf{condition7}{
Obtain TR.
}
\Else{
Obtain TR1
}
Go to step 12. \\
\nextnr Replace the first TR \\

\nextnr Replace code with the TR.

}

\caption{Algo Demo}

\end{algorithm}
\end{document}

información relacionada