Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass{article}
- usepackage[table,dvipsnames]{xcolor}
- usepackage{algorithm,algpseudocode,float}
- %-----------
- makeatletter
- newenvironment{breakablealgorithm}
- {% begin{breakablealgorithm}
- begin{center}
- refstepcounter{algorithm}% New algorithm
- hrule height.8pt depth0pt kern2pt% @fs@pre for @fs@ruled
- renewcommand{caption}[2][relax]{% Make a new caption
- {raggedrighttextbf{ALG@name~thealgorithm} ##2par}%
- ifxrelax##1relax % #1 is relax
- addcontentsline{loa}{algorithm}{protectnumberline{thealgorithm}##2}%
- else % #1 is not relax
- addcontentsline{loa}{algorithm}{protectnumberline{thealgorithm}##1}%
- fi
- kern2pthrulekern2pt
- }
- }{% end{breakablealgorithm}
- kern2pthrulerelax% @fs@post for @fs@ruled
- end{center}
- }
- makeatother
- begin{document}
- begin{breakablealgorithm}
- caption{PPPPPPPPPPPPP}
- begin{algorithmic}[1]
- makeatlettersetcounter{ALG@line}{0}makeatother
- If { $phi < 10^circ$}
- State{$A = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa$} Comment{ where textbf{a} is aaaaaaaaaa constant.}
- Else
- State{$B = bbbbbbbbb$ }
- EndIf
- end{algorithmic}
- end{breakablealgorithm}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement