Replicating `SetKwInOut` and the format from `algorithm2e` in `algorithmicx` The 2019 Stack...

How to notate time signature switching consistently every measure

Are there any other methods to apply to solving simultaneous equations?

How to support a colleague who finds meetings extremely tiring?

Slides for 30 min~1 hr Skype tenure track application interview

The difference between dialogue marks

What is the most efficient way to store a numeric range?

Mathematics of imaging the black hole

How to type this arrow in math mode?

Can there be female White Walkers?

Does a dangling wire really electrocute me if I'm standing in water?

Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

"consumers choosing to rely" vs. "consumers to choose to rely"

"as much details as you can remember"

Why is the Constellation's nose gear so long?

Why are there uneven bright areas in this photo of black hole?

Why couldn't they take pictures of a closer black hole?

How come people say “Would of”?

If a sorcerer casts the Banishment spell on a PC while in Avernus, does the PC return to their home plane?

What do I do when my TA workload is more than expected?

How to check whether the reindex working or not in Magento?

Why didn't the Event Horizon Telescope team mention Sagittarius A*?

Can a flute soloist sit?

The phrase "to the numbers born"?



Replicating `SetKwInOut` and the format from `algorithm2e` in `algorithmicx`



The 2019 Stack Overflow Developer Survey Results Are InAlign Input and Output of algorithm to leftProblem with the block with the word wrap in algorithmicxusing standalone with algorithmicx or algorithm2eHow may I remove EndIf and EndFor in algorithmicx?Fixing the location of the appearance in algorithmicx environmentHow to have the algorithmicx comment symbol in algorithm2e?algorithm2e style comments in algorithmicxalgorithm, algorithmic, algorithmicx, algorithm2e, algpseudocode = confusedHow to correct the alignment (of the line numbers) in algorithmicx?Algorithmicx: controlling newline at the begin of a block using flagsTracing line from algorithm2e in algorithmicx












4















Brief



I've heard that algorithmicx is the best algorithm package to use. However, in my work I've been using algorithm2e. On looking at a few examples on here its clear that it is a bit difficult converting between the two.



In particular, I've notice that the SetKwInOutcommands do not exist in algorithmicx. For example:



MWE



documentclass{book}

%for original algorithm
usepackage{amsmath}
usepackage[linesnumbered,ruled]{algorithm2e}

%usepackage{algorithm,algpseudocode}

usepackage{lipsum}



begin{document}

%Original table to try and replicate

lipsum[1-1]


begin{algorithm}[H]
SetKwInOut{Input}{Input}
SetKwInOut{Output}{Output}
SetKwInOut{Define}{Define}
underline{Initialise:} Conditions for algorithm;
Define {Definition of algorithm}
Input{Input of Algorithm}
Output{Output of algorithm}

underline{Sequence In Full:}

{

hspace{5pt} textbf{Start}:

}
{

hspace{17pt} Step 1 ;

}
{


bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup

}

{

hspace{17pt} Step 2 ;

}
{


bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup

}
{

hspace{17pt} Step 3 ;

}
{

hspace {5pt} textbf{End}

}

caption{Name of algorithm}label{alg:Name}
end{algorithm}



end{document}


enter image description here



Goal



Is there any way to replicate the above into algorithmicx. (As you can see the reason as to why i want to convert it is because i've read that algorithmicxis the only package which allows you to separate the algorithm over multiple pages). Thank-you in advance?










share|improve this question



























    4















    Brief



    I've heard that algorithmicx is the best algorithm package to use. However, in my work I've been using algorithm2e. On looking at a few examples on here its clear that it is a bit difficult converting between the two.



    In particular, I've notice that the SetKwInOutcommands do not exist in algorithmicx. For example:



    MWE



    documentclass{book}

    %for original algorithm
    usepackage{amsmath}
    usepackage[linesnumbered,ruled]{algorithm2e}

    %usepackage{algorithm,algpseudocode}

    usepackage{lipsum}



    begin{document}

    %Original table to try and replicate

    lipsum[1-1]


    begin{algorithm}[H]
    SetKwInOut{Input}{Input}
    SetKwInOut{Output}{Output}
    SetKwInOut{Define}{Define}
    underline{Initialise:} Conditions for algorithm;
    Define {Definition of algorithm}
    Input{Input of Algorithm}
    Output{Output of algorithm}

    underline{Sequence In Full:}

    {

    hspace{5pt} textbf{Start}:

    }
    {

    hspace{17pt} Step 1 ;

    }
    {


    bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup

    }

    {

    hspace{17pt} Step 2 ;

    }
    {


    bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup

    }
    {

    hspace{17pt} Step 3 ;

    }
    {

    hspace {5pt} textbf{End}

    }

    caption{Name of algorithm}label{alg:Name}
    end{algorithm}



    end{document}


    enter image description here



    Goal



    Is there any way to replicate the above into algorithmicx. (As you can see the reason as to why i want to convert it is because i've read that algorithmicxis the only package which allows you to separate the algorithm over multiple pages). Thank-you in advance?










    share|improve this question

























      4












      4








      4








      Brief



      I've heard that algorithmicx is the best algorithm package to use. However, in my work I've been using algorithm2e. On looking at a few examples on here its clear that it is a bit difficult converting between the two.



      In particular, I've notice that the SetKwInOutcommands do not exist in algorithmicx. For example:



      MWE



      documentclass{book}

      %for original algorithm
      usepackage{amsmath}
      usepackage[linesnumbered,ruled]{algorithm2e}

      %usepackage{algorithm,algpseudocode}

      usepackage{lipsum}



      begin{document}

      %Original table to try and replicate

      lipsum[1-1]


      begin{algorithm}[H]
      SetKwInOut{Input}{Input}
      SetKwInOut{Output}{Output}
      SetKwInOut{Define}{Define}
      underline{Initialise:} Conditions for algorithm;
      Define {Definition of algorithm}
      Input{Input of Algorithm}
      Output{Output of algorithm}

      underline{Sequence In Full:}

      {

      hspace{5pt} textbf{Start}:

      }
      {

      hspace{17pt} Step 1 ;

      }
      {


      bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup

      }

      {

      hspace{17pt} Step 2 ;

      }
      {


      bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup

      }
      {

      hspace{17pt} Step 3 ;

      }
      {

      hspace {5pt} textbf{End}

      }

      caption{Name of algorithm}label{alg:Name}
      end{algorithm}



      end{document}


      enter image description here



      Goal



      Is there any way to replicate the above into algorithmicx. (As you can see the reason as to why i want to convert it is because i've read that algorithmicxis the only package which allows you to separate the algorithm over multiple pages). Thank-you in advance?










      share|improve this question














      Brief



      I've heard that algorithmicx is the best algorithm package to use. However, in my work I've been using algorithm2e. On looking at a few examples on here its clear that it is a bit difficult converting between the two.



      In particular, I've notice that the SetKwInOutcommands do not exist in algorithmicx. For example:



      MWE



      documentclass{book}

      %for original algorithm
      usepackage{amsmath}
      usepackage[linesnumbered,ruled]{algorithm2e}

      %usepackage{algorithm,algpseudocode}

      usepackage{lipsum}



      begin{document}

      %Original table to try and replicate

      lipsum[1-1]


      begin{algorithm}[H]
      SetKwInOut{Input}{Input}
      SetKwInOut{Output}{Output}
      SetKwInOut{Define}{Define}
      underline{Initialise:} Conditions for algorithm;
      Define {Definition of algorithm}
      Input{Input of Algorithm}
      Output{Output of algorithm}

      underline{Sequence In Full:}

      {

      hspace{5pt} textbf{Start}:

      }
      {

      hspace{17pt} Step 1 ;

      }
      {


      bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup

      }

      {

      hspace{17pt} Step 2 ;

      }
      {


      bgroupleftskip 15pt hspace{1pt} lipsum[1-1] ; paregroup

      }
      {

      hspace{17pt} Step 3 ;

      }
      {

      hspace {5pt} textbf{End}

      }

      caption{Name of algorithm}label{alg:Name}
      end{algorithm}



      end{document}


      enter image description here



      Goal



      Is there any way to replicate the above into algorithmicx. (As you can see the reason as to why i want to convert it is because i've read that algorithmicxis the only package which allows you to separate the algorithm over multiple pages). Thank-you in advance?







      formatting algorithms algorithmicx






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 15 '18 at 10:16









      HELPHELP

      815




      815






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Yes algorithmicx has something like: SetKwInOut it's called : Require and Ensure in the algopseudocode layout of algorithmicx (you will have to use usepcakage{algopseudocode}`).



          Then you can rename it as you want using this methods:



          algrenewcommandalgorithmicrequire{textbf{Input:}}
          algrenewcommandalgorithmicensure{textbf{Output:}}


          as suggested here: Align Input and Output of algorithm to left





          share
























            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%2f410448%2freplicating-setkwinout-and-the-format-from-algorithm2e-in-algorithmicx%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














            Yes algorithmicx has something like: SetKwInOut it's called : Require and Ensure in the algopseudocode layout of algorithmicx (you will have to use usepcakage{algopseudocode}`).



            Then you can rename it as you want using this methods:



            algrenewcommandalgorithmicrequire{textbf{Input:}}
            algrenewcommandalgorithmicensure{textbf{Output:}}


            as suggested here: Align Input and Output of algorithm to left





            share




























              0














              Yes algorithmicx has something like: SetKwInOut it's called : Require and Ensure in the algopseudocode layout of algorithmicx (you will have to use usepcakage{algopseudocode}`).



              Then you can rename it as you want using this methods:



              algrenewcommandalgorithmicrequire{textbf{Input:}}
              algrenewcommandalgorithmicensure{textbf{Output:}}


              as suggested here: Align Input and Output of algorithm to left





              share


























                0












                0








                0







                Yes algorithmicx has something like: SetKwInOut it's called : Require and Ensure in the algopseudocode layout of algorithmicx (you will have to use usepcakage{algopseudocode}`).



                Then you can rename it as you want using this methods:



                algrenewcommandalgorithmicrequire{textbf{Input:}}
                algrenewcommandalgorithmicensure{textbf{Output:}}


                as suggested here: Align Input and Output of algorithm to left





                share













                Yes algorithmicx has something like: SetKwInOut it's called : Require and Ensure in the algopseudocode layout of algorithmicx (you will have to use usepcakage{algopseudocode}`).



                Then you can rename it as you want using this methods:



                algrenewcommandalgorithmicrequire{textbf{Input:}}
                algrenewcommandalgorithmicensure{textbf{Output:}}


                as suggested here: Align Input and Output of algorithm to left






                share











                share


                share










                answered 3 mins ago









                Simon C.Simon C.

                1135




                1135






























                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f410448%2freplicating-setkwinout-and-the-format-from-algorithm2e-in-algorithmicx%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

                    IEEEtran - How to include ORCID in TeX/PDF with PdfLatexIs there a standard way to include ORCID in TeX /...

                    Cicindela nigrior Przypisy | Menu nawigacyjneCicindela varians unicolorManual for the Identification of the...

                    How close the buttons of bookmark?Bookmark Title Pageglobal bookmark settingsbookmark packageWrong PDF...