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

How can a day be of 24 hours?

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

Can someone clarify Hamming's notion of important problems in relation to modern academia?

What Exploit Are These User Agents Trying to Use?

Was the Stack Exchange "Happy April Fools" page fitting with the '90's code?

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

how do we prove that a sum of two periods is still a period?

Is this draw by repetition?

Knowledge-based authentication using Domain-driven Design in C#

Different meanings of こわい

Rotate ASCII Art by 45 Degrees

Are British MPs missing the point, with these 'Indicative Votes'?

How to Prove P(a) → ∀x(P(x) ∨ ¬(x = a)) using Natural Deduction

Sums of two squares in arithmetic progressions

How could indestructible materials be used in power generation?

Machine learning testing data

Is "/bin/[.exe" a legitimate file? [Cygwin, Windows 10]

Why didn't Boeing produce its own regional jet?

How do I exit BASH while loop using modulus operator?

Finitely generated matrix groups whose eigenvalues are all algebraic

OP Amp not amplifying audio signal

What's the meaning of "Sollensaussagen"?

How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?

Am I breaking OOP practice with this architecture?



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|improve this answer








          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|improve this answer








            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|improve this answer








              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|improve this answer








                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|improve this answer








                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|improve this answer



                share|improve this answer






                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 13 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

                    How should I use the fbox command correctly to avoid producing a Bad Box message?How to put a long piece of text in a box?How to specify height and width of fboxIs there an arrayrulecolor-like command to change the rule color of fbox?What is the command to highlight bad boxes in pdf?Why does fbox sometimes place the box *over* the graphic image?how to put the text in the boxHow to create command for a box where text inside the box can automatically adjust?how can I make an fbox like command with certain color, shape and width of border?how to use fbox in align modeFbox increase the spacing between the box and it content (inner margin)how to change the box height of an equationWhat is the use of the hbox in a newcommand command?

                    152 Atala Notae | Nexus externi | Tabula navigationis"Discovery Circumstances: Numbered Minor Planets"2000152Small-Body Database

                    Doxepinum Nexus interni Notae | Tabula navigationis3158DB01142WHOa682390"Structural Analysis of the Histamine H1 Receptor""Transdermal and Topical Drug Administration in the Treatment of Pain""Antidepressants as antipruritic agents: A review"