How to compress algorithm in a beamer presentation?












0















I have written one algorithm in a beamer class by using a package usepackage[linesnumbered, ruled,vlined]{algorithm2e}. It is taking the whole slide, I have tried to fit it into a small minpage but it is not working.



Is there any way to compress an algorithm in a beamer class. I can't share my algorithm.



documentclass{beamer}
usepackage[linesnumbered,ruled,vlined]{algorithm2e}
usepackage{caption}
usepackage{xcolor}
usepackage{array}
begin{document}

date{today}

frame{titlepage}

frame{frametitle{Table of contents}tableofcontents}


section{Section no.1}
frame{frametitle{dwd}

begin{center}
begin{minipage}{1linewidth}
begin{algorithm}[H]
SetAlgoLined
textbf{Input} : A graph $(G)$;
textbf{Decide} : Is $G$ a random ? \
vspace{0.3cm}

If $X$ then stop and play and dance random ;
$S = {g in G }$;
Pick sdy $g in P $;
Find n elemen. If exits then returno ``Not sonian '';

If{$X$}{
Compute a lower and upper $L$ of $X$ in $G$;\

If{$X$ exists and is fumbling lelal -grou}{

return $zZ$;
}
}

Else{
return ``Not truein life'';
}

caption{Algorithm}
label{algofinite}
end{algorithm}
end{minipage}
end{center}

}


end{document}









share|improve this question




















  • 1





    It would be helpful if you composed a fully compilable minimal working example (MWE) including documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.

    – samcarter
    Jan 17 at 16:40











  • I will not able to share more of my code sorry.

    – Isla_Bonita
    Jan 17 at 16:48













  • The content of your algorithm does not matter, you could just make up some random algorithm that demonstrates your problem. The important point is to show use a small but compilable latex document that allows us to reproduce your problem.

    – samcarter
    Jan 17 at 16:52
















0















I have written one algorithm in a beamer class by using a package usepackage[linesnumbered, ruled,vlined]{algorithm2e}. It is taking the whole slide, I have tried to fit it into a small minpage but it is not working.



Is there any way to compress an algorithm in a beamer class. I can't share my algorithm.



documentclass{beamer}
usepackage[linesnumbered,ruled,vlined]{algorithm2e}
usepackage{caption}
usepackage{xcolor}
usepackage{array}
begin{document}

date{today}

frame{titlepage}

frame{frametitle{Table of contents}tableofcontents}


section{Section no.1}
frame{frametitle{dwd}

begin{center}
begin{minipage}{1linewidth}
begin{algorithm}[H]
SetAlgoLined
textbf{Input} : A graph $(G)$;
textbf{Decide} : Is $G$ a random ? \
vspace{0.3cm}

If $X$ then stop and play and dance random ;
$S = {g in G }$;
Pick sdy $g in P $;
Find n elemen. If exits then returno ``Not sonian '';

If{$X$}{
Compute a lower and upper $L$ of $X$ in $G$;\

If{$X$ exists and is fumbling lelal -grou}{

return $zZ$;
}
}

Else{
return ``Not truein life'';
}

caption{Algorithm}
label{algofinite}
end{algorithm}
end{minipage}
end{center}

}


end{document}









share|improve this question




















  • 1





    It would be helpful if you composed a fully compilable minimal working example (MWE) including documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.

    – samcarter
    Jan 17 at 16:40











  • I will not able to share more of my code sorry.

    – Isla_Bonita
    Jan 17 at 16:48













  • The content of your algorithm does not matter, you could just make up some random algorithm that demonstrates your problem. The important point is to show use a small but compilable latex document that allows us to reproduce your problem.

    – samcarter
    Jan 17 at 16:52














0












0








0








I have written one algorithm in a beamer class by using a package usepackage[linesnumbered, ruled,vlined]{algorithm2e}. It is taking the whole slide, I have tried to fit it into a small minpage but it is not working.



Is there any way to compress an algorithm in a beamer class. I can't share my algorithm.



documentclass{beamer}
usepackage[linesnumbered,ruled,vlined]{algorithm2e}
usepackage{caption}
usepackage{xcolor}
usepackage{array}
begin{document}

date{today}

frame{titlepage}

frame{frametitle{Table of contents}tableofcontents}


section{Section no.1}
frame{frametitle{dwd}

begin{center}
begin{minipage}{1linewidth}
begin{algorithm}[H]
SetAlgoLined
textbf{Input} : A graph $(G)$;
textbf{Decide} : Is $G$ a random ? \
vspace{0.3cm}

If $X$ then stop and play and dance random ;
$S = {g in G }$;
Pick sdy $g in P $;
Find n elemen. If exits then returno ``Not sonian '';

If{$X$}{
Compute a lower and upper $L$ of $X$ in $G$;\

If{$X$ exists and is fumbling lelal -grou}{

return $zZ$;
}
}

Else{
return ``Not truein life'';
}

caption{Algorithm}
label{algofinite}
end{algorithm}
end{minipage}
end{center}

}


end{document}









share|improve this question
















I have written one algorithm in a beamer class by using a package usepackage[linesnumbered, ruled,vlined]{algorithm2e}. It is taking the whole slide, I have tried to fit it into a small minpage but it is not working.



Is there any way to compress an algorithm in a beamer class. I can't share my algorithm.



documentclass{beamer}
usepackage[linesnumbered,ruled,vlined]{algorithm2e}
usepackage{caption}
usepackage{xcolor}
usepackage{array}
begin{document}

date{today}

frame{titlepage}

frame{frametitle{Table of contents}tableofcontents}


section{Section no.1}
frame{frametitle{dwd}

begin{center}
begin{minipage}{1linewidth}
begin{algorithm}[H]
SetAlgoLined
textbf{Input} : A graph $(G)$;
textbf{Decide} : Is $G$ a random ? \
vspace{0.3cm}

If $X$ then stop and play and dance random ;
$S = {g in G }$;
Pick sdy $g in P $;
Find n elemen. If exits then returno ``Not sonian '';

If{$X$}{
Compute a lower and upper $L$ of $X$ in $G$;\

If{$X$ exists and is fumbling lelal -grou}{

return $zZ$;
}
}

Else{
return ``Not truein life'';
}

caption{Algorithm}
label{algofinite}
end{algorithm}
end{minipage}
end{center}

}


end{document}






beamer algorithms






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 17 at 17:34









samcarter

88k797281




88k797281










asked Jan 17 at 16:38









Isla_BonitaIsla_Bonita

1825




1825








  • 1





    It would be helpful if you composed a fully compilable minimal working example (MWE) including documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.

    – samcarter
    Jan 17 at 16:40











  • I will not able to share more of my code sorry.

    – Isla_Bonita
    Jan 17 at 16:48













  • The content of your algorithm does not matter, you could just make up some random algorithm that demonstrates your problem. The important point is to show use a small but compilable latex document that allows us to reproduce your problem.

    – samcarter
    Jan 17 at 16:52














  • 1





    It would be helpful if you composed a fully compilable minimal working example (MWE) including documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.

    – samcarter
    Jan 17 at 16:40











  • I will not able to share more of my code sorry.

    – Isla_Bonita
    Jan 17 at 16:48













  • The content of your algorithm does not matter, you could just make up some random algorithm that demonstrates your problem. The important point is to show use a small but compilable latex document that allows us to reproduce your problem.

    – samcarter
    Jan 17 at 16:52








1




1





It would be helpful if you composed a fully compilable minimal working example (MWE) including documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.

– samcarter
Jan 17 at 16:40





It would be helpful if you composed a fully compilable minimal working example (MWE) including documentclass and the appropriate packages that sets up the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem.

– samcarter
Jan 17 at 16:40













I will not able to share more of my code sorry.

– Isla_Bonita
Jan 17 at 16:48







I will not able to share more of my code sorry.

– Isla_Bonita
Jan 17 at 16:48















The content of your algorithm does not matter, you could just make up some random algorithm that demonstrates your problem. The important point is to show use a small but compilable latex document that allows us to reproduce your problem.

– samcarter
Jan 17 at 16:52





The content of your algorithm does not matter, you could just make up some random algorithm that demonstrates your problem. The important point is to show use a small but compilable latex document that allows us to reproduce your problem.

– samcarter
Jan 17 at 16:52










1 Answer
1






active

oldest

votes


















2














I suggest to use a smaller fonts size to fit the algorithm into the frame. If small is not enough and you are really desperate, try foototesize, scriptsize, tiny or Tiny



Some other comments:




  • you don't need to load the xcolor package with beamer


  • remove the center environment. It has no effect on content that spans over the whole text width, like your algorithm and just adds even more vertical spacing around which makes your problem worse


  • instead of frame{} better use the begin{frame}....end{frame} syntax





documentclass{beamer}
usepackage[linesnumbered,ruled,vlined]{algorithm2e}
usepackage{caption}
%usepackage{xcolor}
usepackage{array}
begin{document}

%date{today}

begin{frame}
frametitle{dwd}

begingroup
small
%begin{center}
%begin{minipage}{1linewidth}
begin{algorithm}[H]
SetAlgoLined
textbf{Input} : A graph $(G)$;
textbf{Decide} : Is $G$ a random ? \
vspace{0.3cm}

If $X$ then stop and play and dance random ;
$S = {g in G }$;
Pick sdy $g in P $;
Find n elemen. If exits then report ``Not sonian '';

If{$X$}{
Compute a lower and upper $L$ of $X$ in $G$;\

If{$X$ exists and is fumbling lelal -grou}{

return $zZ$;
}
}

Else{
return ``Not truein life'';
}

caption{Algorithm}
label{algo6}
end{algorithm}
%end{minipage}
%end{center}
endgroup

end{frame}


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%2f470564%2fhow-to-compress-algorithm-in-a-beamer-presentation%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









    2














    I suggest to use a smaller fonts size to fit the algorithm into the frame. If small is not enough and you are really desperate, try foototesize, scriptsize, tiny or Tiny



    Some other comments:




    • you don't need to load the xcolor package with beamer


    • remove the center environment. It has no effect on content that spans over the whole text width, like your algorithm and just adds even more vertical spacing around which makes your problem worse


    • instead of frame{} better use the begin{frame}....end{frame} syntax





    documentclass{beamer}
    usepackage[linesnumbered,ruled,vlined]{algorithm2e}
    usepackage{caption}
    %usepackage{xcolor}
    usepackage{array}
    begin{document}

    %date{today}

    begin{frame}
    frametitle{dwd}

    begingroup
    small
    %begin{center}
    %begin{minipage}{1linewidth}
    begin{algorithm}[H]
    SetAlgoLined
    textbf{Input} : A graph $(G)$;
    textbf{Decide} : Is $G$ a random ? \
    vspace{0.3cm}

    If $X$ then stop and play and dance random ;
    $S = {g in G }$;
    Pick sdy $g in P $;
    Find n elemen. If exits then report ``Not sonian '';

    If{$X$}{
    Compute a lower and upper $L$ of $X$ in $G$;\

    If{$X$ exists and is fumbling lelal -grou}{

    return $zZ$;
    }
    }

    Else{
    return ``Not truein life'';
    }

    caption{Algorithm}
    label{algo6}
    end{algorithm}
    %end{minipage}
    %end{center}
    endgroup

    end{frame}


    end{document}


    enter image description here






    share|improve this answer




























      2














      I suggest to use a smaller fonts size to fit the algorithm into the frame. If small is not enough and you are really desperate, try foototesize, scriptsize, tiny or Tiny



      Some other comments:




      • you don't need to load the xcolor package with beamer


      • remove the center environment. It has no effect on content that spans over the whole text width, like your algorithm and just adds even more vertical spacing around which makes your problem worse


      • instead of frame{} better use the begin{frame}....end{frame} syntax





      documentclass{beamer}
      usepackage[linesnumbered,ruled,vlined]{algorithm2e}
      usepackage{caption}
      %usepackage{xcolor}
      usepackage{array}
      begin{document}

      %date{today}

      begin{frame}
      frametitle{dwd}

      begingroup
      small
      %begin{center}
      %begin{minipage}{1linewidth}
      begin{algorithm}[H]
      SetAlgoLined
      textbf{Input} : A graph $(G)$;
      textbf{Decide} : Is $G$ a random ? \
      vspace{0.3cm}

      If $X$ then stop and play and dance random ;
      $S = {g in G }$;
      Pick sdy $g in P $;
      Find n elemen. If exits then report ``Not sonian '';

      If{$X$}{
      Compute a lower and upper $L$ of $X$ in $G$;\

      If{$X$ exists and is fumbling lelal -grou}{

      return $zZ$;
      }
      }

      Else{
      return ``Not truein life'';
      }

      caption{Algorithm}
      label{algo6}
      end{algorithm}
      %end{minipage}
      %end{center}
      endgroup

      end{frame}


      end{document}


      enter image description here






      share|improve this answer


























        2












        2








        2







        I suggest to use a smaller fonts size to fit the algorithm into the frame. If small is not enough and you are really desperate, try foototesize, scriptsize, tiny or Tiny



        Some other comments:




        • you don't need to load the xcolor package with beamer


        • remove the center environment. It has no effect on content that spans over the whole text width, like your algorithm and just adds even more vertical spacing around which makes your problem worse


        • instead of frame{} better use the begin{frame}....end{frame} syntax





        documentclass{beamer}
        usepackage[linesnumbered,ruled,vlined]{algorithm2e}
        usepackage{caption}
        %usepackage{xcolor}
        usepackage{array}
        begin{document}

        %date{today}

        begin{frame}
        frametitle{dwd}

        begingroup
        small
        %begin{center}
        %begin{minipage}{1linewidth}
        begin{algorithm}[H]
        SetAlgoLined
        textbf{Input} : A graph $(G)$;
        textbf{Decide} : Is $G$ a random ? \
        vspace{0.3cm}

        If $X$ then stop and play and dance random ;
        $S = {g in G }$;
        Pick sdy $g in P $;
        Find n elemen. If exits then report ``Not sonian '';

        If{$X$}{
        Compute a lower and upper $L$ of $X$ in $G$;\

        If{$X$ exists and is fumbling lelal -grou}{

        return $zZ$;
        }
        }

        Else{
        return ``Not truein life'';
        }

        caption{Algorithm}
        label{algo6}
        end{algorithm}
        %end{minipage}
        %end{center}
        endgroup

        end{frame}


        end{document}


        enter image description here






        share|improve this answer













        I suggest to use a smaller fonts size to fit the algorithm into the frame. If small is not enough and you are really desperate, try foototesize, scriptsize, tiny or Tiny



        Some other comments:




        • you don't need to load the xcolor package with beamer


        • remove the center environment. It has no effect on content that spans over the whole text width, like your algorithm and just adds even more vertical spacing around which makes your problem worse


        • instead of frame{} better use the begin{frame}....end{frame} syntax





        documentclass{beamer}
        usepackage[linesnumbered,ruled,vlined]{algorithm2e}
        usepackage{caption}
        %usepackage{xcolor}
        usepackage{array}
        begin{document}

        %date{today}

        begin{frame}
        frametitle{dwd}

        begingroup
        small
        %begin{center}
        %begin{minipage}{1linewidth}
        begin{algorithm}[H]
        SetAlgoLined
        textbf{Input} : A graph $(G)$;
        textbf{Decide} : Is $G$ a random ? \
        vspace{0.3cm}

        If $X$ then stop and play and dance random ;
        $S = {g in G }$;
        Pick sdy $g in P $;
        Find n elemen. If exits then report ``Not sonian '';

        If{$X$}{
        Compute a lower and upper $L$ of $X$ in $G$;\

        If{$X$ exists and is fumbling lelal -grou}{

        return $zZ$;
        }
        }

        Else{
        return ``Not truein life'';
        }

        caption{Algorithm}
        label{algo6}
        end{algorithm}
        %end{minipage}
        %end{center}
        endgroup

        end{frame}


        end{document}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 17 at 17:28









        samcartersamcarter

        88k797281




        88k797281






























            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%2f470564%2fhow-to-compress-algorithm-in-a-beamer-presentation%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?