Pseudocode in latex cannot be formated












1















I´m writting my work and for some reasone my pseudocode in final pdf cannot be formated:



enter image description here



Mistake report is this:
enter image description here



The code I'm using:



documentclass[11pt,a4paper,openright]{report}
letopenright=cleardoublepage
usepackage[czech]{babel}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{textcomp}
usepackage[utf8]{inputenc}
usepackage{algorithm}% http://ctan.org/pkg/algorithm
usepackage{algpseudocode}
%%% Další užitečné balíčky (jsou součástí běžných distribucí LaTeXu)
usepackage{amsmath} % rozšíření pro sazbu matematiky
usepackage{amsfonts} % matematické fonty
usepackage{amsthm} % sazba vět, definic apod.
usepackage{bm} % tučné symboly (příkaz bm)
usepackage{graphicx} % vkládání obrázků
usepackage{fancyvrb} % vylepšené prostředí pro strojové usepackage{algorithm}
usepackage{algpseudocode}
usepackage{fancyhdr} % prostředí pohodlnější nastavení hlavy a paty stránek
usepackage{icomma} % inteligetní čárka v matematickém módu
usepackage{dcolumn} % lepší zarovnání sloupců v tabulkách
usepackage{booktabs} % lepší vodorovné linky v tabulkách
makeatletter
@ifpackageloaded{xcolor}{
@ifpackagewith{xcolor}{usenames}{}{PassOptionsToPackage{usenames}{xcolor}}
}{usepackage[usenames]{xcolor}} % barevná sazba
makeatother
usepackage{multicol} % práce s více sloupci na stránce
usepackage{caption}
usepackage{enumitem}


subsubsection{Vytváření clusterů}
begin{algorithm}
caption{Určení sousedících clusterů}
begin{algorithmic}[1]
For {$a, b in C$}
State předpokládej, že $a, b$ jsou sousedící
For {$k, l in C$ a $k, lneq a, b$}
If {$P_a P_b cap P_k P_l neqemptyset$}
State $a, b$ nejsou sousedící clustery
Else
If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$}
State $a, b$ nejsou sousedící clustery
EndIf
EndIf
EndFor
EndFor
end{algorithmic}
end{algorithm}









share|improve this question









New contributor




Petr Hrobař is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • How should we be able to help you without seeing the used code? Please -- as usual here -- add a short compilable tex code resulting in your screenshot to your question!

    – Kurt
    4 hours ago











  • random text: begin{algorithm} caption{Určení sousedících clusterů} begin{algorithmic}[1] For {$a, b in C$} State předpokládej, že $a, b$ jsou sousedící For {$k, l in C$ a $k, lneq a, b$} If {$P_a P_b cap P_k P_l neqemptyset$} State $a, b$ nejsou sousedící clustery Else If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$} State $a, b$ nejsou sousedící clustery EndIf EndIf EndFor EndFor end{algorithmic} end{algorithm} Another random text

    – Petr Hrobař
    4 hours ago











  • Please edit your question and add an compilable minimal working example (MWE) . Then we do not have to guess what you are doing ... Code in comment is not really helpful, for example the line breaks are missing!

    – Kurt
    4 hours ago













  • i´m writting it in czech language thats why I changed text to “Some random text“

    – Petr Hrobař
    4 hours ago











  • Why did you delete the image? It would be helpful to understand your question. I took the liberty and added it again and please have a look to my answer, does it help you?

    – Kurt
    3 hours ago


















1















I´m writting my work and for some reasone my pseudocode in final pdf cannot be formated:



enter image description here



Mistake report is this:
enter image description here



The code I'm using:



documentclass[11pt,a4paper,openright]{report}
letopenright=cleardoublepage
usepackage[czech]{babel}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{textcomp}
usepackage[utf8]{inputenc}
usepackage{algorithm}% http://ctan.org/pkg/algorithm
usepackage{algpseudocode}
%%% Další užitečné balíčky (jsou součástí běžných distribucí LaTeXu)
usepackage{amsmath} % rozšíření pro sazbu matematiky
usepackage{amsfonts} % matematické fonty
usepackage{amsthm} % sazba vět, definic apod.
usepackage{bm} % tučné symboly (příkaz bm)
usepackage{graphicx} % vkládání obrázků
usepackage{fancyvrb} % vylepšené prostředí pro strojové usepackage{algorithm}
usepackage{algpseudocode}
usepackage{fancyhdr} % prostředí pohodlnější nastavení hlavy a paty stránek
usepackage{icomma} % inteligetní čárka v matematickém módu
usepackage{dcolumn} % lepší zarovnání sloupců v tabulkách
usepackage{booktabs} % lepší vodorovné linky v tabulkách
makeatletter
@ifpackageloaded{xcolor}{
@ifpackagewith{xcolor}{usenames}{}{PassOptionsToPackage{usenames}{xcolor}}
}{usepackage[usenames]{xcolor}} % barevná sazba
makeatother
usepackage{multicol} % práce s více sloupci na stránce
usepackage{caption}
usepackage{enumitem}


subsubsection{Vytváření clusterů}
begin{algorithm}
caption{Určení sousedících clusterů}
begin{algorithmic}[1]
For {$a, b in C$}
State předpokládej, že $a, b$ jsou sousedící
For {$k, l in C$ a $k, lneq a, b$}
If {$P_a P_b cap P_k P_l neqemptyset$}
State $a, b$ nejsou sousedící clustery
Else
If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$}
State $a, b$ nejsou sousedící clustery
EndIf
EndIf
EndFor
EndFor
end{algorithmic}
end{algorithm}









share|improve this question









New contributor




Petr Hrobař is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • How should we be able to help you without seeing the used code? Please -- as usual here -- add a short compilable tex code resulting in your screenshot to your question!

    – Kurt
    4 hours ago











  • random text: begin{algorithm} caption{Určení sousedících clusterů} begin{algorithmic}[1] For {$a, b in C$} State předpokládej, že $a, b$ jsou sousedící For {$k, l in C$ a $k, lneq a, b$} If {$P_a P_b cap P_k P_l neqemptyset$} State $a, b$ nejsou sousedící clustery Else If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$} State $a, b$ nejsou sousedící clustery EndIf EndIf EndFor EndFor end{algorithmic} end{algorithm} Another random text

    – Petr Hrobař
    4 hours ago











  • Please edit your question and add an compilable minimal working example (MWE) . Then we do not have to guess what you are doing ... Code in comment is not really helpful, for example the line breaks are missing!

    – Kurt
    4 hours ago













  • i´m writting it in czech language thats why I changed text to “Some random text“

    – Petr Hrobař
    4 hours ago











  • Why did you delete the image? It would be helpful to understand your question. I took the liberty and added it again and please have a look to my answer, does it help you?

    – Kurt
    3 hours ago
















1












1








1








I´m writting my work and for some reasone my pseudocode in final pdf cannot be formated:



enter image description here



Mistake report is this:
enter image description here



The code I'm using:



documentclass[11pt,a4paper,openright]{report}
letopenright=cleardoublepage
usepackage[czech]{babel}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{textcomp}
usepackage[utf8]{inputenc}
usepackage{algorithm}% http://ctan.org/pkg/algorithm
usepackage{algpseudocode}
%%% Další užitečné balíčky (jsou součástí běžných distribucí LaTeXu)
usepackage{amsmath} % rozšíření pro sazbu matematiky
usepackage{amsfonts} % matematické fonty
usepackage{amsthm} % sazba vět, definic apod.
usepackage{bm} % tučné symboly (příkaz bm)
usepackage{graphicx} % vkládání obrázků
usepackage{fancyvrb} % vylepšené prostředí pro strojové usepackage{algorithm}
usepackage{algpseudocode}
usepackage{fancyhdr} % prostředí pohodlnější nastavení hlavy a paty stránek
usepackage{icomma} % inteligetní čárka v matematickém módu
usepackage{dcolumn} % lepší zarovnání sloupců v tabulkách
usepackage{booktabs} % lepší vodorovné linky v tabulkách
makeatletter
@ifpackageloaded{xcolor}{
@ifpackagewith{xcolor}{usenames}{}{PassOptionsToPackage{usenames}{xcolor}}
}{usepackage[usenames]{xcolor}} % barevná sazba
makeatother
usepackage{multicol} % práce s více sloupci na stránce
usepackage{caption}
usepackage{enumitem}


subsubsection{Vytváření clusterů}
begin{algorithm}
caption{Určení sousedících clusterů}
begin{algorithmic}[1]
For {$a, b in C$}
State předpokládej, že $a, b$ jsou sousedící
For {$k, l in C$ a $k, lneq a, b$}
If {$P_a P_b cap P_k P_l neqemptyset$}
State $a, b$ nejsou sousedící clustery
Else
If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$}
State $a, b$ nejsou sousedící clustery
EndIf
EndIf
EndFor
EndFor
end{algorithmic}
end{algorithm}









share|improve this question









New contributor




Petr Hrobař is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I´m writting my work and for some reasone my pseudocode in final pdf cannot be formated:



enter image description here



Mistake report is this:
enter image description here



The code I'm using:



documentclass[11pt,a4paper,openright]{report}
letopenright=cleardoublepage
usepackage[czech]{babel}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{textcomp}
usepackage[utf8]{inputenc}
usepackage{algorithm}% http://ctan.org/pkg/algorithm
usepackage{algpseudocode}
%%% Další užitečné balíčky (jsou součástí běžných distribucí LaTeXu)
usepackage{amsmath} % rozšíření pro sazbu matematiky
usepackage{amsfonts} % matematické fonty
usepackage{amsthm} % sazba vět, definic apod.
usepackage{bm} % tučné symboly (příkaz bm)
usepackage{graphicx} % vkládání obrázků
usepackage{fancyvrb} % vylepšené prostředí pro strojové usepackage{algorithm}
usepackage{algpseudocode}
usepackage{fancyhdr} % prostředí pohodlnější nastavení hlavy a paty stránek
usepackage{icomma} % inteligetní čárka v matematickém módu
usepackage{dcolumn} % lepší zarovnání sloupců v tabulkách
usepackage{booktabs} % lepší vodorovné linky v tabulkách
makeatletter
@ifpackageloaded{xcolor}{
@ifpackagewith{xcolor}{usenames}{}{PassOptionsToPackage{usenames}{xcolor}}
}{usepackage[usenames]{xcolor}} % barevná sazba
makeatother
usepackage{multicol} % práce s více sloupci na stránce
usepackage{caption}
usepackage{enumitem}


subsubsection{Vytváření clusterů}
begin{algorithm}
caption{Určení sousedících clusterů}
begin{algorithmic}[1]
For {$a, b in C$}
State předpokládej, že $a, b$ jsou sousedící
For {$k, l in C$ a $k, lneq a, b$}
If {$P_a P_b cap P_k P_l neqemptyset$}
State $a, b$ nejsou sousedící clustery
Else
If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$}
State $a, b$ nejsou sousedící clustery
EndIf
EndIf
EndFor
EndFor
end{algorithmic}
end{algorithm}






biblatex






share|improve this question









New contributor




Petr Hrobař is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Petr Hrobař is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 3 hours ago









Kurt

39.8k850164




39.8k850164






New contributor




Petr Hrobař is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 4 hours ago









Petr HrobařPetr Hrobař

112




112




New contributor




Petr Hrobař is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Petr Hrobař is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Petr Hrobař is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • How should we be able to help you without seeing the used code? Please -- as usual here -- add a short compilable tex code resulting in your screenshot to your question!

    – Kurt
    4 hours ago











  • random text: begin{algorithm} caption{Určení sousedících clusterů} begin{algorithmic}[1] For {$a, b in C$} State předpokládej, že $a, b$ jsou sousedící For {$k, l in C$ a $k, lneq a, b$} If {$P_a P_b cap P_k P_l neqemptyset$} State $a, b$ nejsou sousedící clustery Else If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$} State $a, b$ nejsou sousedící clustery EndIf EndIf EndFor EndFor end{algorithmic} end{algorithm} Another random text

    – Petr Hrobař
    4 hours ago











  • Please edit your question and add an compilable minimal working example (MWE) . Then we do not have to guess what you are doing ... Code in comment is not really helpful, for example the line breaks are missing!

    – Kurt
    4 hours ago













  • i´m writting it in czech language thats why I changed text to “Some random text“

    – Petr Hrobař
    4 hours ago











  • Why did you delete the image? It would be helpful to understand your question. I took the liberty and added it again and please have a look to my answer, does it help you?

    – Kurt
    3 hours ago





















  • How should we be able to help you without seeing the used code? Please -- as usual here -- add a short compilable tex code resulting in your screenshot to your question!

    – Kurt
    4 hours ago











  • random text: begin{algorithm} caption{Určení sousedících clusterů} begin{algorithmic}[1] For {$a, b in C$} State předpokládej, že $a, b$ jsou sousedící For {$k, l in C$ a $k, lneq a, b$} If {$P_a P_b cap P_k P_l neqemptyset$} State $a, b$ nejsou sousedící clustery Else If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$} State $a, b$ nejsou sousedící clustery EndIf EndIf EndFor EndFor end{algorithmic} end{algorithm} Another random text

    – Petr Hrobař
    4 hours ago











  • Please edit your question and add an compilable minimal working example (MWE) . Then we do not have to guess what you are doing ... Code in comment is not really helpful, for example the line breaks are missing!

    – Kurt
    4 hours ago













  • i´m writting it in czech language thats why I changed text to “Some random text“

    – Petr Hrobař
    4 hours ago











  • Why did you delete the image? It would be helpful to understand your question. I took the liberty and added it again and please have a look to my answer, does it help you?

    – Kurt
    3 hours ago



















How should we be able to help you without seeing the used code? Please -- as usual here -- add a short compilable tex code resulting in your screenshot to your question!

– Kurt
4 hours ago





How should we be able to help you without seeing the used code? Please -- as usual here -- add a short compilable tex code resulting in your screenshot to your question!

– Kurt
4 hours ago













random text: begin{algorithm} caption{Určení sousedících clusterů} begin{algorithmic}[1] For {$a, b in C$} State předpokládej, že $a, b$ jsou sousedící For {$k, l in C$ a $k, lneq a, b$} If {$P_a P_b cap P_k P_l neqemptyset$} State $a, b$ nejsou sousedící clustery Else If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$} State $a, b$ nejsou sousedící clustery EndIf EndIf EndFor EndFor end{algorithmic} end{algorithm} Another random text

– Petr Hrobař
4 hours ago





random text: begin{algorithm} caption{Určení sousedících clusterů} begin{algorithmic}[1] For {$a, b in C$} State předpokládej, že $a, b$ jsou sousedící For {$k, l in C$ a $k, lneq a, b$} If {$P_a P_b cap P_k P_l neqemptyset$} State $a, b$ nejsou sousedící clustery Else If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$} State $a, b$ nejsou sousedící clustery EndIf EndIf EndFor EndFor end{algorithmic} end{algorithm} Another random text

– Petr Hrobař
4 hours ago













Please edit your question and add an compilable minimal working example (MWE) . Then we do not have to guess what you are doing ... Code in comment is not really helpful, for example the line breaks are missing!

– Kurt
4 hours ago







Please edit your question and add an compilable minimal working example (MWE) . Then we do not have to guess what you are doing ... Code in comment is not really helpful, for example the line breaks are missing!

– Kurt
4 hours ago















i´m writting it in czech language thats why I changed text to “Some random text“

– Petr Hrobař
4 hours ago





i´m writting it in czech language thats why I changed text to “Some random text“

– Petr Hrobař
4 hours ago













Why did you delete the image? It would be helpful to understand your question. I took the liberty and added it again and please have a look to my answer, does it help you?

– Kurt
3 hours ago







Why did you delete the image? It would be helpful to understand your question. I took the liberty and added it again and please have a look to my answer, does it help you?

– Kurt
3 hours ago












1 Answer
1






active

oldest

votes


















0














Well, in your code still begin{document} and end{document is missing to be compilable :-) I added them in the following MWE.



The culprit is the following line in your code



If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$}
% ^ ^ ^


I changed to



If {$|P_a P_b| geq textbf{E}_{r in c} |P_a P_r|$}
% ^ ^ ^ ^ ^


You can not nest _ as you did in your line and I moved the first $ to be before |.



With the following complete code



documentclass[11pt,a4paper,openright]{report}

letopenright=cleardoublepage
usepackage[czech]{babel}
usepackage{lmodern}
usepackage[T1]{fontenc}
usepackage{textcomp}
usepackage[utf8]{inputenc}
usepackage{algorithm}% http://ctan.org/pkg/algorithm
usepackage{algpseudocode}
%%% Další užitečné balíčky (jsou součástí běžných distribucí LaTeXu)
usepackage{amsmath} % rozšíření pro sazbu matematiky
usepackage{amsfonts} % matematické fonty
usepackage{amsthm} % sazba vět, definic apod.
usepackage{bm} % tučné symboly (příkaz bm)
usepackage{graphicx} % vkládání obrázků
usepackage{fancyvrb} % vylepšené prostředí pro strojové usepackage{algorithm}
usepackage{algpseudocode}
usepackage{fancyhdr} % prostředí pohodlnější nastavení hlavy a paty stránek
usepackage{icomma} % inteligetní čárka v matematickém módu
usepackage{dcolumn} % lepší zarovnání sloupců v tabulkách
usepackage{booktabs} % lepší vodorovné linky v tabulkách
makeatletter
@ifpackageloaded{xcolor}{
@ifpackagewith{xcolor}{usenames}{}{PassOptionsToPackage{usenames}{xcolor}}
}{usepackage[usenames]{xcolor}} % barevná sazba
makeatother
usepackage{multicol} % práce s více sloupci na stránce
usepackage{caption}
usepackage{enumitem}


begin{document}

subsubsection{Vytváření clusterů}
begin{algorithm}
caption{Určení sousedících clusterů}
begin{algorithmic}[1]
For {$a, b in C$}
State předpokládej, že $a, b$ jsou sousedící
For {$k, l in C$ a $k, lneq a, b$}
If {$P_a P_b cap P_k P_l neqemptyset$}
State $a, b$ nejsou sousedící clustery
Else
If {$|P_a P_b| geq textbf{E}_{r in c} |P_a P_r|$} % <===============
State $a, b$ nejsou sousedící clustery
EndIf
EndIf
EndFor
EndFor
end{algorithmic}
end{algorithm}

end{document}


I get



enter image description here



Please correct the used mathematic to what you realy need.






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
    });


    }
    });






    Petr Hrobař is a new contributor. Be nice, and check out our Code of Conduct.










    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480578%2fpseudocode-in-latex-cannot-be-formated%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














    Well, in your code still begin{document} and end{document is missing to be compilable :-) I added them in the following MWE.



    The culprit is the following line in your code



    If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$}
    % ^ ^ ^


    I changed to



    If {$|P_a P_b| geq textbf{E}_{r in c} |P_a P_r|$}
    % ^ ^ ^ ^ ^


    You can not nest _ as you did in your line and I moved the first $ to be before |.



    With the following complete code



    documentclass[11pt,a4paper,openright]{report}

    letopenright=cleardoublepage
    usepackage[czech]{babel}
    usepackage{lmodern}
    usepackage[T1]{fontenc}
    usepackage{textcomp}
    usepackage[utf8]{inputenc}
    usepackage{algorithm}% http://ctan.org/pkg/algorithm
    usepackage{algpseudocode}
    %%% Další užitečné balíčky (jsou součástí běžných distribucí LaTeXu)
    usepackage{amsmath} % rozšíření pro sazbu matematiky
    usepackage{amsfonts} % matematické fonty
    usepackage{amsthm} % sazba vět, definic apod.
    usepackage{bm} % tučné symboly (příkaz bm)
    usepackage{graphicx} % vkládání obrázků
    usepackage{fancyvrb} % vylepšené prostředí pro strojové usepackage{algorithm}
    usepackage{algpseudocode}
    usepackage{fancyhdr} % prostředí pohodlnější nastavení hlavy a paty stránek
    usepackage{icomma} % inteligetní čárka v matematickém módu
    usepackage{dcolumn} % lepší zarovnání sloupců v tabulkách
    usepackage{booktabs} % lepší vodorovné linky v tabulkách
    makeatletter
    @ifpackageloaded{xcolor}{
    @ifpackagewith{xcolor}{usenames}{}{PassOptionsToPackage{usenames}{xcolor}}
    }{usepackage[usenames]{xcolor}} % barevná sazba
    makeatother
    usepackage{multicol} % práce s více sloupci na stránce
    usepackage{caption}
    usepackage{enumitem}


    begin{document}

    subsubsection{Vytváření clusterů}
    begin{algorithm}
    caption{Určení sousedících clusterů}
    begin{algorithmic}[1]
    For {$a, b in C$}
    State předpokládej, že $a, b$ jsou sousedící
    For {$k, l in C$ a $k, lneq a, b$}
    If {$P_a P_b cap P_k P_l neqemptyset$}
    State $a, b$ nejsou sousedící clustery
    Else
    If {$|P_a P_b| geq textbf{E}_{r in c} |P_a P_r|$} % <===============
    State $a, b$ nejsou sousedící clustery
    EndIf
    EndIf
    EndFor
    EndFor
    end{algorithmic}
    end{algorithm}

    end{document}


    I get



    enter image description here



    Please correct the used mathematic to what you realy need.






    share|improve this answer




























      0














      Well, in your code still begin{document} and end{document is missing to be compilable :-) I added them in the following MWE.



      The culprit is the following line in your code



      If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$}
      % ^ ^ ^


      I changed to



      If {$|P_a P_b| geq textbf{E}_{r in c} |P_a P_r|$}
      % ^ ^ ^ ^ ^


      You can not nest _ as you did in your line and I moved the first $ to be before |.



      With the following complete code



      documentclass[11pt,a4paper,openright]{report}

      letopenright=cleardoublepage
      usepackage[czech]{babel}
      usepackage{lmodern}
      usepackage[T1]{fontenc}
      usepackage{textcomp}
      usepackage[utf8]{inputenc}
      usepackage{algorithm}% http://ctan.org/pkg/algorithm
      usepackage{algpseudocode}
      %%% Další užitečné balíčky (jsou součástí běžných distribucí LaTeXu)
      usepackage{amsmath} % rozšíření pro sazbu matematiky
      usepackage{amsfonts} % matematické fonty
      usepackage{amsthm} % sazba vět, definic apod.
      usepackage{bm} % tučné symboly (příkaz bm)
      usepackage{graphicx} % vkládání obrázků
      usepackage{fancyvrb} % vylepšené prostředí pro strojové usepackage{algorithm}
      usepackage{algpseudocode}
      usepackage{fancyhdr} % prostředí pohodlnější nastavení hlavy a paty stránek
      usepackage{icomma} % inteligetní čárka v matematickém módu
      usepackage{dcolumn} % lepší zarovnání sloupců v tabulkách
      usepackage{booktabs} % lepší vodorovné linky v tabulkách
      makeatletter
      @ifpackageloaded{xcolor}{
      @ifpackagewith{xcolor}{usenames}{}{PassOptionsToPackage{usenames}{xcolor}}
      }{usepackage[usenames]{xcolor}} % barevná sazba
      makeatother
      usepackage{multicol} % práce s více sloupci na stránce
      usepackage{caption}
      usepackage{enumitem}


      begin{document}

      subsubsection{Vytváření clusterů}
      begin{algorithm}
      caption{Určení sousedících clusterů}
      begin{algorithmic}[1]
      For {$a, b in C$}
      State předpokládej, že $a, b$ jsou sousedící
      For {$k, l in C$ a $k, lneq a, b$}
      If {$P_a P_b cap P_k P_l neqemptyset$}
      State $a, b$ nejsou sousedící clustery
      Else
      If {$|P_a P_b| geq textbf{E}_{r in c} |P_a P_r|$} % <===============
      State $a, b$ nejsou sousedící clustery
      EndIf
      EndIf
      EndFor
      EndFor
      end{algorithmic}
      end{algorithm}

      end{document}


      I get



      enter image description here



      Please correct the used mathematic to what you realy need.






      share|improve this answer


























        0












        0








        0







        Well, in your code still begin{document} and end{document is missing to be compilable :-) I added them in the following MWE.



        The culprit is the following line in your code



        If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$}
        % ^ ^ ^


        I changed to



        If {$|P_a P_b| geq textbf{E}_{r in c} |P_a P_r|$}
        % ^ ^ ^ ^ ^


        You can not nest _ as you did in your line and I moved the first $ to be before |.



        With the following complete code



        documentclass[11pt,a4paper,openright]{report}

        letopenright=cleardoublepage
        usepackage[czech]{babel}
        usepackage{lmodern}
        usepackage[T1]{fontenc}
        usepackage{textcomp}
        usepackage[utf8]{inputenc}
        usepackage{algorithm}% http://ctan.org/pkg/algorithm
        usepackage{algpseudocode}
        %%% Další užitečné balíčky (jsou součástí běžných distribucí LaTeXu)
        usepackage{amsmath} % rozšíření pro sazbu matematiky
        usepackage{amsfonts} % matematické fonty
        usepackage{amsthm} % sazba vět, definic apod.
        usepackage{bm} % tučné symboly (příkaz bm)
        usepackage{graphicx} % vkládání obrázků
        usepackage{fancyvrb} % vylepšené prostředí pro strojové usepackage{algorithm}
        usepackage{algpseudocode}
        usepackage{fancyhdr} % prostředí pohodlnější nastavení hlavy a paty stránek
        usepackage{icomma} % inteligetní čárka v matematickém módu
        usepackage{dcolumn} % lepší zarovnání sloupců v tabulkách
        usepackage{booktabs} % lepší vodorovné linky v tabulkách
        makeatletter
        @ifpackageloaded{xcolor}{
        @ifpackagewith{xcolor}{usenames}{}{PassOptionsToPackage{usenames}{xcolor}}
        }{usepackage[usenames]{xcolor}} % barevná sazba
        makeatother
        usepackage{multicol} % práce s více sloupci na stránce
        usepackage{caption}
        usepackage{enumitem}


        begin{document}

        subsubsection{Vytváření clusterů}
        begin{algorithm}
        caption{Určení sousedících clusterů}
        begin{algorithmic}[1]
        For {$a, b in C$}
        State předpokládej, že $a, b$ jsou sousedící
        For {$k, l in C$ a $k, lneq a, b$}
        If {$P_a P_b cap P_k P_l neqemptyset$}
        State $a, b$ nejsou sousedící clustery
        Else
        If {$|P_a P_b| geq textbf{E}_{r in c} |P_a P_r|$} % <===============
        State $a, b$ nejsou sousedící clustery
        EndIf
        EndIf
        EndFor
        EndFor
        end{algorithmic}
        end{algorithm}

        end{document}


        I get



        enter image description here



        Please correct the used mathematic to what you realy need.






        share|improve this answer













        Well, in your code still begin{document} and end{document is missing to be compilable :-) I added them in the following MWE.



        The culprit is the following line in your code



        If {|$P_a P_b|geq textbf{E}_r_in_c|P_a P_r|$}
        % ^ ^ ^


        I changed to



        If {$|P_a P_b| geq textbf{E}_{r in c} |P_a P_r|$}
        % ^ ^ ^ ^ ^


        You can not nest _ as you did in your line and I moved the first $ to be before |.



        With the following complete code



        documentclass[11pt,a4paper,openright]{report}

        letopenright=cleardoublepage
        usepackage[czech]{babel}
        usepackage{lmodern}
        usepackage[T1]{fontenc}
        usepackage{textcomp}
        usepackage[utf8]{inputenc}
        usepackage{algorithm}% http://ctan.org/pkg/algorithm
        usepackage{algpseudocode}
        %%% Další užitečné balíčky (jsou součástí běžných distribucí LaTeXu)
        usepackage{amsmath} % rozšíření pro sazbu matematiky
        usepackage{amsfonts} % matematické fonty
        usepackage{amsthm} % sazba vět, definic apod.
        usepackage{bm} % tučné symboly (příkaz bm)
        usepackage{graphicx} % vkládání obrázků
        usepackage{fancyvrb} % vylepšené prostředí pro strojové usepackage{algorithm}
        usepackage{algpseudocode}
        usepackage{fancyhdr} % prostředí pohodlnější nastavení hlavy a paty stránek
        usepackage{icomma} % inteligetní čárka v matematickém módu
        usepackage{dcolumn} % lepší zarovnání sloupců v tabulkách
        usepackage{booktabs} % lepší vodorovné linky v tabulkách
        makeatletter
        @ifpackageloaded{xcolor}{
        @ifpackagewith{xcolor}{usenames}{}{PassOptionsToPackage{usenames}{xcolor}}
        }{usepackage[usenames]{xcolor}} % barevná sazba
        makeatother
        usepackage{multicol} % práce s více sloupci na stránce
        usepackage{caption}
        usepackage{enumitem}


        begin{document}

        subsubsection{Vytváření clusterů}
        begin{algorithm}
        caption{Určení sousedících clusterů}
        begin{algorithmic}[1]
        For {$a, b in C$}
        State předpokládej, že $a, b$ jsou sousedící
        For {$k, l in C$ a $k, lneq a, b$}
        If {$P_a P_b cap P_k P_l neqemptyset$}
        State $a, b$ nejsou sousedící clustery
        Else
        If {$|P_a P_b| geq textbf{E}_{r in c} |P_a P_r|$} % <===============
        State $a, b$ nejsou sousedící clustery
        EndIf
        EndIf
        EndFor
        EndFor
        end{algorithmic}
        end{algorithm}

        end{document}


        I get



        enter image description here



        Please correct the used mathematic to what you realy need.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 3 hours ago









        KurtKurt

        39.8k850164




        39.8k850164






















            Petr Hrobař is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            Petr Hrobař is a new contributor. Be nice, and check out our Code of Conduct.













            Petr Hrobař is a new contributor. Be nice, and check out our Code of Conduct.












            Petr Hrobař is a new contributor. Be nice, and check out our Code of Conduct.
















            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%2f480578%2fpseudocode-in-latex-cannot-be-formated%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

            Contact image not getting when fetch all contact list from iPhone by CNContact

            count number of partitions of a set with n elements into k subsets

            A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks