TransWikia.com

parallel block in algorithm overleaf

TeX - LaTeX Asked by user14501873 on April 1, 2021

One part of my algorithm is done in parallel, for that, I have a block in my algorithm, but I can not show it properly. Can anybody help me to solve this problem?

usepackage[linesnumbered,lined,boxed,commentsnumbered,ruled,longend]{algorithm2e}
begin{document}
begin{algorithm}[!t]
DontPrintSemicolon 
SetKwBlock{DoParallel}{do in parallel}{end}

begin{algorithmic}[1] 
STATE DoParallel{
FOR{ $1leq i leq Epoch$}
    STATE Do the 
ENDFOR
FOR{ $1leq i leq Epoch$}
STATE Do the 1;
ENDFOR}
end{algorithmic}label{}
end{algorithm}
end{document}

here is the figure

Any other response which is related to the parallel in the algorithm is appreciated.

One Answer

You are mixing (at least) two different packages for typesetting algorithms. I suggest, you stick to one of them:

documentclass{article}
usepackage[linesnumbered,lined,boxed,commentsnumbered,ruled,longend]{algorithm2e}
begin{document}
begin{algorithm}[!t]
    DontPrintSemicolon
    SetKwBlock{DoParallel}{do in parallel}{end}
    DoParallel{
        For{$1leq i leq$ Epoch}{
            Do the
        }
        For{$1leq i leq$ Epoch}{
            Do the 1;
        }
    }
end{algorithm}label{oursmc}
end{document}

enter image description here

Correct answer by DG' on April 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP