Some help needed with pseudocode in LaTeX












1















Hello trying to writte pseudocode in Latex



I cant fix mistake in line 8



code:



begin{algorithm} caption{Učící mechanismus všech obcí}
begin{algorithmic}[1]
While {Obce ještě nedokonvergovaly}
State t=t+1
ForEach {KNIES_p $in$ Population}
For{$X_i$ $in$ Zařazené body}
State KNIES_p.quad textbf{Learn}($X_i$, $beta_t = frac{tbeta_T}{T}$)
EndFor
If{KNIES_p {$qaq$} KNIES}
State KNIES(t) = KNIES_p
end{algorithmic}
end{algorithm}


enter image description here










share|improve this question




















  • 3





    Welcome to TeX.SX! Could you please turn your code fragment into a compilabe minimal working example (MWE) by adding the documentclass and the relevant packages. Please also explain the connection to biblatex as you used this tag.

    – leandriis
    Mar 18 at 19:01








  • 1





    Please do not shout on us (Change chapital letters in title of question)! How is this related to your last question tex.stackexchange.com/questions/479937/… ? Which error do you get and please make your code snippet compilable ....

    – Kurt
    Mar 18 at 19:23
















1















Hello trying to writte pseudocode in Latex



I cant fix mistake in line 8



code:



begin{algorithm} caption{Učící mechanismus všech obcí}
begin{algorithmic}[1]
While {Obce ještě nedokonvergovaly}
State t=t+1
ForEach {KNIES_p $in$ Population}
For{$X_i$ $in$ Zařazené body}
State KNIES_p.quad textbf{Learn}($X_i$, $beta_t = frac{tbeta_T}{T}$)
EndFor
If{KNIES_p {$qaq$} KNIES}
State KNIES(t) = KNIES_p
end{algorithmic}
end{algorithm}


enter image description here










share|improve this question




















  • 3





    Welcome to TeX.SX! Could you please turn your code fragment into a compilabe minimal working example (MWE) by adding the documentclass and the relevant packages. Please also explain the connection to biblatex as you used this tag.

    – leandriis
    Mar 18 at 19:01








  • 1





    Please do not shout on us (Change chapital letters in title of question)! How is this related to your last question tex.stackexchange.com/questions/479937/… ? Which error do you get and please make your code snippet compilable ....

    – Kurt
    Mar 18 at 19:23














1












1








1


0






Hello trying to writte pseudocode in Latex



I cant fix mistake in line 8



code:



begin{algorithm} caption{Učící mechanismus všech obcí}
begin{algorithmic}[1]
While {Obce ještě nedokonvergovaly}
State t=t+1
ForEach {KNIES_p $in$ Population}
For{$X_i$ $in$ Zařazené body}
State KNIES_p.quad textbf{Learn}($X_i$, $beta_t = frac{tbeta_T}{T}$)
EndFor
If{KNIES_p {$qaq$} KNIES}
State KNIES(t) = KNIES_p
end{algorithmic}
end{algorithm}


enter image description here










share|improve this question
















Hello trying to writte pseudocode in Latex



I cant fix mistake in line 8



code:



begin{algorithm} caption{Učící mechanismus všech obcí}
begin{algorithmic}[1]
While {Obce ještě nedokonvergovaly}
State t=t+1
ForEach {KNIES_p $in$ Population}
For{$X_i$ $in$ Zařazené body}
State KNIES_p.quad textbf{Learn}($X_i$, $beta_t = frac{tbeta_T}{T}$)
EndFor
If{KNIES_p {$qaq$} KNIES}
State KNIES(t) = KNIES_p
end{algorithmic}
end{algorithm}


enter image description here







algorithmic pseudocode






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 18 at 21:57









egreg

730k8819283242




730k8819283242










asked Mar 18 at 18:58









Petr HrobařPetr Hrobař

254




254








  • 3





    Welcome to TeX.SX! Could you please turn your code fragment into a compilabe minimal working example (MWE) by adding the documentclass and the relevant packages. Please also explain the connection to biblatex as you used this tag.

    – leandriis
    Mar 18 at 19:01








  • 1





    Please do not shout on us (Change chapital letters in title of question)! How is this related to your last question tex.stackexchange.com/questions/479937/… ? Which error do you get and please make your code snippet compilable ....

    – Kurt
    Mar 18 at 19:23














  • 3





    Welcome to TeX.SX! Could you please turn your code fragment into a compilabe minimal working example (MWE) by adding the documentclass and the relevant packages. Please also explain the connection to biblatex as you used this tag.

    – leandriis
    Mar 18 at 19:01








  • 1





    Please do not shout on us (Change chapital letters in title of question)! How is this related to your last question tex.stackexchange.com/questions/479937/… ? Which error do you get and please make your code snippet compilable ....

    – Kurt
    Mar 18 at 19:23








3




3





Welcome to TeX.SX! Could you please turn your code fragment into a compilabe minimal working example (MWE) by adding the documentclass and the relevant packages. Please also explain the connection to biblatex as you used this tag.

– leandriis
Mar 18 at 19:01







Welcome to TeX.SX! Could you please turn your code fragment into a compilabe minimal working example (MWE) by adding the documentclass and the relevant packages. Please also explain the connection to biblatex as you used this tag.

– leandriis
Mar 18 at 19:01






1




1





Please do not shout on us (Change chapital letters in title of question)! How is this related to your last question tex.stackexchange.com/questions/479937/… ? Which error do you get and please make your code snippet compilable ....

– Kurt
Mar 18 at 19:23





Please do not shout on us (Change chapital letters in title of question)! How is this related to your last question tex.stackexchange.com/questions/479937/… ? Which error do you get and please make your code snippet compilable ....

– Kurt
Mar 18 at 19:23










1 Answer
1






active

oldest

votes


















4














You have many errors, mostly due to improper treatment of math symbols.



There is no predefined ForEach block, you have to define it yourself.



Supply a definition for qaq, that's not a standard command.



documentclass[a4paper]{article}
usepackage[T1]{fontenc}
usepackage[czech]{babel}

usepackage{algorithm,algpseudocode}

algblockx{ForEach}{EndForEach}{textbf{foreach} }{textbf{end foreach}}
newcommand{ivar}[1]{mathit{#1}}
newcommand{tvar}[1]{textrm{#1}}

newcommand{qaq}{???} % what's this?

begin{document}

begin{algorithm} caption{Učící mechanismus všech obcí}
begin{algorithmic}[1]
While {Obce ještě nedokonvergovaly}
State $t=t+1$
ForEach {$ivar{KNIES}_p in tvar{Population}$}
For{$X_iintvar{Zařazené body}$}
State $ivar{KNIES}_p$.quad
textbf{Learn}($X_i$, $beta_t = frac{tbeta_T}{T}$)
EndFor
EndForEach
If{$ivar{KNIES}_p qaq ivar{KNIES}$}
State $ivar{KNIES}(t) = ivar{KNIES}_p$
EndIf
EndWhile
end{algorithmic}
end{algorithm}

end{document}


enter image description here






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%2f480139%2fsome-help-needed-with-pseudocode-in-latex%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









    4














    You have many errors, mostly due to improper treatment of math symbols.



    There is no predefined ForEach block, you have to define it yourself.



    Supply a definition for qaq, that's not a standard command.



    documentclass[a4paper]{article}
    usepackage[T1]{fontenc}
    usepackage[czech]{babel}

    usepackage{algorithm,algpseudocode}

    algblockx{ForEach}{EndForEach}{textbf{foreach} }{textbf{end foreach}}
    newcommand{ivar}[1]{mathit{#1}}
    newcommand{tvar}[1]{textrm{#1}}

    newcommand{qaq}{???} % what's this?

    begin{document}

    begin{algorithm} caption{Učící mechanismus všech obcí}
    begin{algorithmic}[1]
    While {Obce ještě nedokonvergovaly}
    State $t=t+1$
    ForEach {$ivar{KNIES}_p in tvar{Population}$}
    For{$X_iintvar{Zařazené body}$}
    State $ivar{KNIES}_p$.quad
    textbf{Learn}($X_i$, $beta_t = frac{tbeta_T}{T}$)
    EndFor
    EndForEach
    If{$ivar{KNIES}_p qaq ivar{KNIES}$}
    State $ivar{KNIES}(t) = ivar{KNIES}_p$
    EndIf
    EndWhile
    end{algorithmic}
    end{algorithm}

    end{document}


    enter image description here






    share|improve this answer




























      4














      You have many errors, mostly due to improper treatment of math symbols.



      There is no predefined ForEach block, you have to define it yourself.



      Supply a definition for qaq, that's not a standard command.



      documentclass[a4paper]{article}
      usepackage[T1]{fontenc}
      usepackage[czech]{babel}

      usepackage{algorithm,algpseudocode}

      algblockx{ForEach}{EndForEach}{textbf{foreach} }{textbf{end foreach}}
      newcommand{ivar}[1]{mathit{#1}}
      newcommand{tvar}[1]{textrm{#1}}

      newcommand{qaq}{???} % what's this?

      begin{document}

      begin{algorithm} caption{Učící mechanismus všech obcí}
      begin{algorithmic}[1]
      While {Obce ještě nedokonvergovaly}
      State $t=t+1$
      ForEach {$ivar{KNIES}_p in tvar{Population}$}
      For{$X_iintvar{Zařazené body}$}
      State $ivar{KNIES}_p$.quad
      textbf{Learn}($X_i$, $beta_t = frac{tbeta_T}{T}$)
      EndFor
      EndForEach
      If{$ivar{KNIES}_p qaq ivar{KNIES}$}
      State $ivar{KNIES}(t) = ivar{KNIES}_p$
      EndIf
      EndWhile
      end{algorithmic}
      end{algorithm}

      end{document}


      enter image description here






      share|improve this answer


























        4












        4








        4







        You have many errors, mostly due to improper treatment of math symbols.



        There is no predefined ForEach block, you have to define it yourself.



        Supply a definition for qaq, that's not a standard command.



        documentclass[a4paper]{article}
        usepackage[T1]{fontenc}
        usepackage[czech]{babel}

        usepackage{algorithm,algpseudocode}

        algblockx{ForEach}{EndForEach}{textbf{foreach} }{textbf{end foreach}}
        newcommand{ivar}[1]{mathit{#1}}
        newcommand{tvar}[1]{textrm{#1}}

        newcommand{qaq}{???} % what's this?

        begin{document}

        begin{algorithm} caption{Učící mechanismus všech obcí}
        begin{algorithmic}[1]
        While {Obce ještě nedokonvergovaly}
        State $t=t+1$
        ForEach {$ivar{KNIES}_p in tvar{Population}$}
        For{$X_iintvar{Zařazené body}$}
        State $ivar{KNIES}_p$.quad
        textbf{Learn}($X_i$, $beta_t = frac{tbeta_T}{T}$)
        EndFor
        EndForEach
        If{$ivar{KNIES}_p qaq ivar{KNIES}$}
        State $ivar{KNIES}(t) = ivar{KNIES}_p$
        EndIf
        EndWhile
        end{algorithmic}
        end{algorithm}

        end{document}


        enter image description here






        share|improve this answer













        You have many errors, mostly due to improper treatment of math symbols.



        There is no predefined ForEach block, you have to define it yourself.



        Supply a definition for qaq, that's not a standard command.



        documentclass[a4paper]{article}
        usepackage[T1]{fontenc}
        usepackage[czech]{babel}

        usepackage{algorithm,algpseudocode}

        algblockx{ForEach}{EndForEach}{textbf{foreach} }{textbf{end foreach}}
        newcommand{ivar}[1]{mathit{#1}}
        newcommand{tvar}[1]{textrm{#1}}

        newcommand{qaq}{???} % what's this?

        begin{document}

        begin{algorithm} caption{Učící mechanismus všech obcí}
        begin{algorithmic}[1]
        While {Obce ještě nedokonvergovaly}
        State $t=t+1$
        ForEach {$ivar{KNIES}_p in tvar{Population}$}
        For{$X_iintvar{Zařazené body}$}
        State $ivar{KNIES}_p$.quad
        textbf{Learn}($X_i$, $beta_t = frac{tbeta_T}{T}$)
        EndFor
        EndForEach
        If{$ivar{KNIES}_p qaq ivar{KNIES}$}
        State $ivar{KNIES}(t) = ivar{KNIES}_p$
        EndIf
        EndWhile
        end{algorithmic}
        end{algorithm}

        end{document}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 18 at 21:56









        egregegreg

        730k8819283242




        730k8819283242






























            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%2f480139%2fsome-help-needed-with-pseudocode-in-latex%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 send String Array data to Server using php in android

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

            Is anime1.com a legal site for watching anime?