avoid line overflow in algorithm












1














How can I stop lines of my algorithm to be overflowing as shown in the picture below, I would like to break the lines that are too long into 2 lines and just go down to the next line if one line cannot fit in the column .



enter image description here



 begin{algorithm}
caption{Iterative Process}
begin{algorithmic}[1]
raggedright

STATE $OwnerClassPrediction()$
STATE {iteration}=1
STATE {Predictions(iteration-1)}=methodTraceList.predictions
STATE {Predictions(iteration)}=$emptyset$
WHILE {$Predictions(iteration) neq Predictions(iteration-1)$}


STATE$Predictions(iteration)$=SurroundednessPurePattern($Predictions(iteration)$);
STATE$Predictions(iteration)$=SurroundednessMixedPattern($Predictions(iteration)$);
STATE $Predictions(iteration)$=InheritanceInterfacesPattern($Predictions(iteration)$);
STATE $Predictions(iteration)$=AllCallersPattern($Predictions(iteration)$);
STATE $Predictions(iteration)$=AllCalleesPattern($Predictions(iteration)$);
STATE{iteration}++;
ENDWHILE
end{algorithmic}


label{alg:MYALG}
end{algorithm}










share|improve this question






















  • Please do not ask the same question again and again. You already got an answer her tex.stackexchange.com/a/467316/16550 ! Or simply change your identifiers to be shorter ... And please do not add code snippets, show us a compilable short code resulting in your issue ...
    – Kurt
    Dec 31 '18 at 18:00


















1














How can I stop lines of my algorithm to be overflowing as shown in the picture below, I would like to break the lines that are too long into 2 lines and just go down to the next line if one line cannot fit in the column .



enter image description here



 begin{algorithm}
caption{Iterative Process}
begin{algorithmic}[1]
raggedright

STATE $OwnerClassPrediction()$
STATE {iteration}=1
STATE {Predictions(iteration-1)}=methodTraceList.predictions
STATE {Predictions(iteration)}=$emptyset$
WHILE {$Predictions(iteration) neq Predictions(iteration-1)$}


STATE$Predictions(iteration)$=SurroundednessPurePattern($Predictions(iteration)$);
STATE$Predictions(iteration)$=SurroundednessMixedPattern($Predictions(iteration)$);
STATE $Predictions(iteration)$=InheritanceInterfacesPattern($Predictions(iteration)$);
STATE $Predictions(iteration)$=AllCallersPattern($Predictions(iteration)$);
STATE $Predictions(iteration)$=AllCalleesPattern($Predictions(iteration)$);
STATE{iteration}++;
ENDWHILE
end{algorithmic}


label{alg:MYALG}
end{algorithm}










share|improve this question






















  • Please do not ask the same question again and again. You already got an answer her tex.stackexchange.com/a/467316/16550 ! Or simply change your identifiers to be shorter ... And please do not add code snippets, show us a compilable short code resulting in your issue ...
    – Kurt
    Dec 31 '18 at 18:00
















1












1








1







How can I stop lines of my algorithm to be overflowing as shown in the picture below, I would like to break the lines that are too long into 2 lines and just go down to the next line if one line cannot fit in the column .



enter image description here



 begin{algorithm}
caption{Iterative Process}
begin{algorithmic}[1]
raggedright

STATE $OwnerClassPrediction()$
STATE {iteration}=1
STATE {Predictions(iteration-1)}=methodTraceList.predictions
STATE {Predictions(iteration)}=$emptyset$
WHILE {$Predictions(iteration) neq Predictions(iteration-1)$}


STATE$Predictions(iteration)$=SurroundednessPurePattern($Predictions(iteration)$);
STATE$Predictions(iteration)$=SurroundednessMixedPattern($Predictions(iteration)$);
STATE $Predictions(iteration)$=InheritanceInterfacesPattern($Predictions(iteration)$);
STATE $Predictions(iteration)$=AllCallersPattern($Predictions(iteration)$);
STATE $Predictions(iteration)$=AllCalleesPattern($Predictions(iteration)$);
STATE{iteration}++;
ENDWHILE
end{algorithmic}


label{alg:MYALG}
end{algorithm}










share|improve this question













How can I stop lines of my algorithm to be overflowing as shown in the picture below, I would like to break the lines that are too long into 2 lines and just go down to the next line if one line cannot fit in the column .



enter image description here



 begin{algorithm}
caption{Iterative Process}
begin{algorithmic}[1]
raggedright

STATE $OwnerClassPrediction()$
STATE {iteration}=1
STATE {Predictions(iteration-1)}=methodTraceList.predictions
STATE {Predictions(iteration)}=$emptyset$
WHILE {$Predictions(iteration) neq Predictions(iteration-1)$}


STATE$Predictions(iteration)$=SurroundednessPurePattern($Predictions(iteration)$);
STATE$Predictions(iteration)$=SurroundednessMixedPattern($Predictions(iteration)$);
STATE $Predictions(iteration)$=InheritanceInterfacesPattern($Predictions(iteration)$);
STATE $Predictions(iteration)$=AllCallersPattern($Predictions(iteration)$);
STATE $Predictions(iteration)$=AllCalleesPattern($Predictions(iteration)$);
STATE{iteration}++;
ENDWHILE
end{algorithmic}


label{alg:MYALG}
end{algorithm}







algorithmic line






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 31 '18 at 17:54









user3406764user3406764

333




333












  • Please do not ask the same question again and again. You already got an answer her tex.stackexchange.com/a/467316/16550 ! Or simply change your identifiers to be shorter ... And please do not add code snippets, show us a compilable short code resulting in your issue ...
    – Kurt
    Dec 31 '18 at 18:00




















  • Please do not ask the same question again and again. You already got an answer her tex.stackexchange.com/a/467316/16550 ! Or simply change your identifiers to be shorter ... And please do not add code snippets, show us a compilable short code resulting in your issue ...
    – Kurt
    Dec 31 '18 at 18:00


















Please do not ask the same question again and again. You already got an answer her tex.stackexchange.com/a/467316/16550 ! Or simply change your identifiers to be shorter ... And please do not add code snippets, show us a compilable short code resulting in your issue ...
– Kurt
Dec 31 '18 at 18:00






Please do not ask the same question again and again. You already got an answer her tex.stackexchange.com/a/467316/16550 ! Or simply change your identifiers to be shorter ... And please do not add code snippets, show us a compilable short code resulting in your issue ...
– Kurt
Dec 31 '18 at 18:00












1 Answer
1






active

oldest

votes


















0














You're using math mode incorrectly, and therefore TeX has no idea where a good line break should be placed despite using raggedright. Below I've formatted the equations in the proper way, allowing for a line break to be placed around a relation (like =). I've also added some formatting style that should make your code more readable.



enter image description here



documentclass{article}

usepackage{algorithm,algorithmic}

newcommand{var}{textit}
newcommand{proc}{textbf}
newcommand{prop}{texttt}
newcommand{plusplus}{{+}{+}}% Other options: https://tex.stackexchange.com/q/4302/5764

begin{document}

begin{algorithm}
caption{Iterative Process}
begin{algorithmic}[1]
raggedright
STATE proc{OwnerClassPrediction}()
STATE $var{iteration} = 1$
STATE $proc{Predictions}(var{iteration} - 1) = prop{methodTraceList.predictions}$
STATE $proc{Predictions}(var{iteration}) = emptyset$
WHILE{$proc{Predictions}(var{iteration}) neq proc{Predictions}(var{iteration} - 1)$}
STATE $proc{Predictions}(var{iteration}) = proc{SurroundednessPurePattern}(proc{Predictions}(var{iteration}))$
STATE $proc{Predictions}(var{iteration}) = proc{SurroundednessMixedPattern}(proc{Predictions}(var{iteration}))$
STATE $proc{Predictions}(var{iteration}) = proc{InheritanceInterfacesPattern}(proc{Predictions}(var{iteration}))$
STATE $proc{Predictions}(var{iteration}) = proc{AllCallersPattern}(proc{Predictions}(var{iteration}))$
STATE $proc{Predictions}(var{iteration}) = proc{AllCalleesPattern}(proc{Predictions}(var{iteration}))$
STATE $var{iteration}plusplus$
ENDWHILE
end{algorithmic}
end{algorithm}

end{document}


I don't really enjoy the indentation associated with the automatic line breaks from raggedright. You could consider manually breaking the content and inserting some indentation (quad) manually.



enter image description here



documentclass{article}

usepackage{algorithm,algorithmic}

newcommand{var}{textit}
newcommand{proc}{textbf}
newcommand{prop}{texttt}
newcommand{plusplus}{{+}{+}}% Other options: https://tex.stackexchange.com/q/4302/5764

begin{document}

begin{algorithm}
caption{Iterative Process}
begin{algorithmic}[1]
STATE proc{OwnerClassPrediction}()
STATE $var{iteration} = 1$
STATE $proc{Predictions}(var{iteration} - 1) = prop{methodTraceList.predictions}$
STATE $proc{Predictions}(var{iteration}) = emptyset$
WHILE{$proc{Predictions}(var{iteration}) neq proc{Predictions}(var{iteration} - 1)$}
STATE $proc{Predictions}(var{iteration}) = {}$ \
quad $proc{SurroundednessPurePattern}(proc{Predictions}(var{iteration}))$
STATE $proc{Predictions}(var{iteration}) = {}$ \
quad $proc{SurroundednessMixedPattern}(proc{Predictions}(var{iteration}))$
STATE $proc{Predictions}(var{iteration}) = {}$ \
quad $proc{InheritanceInterfacesPattern}(proc{Predictions}(var{iteration}))$
STATE $proc{Predictions}(var{iteration}) = {}$ \
quad $proc{AllCallersPattern}(proc{Predictions}(var{iteration}))$
STATE $proc{Predictions}(var{iteration}) = {}$ \
quad $proc{AllCalleesPattern}(proc{Predictions}(var{iteration}))$
STATE $var{iteration}plusplus$
ENDWHILE
end{algorithmic}
end{algorithm}

end{document}





share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "85"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f468061%2favoid-line-overflow-in-algorithm%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You're using math mode incorrectly, and therefore TeX has no idea where a good line break should be placed despite using raggedright. Below I've formatted the equations in the proper way, allowing for a line break to be placed around a relation (like =). I've also added some formatting style that should make your code more readable.



    enter image description here



    documentclass{article}

    usepackage{algorithm,algorithmic}

    newcommand{var}{textit}
    newcommand{proc}{textbf}
    newcommand{prop}{texttt}
    newcommand{plusplus}{{+}{+}}% Other options: https://tex.stackexchange.com/q/4302/5764

    begin{document}

    begin{algorithm}
    caption{Iterative Process}
    begin{algorithmic}[1]
    raggedright
    STATE proc{OwnerClassPrediction}()
    STATE $var{iteration} = 1$
    STATE $proc{Predictions}(var{iteration} - 1) = prop{methodTraceList.predictions}$
    STATE $proc{Predictions}(var{iteration}) = emptyset$
    WHILE{$proc{Predictions}(var{iteration}) neq proc{Predictions}(var{iteration} - 1)$}
    STATE $proc{Predictions}(var{iteration}) = proc{SurroundednessPurePattern}(proc{Predictions}(var{iteration}))$
    STATE $proc{Predictions}(var{iteration}) = proc{SurroundednessMixedPattern}(proc{Predictions}(var{iteration}))$
    STATE $proc{Predictions}(var{iteration}) = proc{InheritanceInterfacesPattern}(proc{Predictions}(var{iteration}))$
    STATE $proc{Predictions}(var{iteration}) = proc{AllCallersPattern}(proc{Predictions}(var{iteration}))$
    STATE $proc{Predictions}(var{iteration}) = proc{AllCalleesPattern}(proc{Predictions}(var{iteration}))$
    STATE $var{iteration}plusplus$
    ENDWHILE
    end{algorithmic}
    end{algorithm}

    end{document}


    I don't really enjoy the indentation associated with the automatic line breaks from raggedright. You could consider manually breaking the content and inserting some indentation (quad) manually.



    enter image description here



    documentclass{article}

    usepackage{algorithm,algorithmic}

    newcommand{var}{textit}
    newcommand{proc}{textbf}
    newcommand{prop}{texttt}
    newcommand{plusplus}{{+}{+}}% Other options: https://tex.stackexchange.com/q/4302/5764

    begin{document}

    begin{algorithm}
    caption{Iterative Process}
    begin{algorithmic}[1]
    STATE proc{OwnerClassPrediction}()
    STATE $var{iteration} = 1$
    STATE $proc{Predictions}(var{iteration} - 1) = prop{methodTraceList.predictions}$
    STATE $proc{Predictions}(var{iteration}) = emptyset$
    WHILE{$proc{Predictions}(var{iteration}) neq proc{Predictions}(var{iteration} - 1)$}
    STATE $proc{Predictions}(var{iteration}) = {}$ \
    quad $proc{SurroundednessPurePattern}(proc{Predictions}(var{iteration}))$
    STATE $proc{Predictions}(var{iteration}) = {}$ \
    quad $proc{SurroundednessMixedPattern}(proc{Predictions}(var{iteration}))$
    STATE $proc{Predictions}(var{iteration}) = {}$ \
    quad $proc{InheritanceInterfacesPattern}(proc{Predictions}(var{iteration}))$
    STATE $proc{Predictions}(var{iteration}) = {}$ \
    quad $proc{AllCallersPattern}(proc{Predictions}(var{iteration}))$
    STATE $proc{Predictions}(var{iteration}) = {}$ \
    quad $proc{AllCalleesPattern}(proc{Predictions}(var{iteration}))$
    STATE $var{iteration}plusplus$
    ENDWHILE
    end{algorithmic}
    end{algorithm}

    end{document}





    share|improve this answer


























      0














      You're using math mode incorrectly, and therefore TeX has no idea where a good line break should be placed despite using raggedright. Below I've formatted the equations in the proper way, allowing for a line break to be placed around a relation (like =). I've also added some formatting style that should make your code more readable.



      enter image description here



      documentclass{article}

      usepackage{algorithm,algorithmic}

      newcommand{var}{textit}
      newcommand{proc}{textbf}
      newcommand{prop}{texttt}
      newcommand{plusplus}{{+}{+}}% Other options: https://tex.stackexchange.com/q/4302/5764

      begin{document}

      begin{algorithm}
      caption{Iterative Process}
      begin{algorithmic}[1]
      raggedright
      STATE proc{OwnerClassPrediction}()
      STATE $var{iteration} = 1$
      STATE $proc{Predictions}(var{iteration} - 1) = prop{methodTraceList.predictions}$
      STATE $proc{Predictions}(var{iteration}) = emptyset$
      WHILE{$proc{Predictions}(var{iteration}) neq proc{Predictions}(var{iteration} - 1)$}
      STATE $proc{Predictions}(var{iteration}) = proc{SurroundednessPurePattern}(proc{Predictions}(var{iteration}))$
      STATE $proc{Predictions}(var{iteration}) = proc{SurroundednessMixedPattern}(proc{Predictions}(var{iteration}))$
      STATE $proc{Predictions}(var{iteration}) = proc{InheritanceInterfacesPattern}(proc{Predictions}(var{iteration}))$
      STATE $proc{Predictions}(var{iteration}) = proc{AllCallersPattern}(proc{Predictions}(var{iteration}))$
      STATE $proc{Predictions}(var{iteration}) = proc{AllCalleesPattern}(proc{Predictions}(var{iteration}))$
      STATE $var{iteration}plusplus$
      ENDWHILE
      end{algorithmic}
      end{algorithm}

      end{document}


      I don't really enjoy the indentation associated with the automatic line breaks from raggedright. You could consider manually breaking the content and inserting some indentation (quad) manually.



      enter image description here



      documentclass{article}

      usepackage{algorithm,algorithmic}

      newcommand{var}{textit}
      newcommand{proc}{textbf}
      newcommand{prop}{texttt}
      newcommand{plusplus}{{+}{+}}% Other options: https://tex.stackexchange.com/q/4302/5764

      begin{document}

      begin{algorithm}
      caption{Iterative Process}
      begin{algorithmic}[1]
      STATE proc{OwnerClassPrediction}()
      STATE $var{iteration} = 1$
      STATE $proc{Predictions}(var{iteration} - 1) = prop{methodTraceList.predictions}$
      STATE $proc{Predictions}(var{iteration}) = emptyset$
      WHILE{$proc{Predictions}(var{iteration}) neq proc{Predictions}(var{iteration} - 1)$}
      STATE $proc{Predictions}(var{iteration}) = {}$ \
      quad $proc{SurroundednessPurePattern}(proc{Predictions}(var{iteration}))$
      STATE $proc{Predictions}(var{iteration}) = {}$ \
      quad $proc{SurroundednessMixedPattern}(proc{Predictions}(var{iteration}))$
      STATE $proc{Predictions}(var{iteration}) = {}$ \
      quad $proc{InheritanceInterfacesPattern}(proc{Predictions}(var{iteration}))$
      STATE $proc{Predictions}(var{iteration}) = {}$ \
      quad $proc{AllCallersPattern}(proc{Predictions}(var{iteration}))$
      STATE $proc{Predictions}(var{iteration}) = {}$ \
      quad $proc{AllCalleesPattern}(proc{Predictions}(var{iteration}))$
      STATE $var{iteration}plusplus$
      ENDWHILE
      end{algorithmic}
      end{algorithm}

      end{document}





      share|improve this answer
























        0












        0








        0






        You're using math mode incorrectly, and therefore TeX has no idea where a good line break should be placed despite using raggedright. Below I've formatted the equations in the proper way, allowing for a line break to be placed around a relation (like =). I've also added some formatting style that should make your code more readable.



        enter image description here



        documentclass{article}

        usepackage{algorithm,algorithmic}

        newcommand{var}{textit}
        newcommand{proc}{textbf}
        newcommand{prop}{texttt}
        newcommand{plusplus}{{+}{+}}% Other options: https://tex.stackexchange.com/q/4302/5764

        begin{document}

        begin{algorithm}
        caption{Iterative Process}
        begin{algorithmic}[1]
        raggedright
        STATE proc{OwnerClassPrediction}()
        STATE $var{iteration} = 1$
        STATE $proc{Predictions}(var{iteration} - 1) = prop{methodTraceList.predictions}$
        STATE $proc{Predictions}(var{iteration}) = emptyset$
        WHILE{$proc{Predictions}(var{iteration}) neq proc{Predictions}(var{iteration} - 1)$}
        STATE $proc{Predictions}(var{iteration}) = proc{SurroundednessPurePattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = proc{SurroundednessMixedPattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = proc{InheritanceInterfacesPattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = proc{AllCallersPattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = proc{AllCalleesPattern}(proc{Predictions}(var{iteration}))$
        STATE $var{iteration}plusplus$
        ENDWHILE
        end{algorithmic}
        end{algorithm}

        end{document}


        I don't really enjoy the indentation associated with the automatic line breaks from raggedright. You could consider manually breaking the content and inserting some indentation (quad) manually.



        enter image description here



        documentclass{article}

        usepackage{algorithm,algorithmic}

        newcommand{var}{textit}
        newcommand{proc}{textbf}
        newcommand{prop}{texttt}
        newcommand{plusplus}{{+}{+}}% Other options: https://tex.stackexchange.com/q/4302/5764

        begin{document}

        begin{algorithm}
        caption{Iterative Process}
        begin{algorithmic}[1]
        STATE proc{OwnerClassPrediction}()
        STATE $var{iteration} = 1$
        STATE $proc{Predictions}(var{iteration} - 1) = prop{methodTraceList.predictions}$
        STATE $proc{Predictions}(var{iteration}) = emptyset$
        WHILE{$proc{Predictions}(var{iteration}) neq proc{Predictions}(var{iteration} - 1)$}
        STATE $proc{Predictions}(var{iteration}) = {}$ \
        quad $proc{SurroundednessPurePattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = {}$ \
        quad $proc{SurroundednessMixedPattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = {}$ \
        quad $proc{InheritanceInterfacesPattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = {}$ \
        quad $proc{AllCallersPattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = {}$ \
        quad $proc{AllCalleesPattern}(proc{Predictions}(var{iteration}))$
        STATE $var{iteration}plusplus$
        ENDWHILE
        end{algorithmic}
        end{algorithm}

        end{document}





        share|improve this answer












        You're using math mode incorrectly, and therefore TeX has no idea where a good line break should be placed despite using raggedright. Below I've formatted the equations in the proper way, allowing for a line break to be placed around a relation (like =). I've also added some formatting style that should make your code more readable.



        enter image description here



        documentclass{article}

        usepackage{algorithm,algorithmic}

        newcommand{var}{textit}
        newcommand{proc}{textbf}
        newcommand{prop}{texttt}
        newcommand{plusplus}{{+}{+}}% Other options: https://tex.stackexchange.com/q/4302/5764

        begin{document}

        begin{algorithm}
        caption{Iterative Process}
        begin{algorithmic}[1]
        raggedright
        STATE proc{OwnerClassPrediction}()
        STATE $var{iteration} = 1$
        STATE $proc{Predictions}(var{iteration} - 1) = prop{methodTraceList.predictions}$
        STATE $proc{Predictions}(var{iteration}) = emptyset$
        WHILE{$proc{Predictions}(var{iteration}) neq proc{Predictions}(var{iteration} - 1)$}
        STATE $proc{Predictions}(var{iteration}) = proc{SurroundednessPurePattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = proc{SurroundednessMixedPattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = proc{InheritanceInterfacesPattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = proc{AllCallersPattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = proc{AllCalleesPattern}(proc{Predictions}(var{iteration}))$
        STATE $var{iteration}plusplus$
        ENDWHILE
        end{algorithmic}
        end{algorithm}

        end{document}


        I don't really enjoy the indentation associated with the automatic line breaks from raggedright. You could consider manually breaking the content and inserting some indentation (quad) manually.



        enter image description here



        documentclass{article}

        usepackage{algorithm,algorithmic}

        newcommand{var}{textit}
        newcommand{proc}{textbf}
        newcommand{prop}{texttt}
        newcommand{plusplus}{{+}{+}}% Other options: https://tex.stackexchange.com/q/4302/5764

        begin{document}

        begin{algorithm}
        caption{Iterative Process}
        begin{algorithmic}[1]
        STATE proc{OwnerClassPrediction}()
        STATE $var{iteration} = 1$
        STATE $proc{Predictions}(var{iteration} - 1) = prop{methodTraceList.predictions}$
        STATE $proc{Predictions}(var{iteration}) = emptyset$
        WHILE{$proc{Predictions}(var{iteration}) neq proc{Predictions}(var{iteration} - 1)$}
        STATE $proc{Predictions}(var{iteration}) = {}$ \
        quad $proc{SurroundednessPurePattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = {}$ \
        quad $proc{SurroundednessMixedPattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = {}$ \
        quad $proc{InheritanceInterfacesPattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = {}$ \
        quad $proc{AllCallersPattern}(proc{Predictions}(var{iteration}))$
        STATE $proc{Predictions}(var{iteration}) = {}$ \
        quad $proc{AllCalleesPattern}(proc{Predictions}(var{iteration}))$
        STATE $var{iteration}plusplus$
        ENDWHILE
        end{algorithmic}
        end{algorithm}

        end{document}






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 31 '18 at 18:14









        WernerWerner

        438k659641656




        438k659641656






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f468061%2favoid-line-overflow-in-algorithm%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to change which sound is reproduced for terminal bell?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Can I use Tabulator js library in my java Spring + Thymeleaf project?