Set width of algorithm environment (preferably document wide)Set horizontal width on custom listings environmentSet width of a custom environmentIndentation of `then` in algorithms?Set width of a custom environmentAlgorithm code width problemAlgorithm EnvironmentTabbing environment in tabular environment cancels set table widthHow can I make an algorithm environment wider than linewidth or textwidth?Set linespread in algorithm environementshow to set sidebar color widthHow to set algorithm width to avoid overfull hbox problemAdjust width of algorithm floatFormat an algorithm without using algorithm environment

In Bayesian inference, why are some terms dropped from the posterior predictive?

What is the most common color to indicate the input-field is disabled?

Mathematica command that allows it to read my intentions

Finitely generated matrix groups whose eigenvalues are all algebraic

Calculate the Mean mean of two numbers

Can a virus destroy the BIOS of a modern computer?

How to remove border from elements in the last row?

How do I exit BASH while loop using modulus operator?

Do Iron Man suits sport waste management systems?

Why are UK visa biometrics appointments suspended at USCIS Application Support Centers?

How seriously should I take size and weight limits of hand luggage?

How could indestructible materials be used in power generation?

How dangerous is XSS

What's the meaning of "Sollensaussagen"?

OP Amp not amplifying audio signal

What do you call someone who asks many questions?

Car headlights in a world without electricity

In the UK, is it possible to get a referendum by a court decision?

Why was Sir Cadogan fired?

How exploitable/balanced is this homebrew spell: Spell Permanency?

Can I hook these wires up to find the connection to a dead outlet?

How can saying a song's name be a copyright violation?

Why is the sentence "Das ist eine Nase" correct?

Send out email when Apex Queueable fails and test it



Set width of algorithm environment (preferably document wide)


Set horizontal width on custom listings environmentSet width of a custom environmentIndentation of `then` in algorithms?Set width of a custom environmentAlgorithm code width problemAlgorithm EnvironmentTabbing environment in tabular environment cancels set table widthHow can I make an algorithm environment wider than linewidth or textwidth?Set linespread in algorithm environementshow to set sidebar color widthHow to set algorithm width to avoid overfull hbox problemAdjust width of algorithm floatFormat an algorithm without using algorithm environment













8















Looking for a way to set the width of an algorithm environment, preferably document wide (as opposed to per-algorithm). Thought it should be fairly easy, but couldn't find a particularly good solution.



Found this one here (wrap an algorithm in a minipage in a float, which is relatively okay, but surely there's a simpler way)?



documentclassarticle
usepackagealgorithm
floatstyleplain
newfloatmyalgotbhpmya

newenvironmentAlgorithm[2][tbh]%
beginmyalgo[#1]
centering
beginminipage#2
beginalgorithm[H]%
endalgorithm
endminipage
endmyalgo

begindocument
beginAlgorithm[t]10cm
captionDoes work, though no nice solution.
endAlgorithm
enddocument









share|improve this question




























    8















    Looking for a way to set the width of an algorithm environment, preferably document wide (as opposed to per-algorithm). Thought it should be fairly easy, but couldn't find a particularly good solution.



    Found this one here (wrap an algorithm in a minipage in a float, which is relatively okay, but surely there's a simpler way)?



    documentclassarticle
    usepackagealgorithm
    floatstyleplain
    newfloatmyalgotbhpmya

    newenvironmentAlgorithm[2][tbh]%
    beginmyalgo[#1]
    centering
    beginminipage#2
    beginalgorithm[H]%
    endalgorithm
    endminipage
    endmyalgo

    begindocument
    beginAlgorithm[t]10cm
    captionDoes work, though no nice solution.
    endAlgorithm
    enddocument









    share|improve this question


























      8












      8








      8


      1






      Looking for a way to set the width of an algorithm environment, preferably document wide (as opposed to per-algorithm). Thought it should be fairly easy, but couldn't find a particularly good solution.



      Found this one here (wrap an algorithm in a minipage in a float, which is relatively okay, but surely there's a simpler way)?



      documentclassarticle
      usepackagealgorithm
      floatstyleplain
      newfloatmyalgotbhpmya

      newenvironmentAlgorithm[2][tbh]%
      beginmyalgo[#1]
      centering
      beginminipage#2
      beginalgorithm[H]%
      endalgorithm
      endminipage
      endmyalgo

      begindocument
      beginAlgorithm[t]10cm
      captionDoes work, though no nice solution.
      endAlgorithm
      enddocument









      share|improve this question
















      Looking for a way to set the width of an algorithm environment, preferably document wide (as opposed to per-algorithm). Thought it should be fairly easy, but couldn't find a particularly good solution.



      Found this one here (wrap an algorithm in a minipage in a float, which is relatively okay, but surely there's a simpler way)?



      documentclassarticle
      usepackagealgorithm
      floatstyleplain
      newfloatmyalgotbhpmya

      newenvironmentAlgorithm[2][tbh]%
      beginmyalgo[#1]
      centering
      beginminipage#2
      beginalgorithm[H]%
      endalgorithm
      endminipage
      endmyalgo

      begindocument
      beginAlgorithm[t]10cm
      captionDoes work, though no nice solution.
      endAlgorithm
      enddocument






      algorithms width






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 22 '11 at 14:56









      Joseph Wright

      205k23563891




      205k23563891










      asked Dec 21 '10 at 4:00









      badroitbadroit

      3,45373352




      3,45373352




















          2 Answers
          2






          active

          oldest

          votes


















          9














          floateveryalgorithmsetlengthhsize10cm would limit the algorithm environment to a width of 10cm, but would not center it. (For additional centering one needs to re-define internal macros of the float package which does not sound like an elegant solution to me.)



          So I'm afraid, the solution you have found seems to be quite good and if you would like to have the width setting global you could simply change the definition of Algorithm, e.g.:




          documentclassarticle
          usepackagealgorithm
          floatstyleplain
          newfloatmyalgotbhpmya

          newenvironmentAlgorithm[1][tbh]%
          beginmyalgo[#1]
          centering
          beginminipage10cm
          beginalgorithm[H]%
          endalgorithm
          endminipage
          endmyalgo

          begindocument
          beginAlgorithm[t]
          captionDoes work, though no nice solution.
          endAlgorithm
          enddocument





          share|improve this answer























          • Thanks! (Just wanted to make sure I wasn't missing something.)

            – badroit
            Dec 21 '10 at 17:04


















          0














          You can include the algorithm in a figure.





          share








          New contributor




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




















            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%2f7484%2fset-width-of-algorithm-environment-preferably-document-wide%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            9














            floateveryalgorithmsetlengthhsize10cm would limit the algorithm environment to a width of 10cm, but would not center it. (For additional centering one needs to re-define internal macros of the float package which does not sound like an elegant solution to me.)



            So I'm afraid, the solution you have found seems to be quite good and if you would like to have the width setting global you could simply change the definition of Algorithm, e.g.:




            documentclassarticle
            usepackagealgorithm
            floatstyleplain
            newfloatmyalgotbhpmya

            newenvironmentAlgorithm[1][tbh]%
            beginmyalgo[#1]
            centering
            beginminipage10cm
            beginalgorithm[H]%
            endalgorithm
            endminipage
            endmyalgo

            begindocument
            beginAlgorithm[t]
            captionDoes work, though no nice solution.
            endAlgorithm
            enddocument





            share|improve this answer























            • Thanks! (Just wanted to make sure I wasn't missing something.)

              – badroit
              Dec 21 '10 at 17:04















            9














            floateveryalgorithmsetlengthhsize10cm would limit the algorithm environment to a width of 10cm, but would not center it. (For additional centering one needs to re-define internal macros of the float package which does not sound like an elegant solution to me.)



            So I'm afraid, the solution you have found seems to be quite good and if you would like to have the width setting global you could simply change the definition of Algorithm, e.g.:




            documentclassarticle
            usepackagealgorithm
            floatstyleplain
            newfloatmyalgotbhpmya

            newenvironmentAlgorithm[1][tbh]%
            beginmyalgo[#1]
            centering
            beginminipage10cm
            beginalgorithm[H]%
            endalgorithm
            endminipage
            endmyalgo

            begindocument
            beginAlgorithm[t]
            captionDoes work, though no nice solution.
            endAlgorithm
            enddocument





            share|improve this answer























            • Thanks! (Just wanted to make sure I wasn't missing something.)

              – badroit
              Dec 21 '10 at 17:04













            9












            9








            9







            floateveryalgorithmsetlengthhsize10cm would limit the algorithm environment to a width of 10cm, but would not center it. (For additional centering one needs to re-define internal macros of the float package which does not sound like an elegant solution to me.)



            So I'm afraid, the solution you have found seems to be quite good and if you would like to have the width setting global you could simply change the definition of Algorithm, e.g.:




            documentclassarticle
            usepackagealgorithm
            floatstyleplain
            newfloatmyalgotbhpmya

            newenvironmentAlgorithm[1][tbh]%
            beginmyalgo[#1]
            centering
            beginminipage10cm
            beginalgorithm[H]%
            endalgorithm
            endminipage
            endmyalgo

            begindocument
            beginAlgorithm[t]
            captionDoes work, though no nice solution.
            endAlgorithm
            enddocument





            share|improve this answer













            floateveryalgorithmsetlengthhsize10cm would limit the algorithm environment to a width of 10cm, but would not center it. (For additional centering one needs to re-define internal macros of the float package which does not sound like an elegant solution to me.)



            So I'm afraid, the solution you have found seems to be quite good and if you would like to have the width setting global you could simply change the definition of Algorithm, e.g.:




            documentclassarticle
            usepackagealgorithm
            floatstyleplain
            newfloatmyalgotbhpmya

            newenvironmentAlgorithm[1][tbh]%
            beginmyalgo[#1]
            centering
            beginminipage10cm
            beginalgorithm[H]%
            endalgorithm
            endminipage
            endmyalgo

            begindocument
            beginAlgorithm[t]
            captionDoes work, though no nice solution.
            endAlgorithm
            enddocument






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 21 '10 at 8:06









            Axel SommerfeldtAxel Sommerfeldt

            12.2k22855




            12.2k22855












            • Thanks! (Just wanted to make sure I wasn't missing something.)

              – badroit
              Dec 21 '10 at 17:04

















            • Thanks! (Just wanted to make sure I wasn't missing something.)

              – badroit
              Dec 21 '10 at 17:04
















            Thanks! (Just wanted to make sure I wasn't missing something.)

            – badroit
            Dec 21 '10 at 17:04





            Thanks! (Just wanted to make sure I wasn't missing something.)

            – badroit
            Dec 21 '10 at 17:04











            0














            You can include the algorithm in a figure.





            share








            New contributor




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
























              0














              You can include the algorithm in a figure.





              share








              New contributor




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






















                0












                0








                0







                You can include the algorithm in a figure.





                share








                New contributor




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










                You can include the algorithm in a figure.






                share








                New contributor




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








                share


                share






                New contributor




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









                answered 6 mins ago









                fattah.safafattah.safa

                1011




                1011




                New contributor




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





                New contributor





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






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



























                    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%2f7484%2fset-width-of-algorithm-environment-preferably-document-wide%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

                    Lioubotyn Sommaire Géographie | Histoire | Population | Notes et références | Liens externes | Menu de navigationlubotin.kharkov.uamodifier« Recensements et estimations de la population depuis 1897 »« Office des statistiques d'Ukraine : population au 1er janvier 2010, 2011 et 2012 »« Office des statistiques d'Ukraine : population au 1er janvier 2011, 2012 et 2013 »Informations officiellesCartes topographiquesCarte routièrem

                    Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

                    Mpande kaSenzangakhona Biographie | Références | Menu de navigationmodifierMpande kaSenzangakhonavoir la liste des auteursm