So I used \newcommand to define this custom item:
Code: Select all
\newcommand{\algoritmo}[5]{
\textbf{#1} \\
\textbf{Descrizione:} #2
\begin{algorithm}
\KwIn{#3}
\KwOut{#4}
#5
\end{algorithm}
}
Code: Select all
\begin{itemize}
\item \algoritmo{bla bla}{.....
\item \algoritmo{.....
- TITLE1
DESCRIPTION1
ALGORITHM1
- TITLE2
DESCRIPTION2
ALGORITHM2
My problem is that if there isn't enaugh space in the same page, then the section \begin{algorithm} is put in the next page, after the next element in the same way:
- TITLE1
DESCRIPTION1
- TITLE2
DESCRIPTION2
NEW PAGE
ALGORITHM1
ALGORITHM2
If I use \begin{samepage} it doesn't work and the result is the same.
Is there any solution?
Thank you