problem with theorem, tikzpicture and center environmentTheorem environment - centered lineProblem with font in theorem environmentHow to define the default vertical distance between nodes?Theorem environment with numbers on the leftProblem with theorem numberinghow to center Tikzpicture?Problems with nested TikZpicturesCenter every tikzpicture environmentTextsize in theorem environmentProblem with definition/examples and theorem numbering

Are there any OR challenges that are similar to kaggle's competitions?

Align (multiline text)-nodes with tikzlibrary 'positioning'

Land Registry Clause

Why should I pay for an SSL certificate?

Wristwatches in the cockpit

Are unaudited server logs admissible in a court of law?

Show two plots together: a two dimensional curve tangent to the maxima of a three dimensional plot

How can I train a replacement without letting my bosses and the replacement knowing?

Can I submit a paper computer science conference using an alias if using my real name can cause legal trouble in my original country

The Lucky House

Can sulfuric acid itself be electrolysed?

Output with the same length always

Gofer work in exchange for Letter of Recommendation

Hiker's Cabin Mystery | Pt. XV

How to translate 脑袋短路 into English?

Starships without computers?

Are there categories whose internal hom is somewhat 'exotic'?

How best to join tables, which have different lengths on the same column values which exist in both tables?

Is "stainless" a bulk or a surface property of stainless steel?

Is there a commercial liquid with refractive index greater than n=2?

Polar contour plot in Mathematica?

Levenshtein Neighbours

Why should P.I be willing to write strong LOR even if that means losing a undergraduate from his/her lab?

Earliest evidence of objects intended for future archaeologists?



problem with theorem, tikzpicture and center environment


Theorem environment - centered lineProblem with font in theorem environmentHow to define the default vertical distance between nodes?Theorem environment with numbers on the leftProblem with theorem numberinghow to center Tikzpicture?Problems with nested TikZpicturesCenter every tikzpicture environmentTextsize in theorem environmentProblem with definition/examples and theorem numbering






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








5















I use a dialog-bubble style for some theorems, by using the code below, that works fine.



documentclass[a4paper,11pt,twoside]book
usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]geometry
usepackageamsthm

usepackageenviron

usepackagetikz
usetikzlibraryshapes,snakes % Για φάνσι κουτακια

theoremstyleplain
newtheoremtheoSometheorem[chapter]

tikzstyleBoxDialog = [draw=black, fill=white, very thick,
rectangle callout, rounded corners, densely dashed,callout relative pointer=(-0.4cm,-0.4cm), inner sep=4pt, inner ysep=8pt]
tikzstyleTitlTheo =[fill=white, text=black]

NewEnvirondialogtheo[1]
begintikzpicture
node [BoxDialog] (boxtheo)%
beginminipage0.9textwidth
BODY
endminipage
;
node[TitlTheo] at (boxtheo.north) textbf#1;
endtikzpicture


begindocument

begindialogtheotitle theorem
begintheo
theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
endtheo
enddialogtheo

enddocument


enter image description here



But when I wrap center environment around the dialogtheo environment like this:



NewEnvirondialogtheo[1]
begincenter
begintikzpicture
node [BoxDialog] (boxtheo)%
beginminipage0.9textwidth
BODY
endminipage
;
node[TitlTheo] at (boxtheo.north) textbf#1;
endtikzpicture
endcenter



I have this error report:




! LaTeX Error: Something's wrong--perhaps a
missing item.




This is the log-file.



What is the problem?



P.S.: If I ceep center environment, but I delete theo, everything is OK again.










share|improve this question
































    5















    I use a dialog-bubble style for some theorems, by using the code below, that works fine.



    documentclass[a4paper,11pt,twoside]book
    usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]geometry
    usepackageamsthm

    usepackageenviron

    usepackagetikz
    usetikzlibraryshapes,snakes % Για φάνσι κουτακια

    theoremstyleplain
    newtheoremtheoSometheorem[chapter]

    tikzstyleBoxDialog = [draw=black, fill=white, very thick,
    rectangle callout, rounded corners, densely dashed,callout relative pointer=(-0.4cm,-0.4cm), inner sep=4pt, inner ysep=8pt]
    tikzstyleTitlTheo =[fill=white, text=black]

    NewEnvirondialogtheo[1]
    begintikzpicture
    node [BoxDialog] (boxtheo)%
    beginminipage0.9textwidth
    BODY
    endminipage
    ;
    node[TitlTheo] at (boxtheo.north) textbf#1;
    endtikzpicture


    begindocument

    begindialogtheotitle theorem
    begintheo
    theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
    endtheo
    enddialogtheo

    enddocument


    enter image description here



    But when I wrap center environment around the dialogtheo environment like this:



    NewEnvirondialogtheo[1]
    begincenter
    begintikzpicture
    node [BoxDialog] (boxtheo)%
    beginminipage0.9textwidth
    BODY
    endminipage
    ;
    node[TitlTheo] at (boxtheo.north) textbf#1;
    endtikzpicture
    endcenter



    I have this error report:




    ! LaTeX Error: Something's wrong--perhaps a
    missing item.




    This is the log-file.



    What is the problem?



    P.S.: If I ceep center environment, but I delete theo, everything is OK again.










    share|improve this question




























      5












      5








      5








      I use a dialog-bubble style for some theorems, by using the code below, that works fine.



      documentclass[a4paper,11pt,twoside]book
      usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]geometry
      usepackageamsthm

      usepackageenviron

      usepackagetikz
      usetikzlibraryshapes,snakes % Για φάνσι κουτακια

      theoremstyleplain
      newtheoremtheoSometheorem[chapter]

      tikzstyleBoxDialog = [draw=black, fill=white, very thick,
      rectangle callout, rounded corners, densely dashed,callout relative pointer=(-0.4cm,-0.4cm), inner sep=4pt, inner ysep=8pt]
      tikzstyleTitlTheo =[fill=white, text=black]

      NewEnvirondialogtheo[1]
      begintikzpicture
      node [BoxDialog] (boxtheo)%
      beginminipage0.9textwidth
      BODY
      endminipage
      ;
      node[TitlTheo] at (boxtheo.north) textbf#1;
      endtikzpicture


      begindocument

      begindialogtheotitle theorem
      begintheo
      theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
      endtheo
      enddialogtheo

      enddocument


      enter image description here



      But when I wrap center environment around the dialogtheo environment like this:



      NewEnvirondialogtheo[1]
      begincenter
      begintikzpicture
      node [BoxDialog] (boxtheo)%
      beginminipage0.9textwidth
      BODY
      endminipage
      ;
      node[TitlTheo] at (boxtheo.north) textbf#1;
      endtikzpicture
      endcenter



      I have this error report:




      ! LaTeX Error: Something's wrong--perhaps a
      missing item.




      This is the log-file.



      What is the problem?



      P.S.: If I ceep center environment, but I delete theo, everything is OK again.










      share|improve this question
















      I use a dialog-bubble style for some theorems, by using the code below, that works fine.



      documentclass[a4paper,11pt,twoside]book
      usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]geometry
      usepackageamsthm

      usepackageenviron

      usepackagetikz
      usetikzlibraryshapes,snakes % Για φάνσι κουτακια

      theoremstyleplain
      newtheoremtheoSometheorem[chapter]

      tikzstyleBoxDialog = [draw=black, fill=white, very thick,
      rectangle callout, rounded corners, densely dashed,callout relative pointer=(-0.4cm,-0.4cm), inner sep=4pt, inner ysep=8pt]
      tikzstyleTitlTheo =[fill=white, text=black]

      NewEnvirondialogtheo[1]
      begintikzpicture
      node [BoxDialog] (boxtheo)%
      beginminipage0.9textwidth
      BODY
      endminipage
      ;
      node[TitlTheo] at (boxtheo.north) textbf#1;
      endtikzpicture


      begindocument

      begindialogtheotitle theorem
      begintheo
      theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
      endtheo
      enddialogtheo

      enddocument


      enter image description here



      But when I wrap center environment around the dialogtheo environment like this:



      NewEnvirondialogtheo[1]
      begincenter
      begintikzpicture
      node [BoxDialog] (boxtheo)%
      beginminipage0.9textwidth
      BODY
      endminipage
      ;
      node[TitlTheo] at (boxtheo.north) textbf#1;
      endtikzpicture
      endcenter



      I have this error report:




      ! LaTeX Error: Something's wrong--perhaps a
      missing item.




      This is the log-file.



      What is the problem?



      P.S.: If I ceep center environment, but I delete theo, everything is OK again.







      tikz-pgf horizontal-alignment theorems






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 3 at 2:19









      Henri Menke

      82.6k9 gold badges180 silver badges298 bronze badges




      82.6k9 gold badges180 silver badges298 bronze badges










      asked Mar 27 at 8:55









      Kώστας ΚούδαςKώστας Κούδας

      5311 silver badge9 bronze badges




      5311 silver badge9 bronze badges























          2 Answers
          2






          active

          oldest

          votes


















          3














          If your goal is to center the dialog bubble, instead of using the center environment, you should try to use centering with a par at the end of the content of your environment:



          NewEnvirondialogtheo[1]
          centering
          begintikzpicture
          node[BoxDialog] (boxtheo)
          beginminipage0.9textwidth
          BODY
          endminipage
          ;
          node[TitlTheo] at (boxtheo.north) textbf#1;
          endtikzpicturepar



          The par is important, else the bubble will not be centered at all.






          share|improve this answer


































            3














            If you try to place a theorem inside center environment, you will realize that it doesn't work.



            Edit: I mean that the code:



            begincenter
            begintheo
            test
            endtheo
            endcenter


            would result to a non-centered theorem.



            So, my solution is a "hack" that just indenting your environment as much as needed:



            documentclass[a4paper,11pt,twoside]book
            usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]geometry
            usepackageamsthm
            usepackagelipsum
            usepackageenviron

            usepackagetikz
            usetikzlibraryshapes,decorations % Για φάνσι κουτακια

            theoremstyleplain
            newtheoremtheoSometheorem[chapter]

            tikzstyleBoxDialog = [draw=black, fill=white, very thick,
            rectangle callout, rounded corners, densely dashed,callout relative pointer=(-0.4cm,-0.4cm), inner sep=4pt, inner ysep=8pt]
            tikzstyleTitlTheo =[fill=white, text=black]

            newsaveboxtheobox
            newlengththeoidentlength
            NewEnvirondialogtheo[1]
            saveboxtheoboxhbox
            begintikzpicture
            node [BoxDialog] (boxtheo)%
            beginminipage0.6textwidth
            BODY
            endminipage
            ;
            node[TitlTheo] at (boxtheo.north) textbf#1;
            endtikzpicture
            setlengththeoidentlengthdimexpr(textwidth-wdtheobox)/2relax
            noindenthspace*theoidentlengthuseboxtheobox


            begindocument
            lipsum[1]
            begindialogtheotitle theorem

            begintheo
            theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
            endtheo
            enddialogtheo

            enddocument


            enter image description here



            PS: My solution is just an alternative [that I think could be useful in many cases if centering fails], and just added as such (an alternative) approach.






            share|improve this answer



























            • I don't agree with you about theorems problem with centering. If I wrap around BODY the command begincenterSomethingendcenter, like this: begincenterSomethingendcenterBODYbegincenterSomethingendcenter, then there is no problem with centering the dialog and the theorem.

              – Kώστας Κούδας
              Mar 27 at 9:39












            • Γεια σου @ΚώσταςΚούδας (:Hi) : check the edit to see what I mean because possibly I didn't understood your goal or/and you didn't understood what I tried to do.

              – koleygr
              Mar 27 at 9:46












            • Καλημέρα, @koleygr ! I thought that you meant that if I put a theorem in a center environment, I 'll have errors. So I understand your proposition!

              – Kώστας Κούδας
              Mar 27 at 9:49











            • No, as you see, it will not give errors, but will just use all the available text width. Something like begincenter beginminipage0.5textwidth begintheo test endtheo endminipage endcenter would center anyway... My proposal is just a more general approach that could help in similar problems. (Just adding for its idea.) Have a nice day. PS: Replace the library snakes with decorations as your compiler is suggesting.

              – koleygr
              Mar 27 at 9:53














            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%2f481640%2fproblem-with-theorem-tikzpicture-and-center-environment%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









            3














            If your goal is to center the dialog bubble, instead of using the center environment, you should try to use centering with a par at the end of the content of your environment:



            NewEnvirondialogtheo[1]
            centering
            begintikzpicture
            node[BoxDialog] (boxtheo)
            beginminipage0.9textwidth
            BODY
            endminipage
            ;
            node[TitlTheo] at (boxtheo.north) textbf#1;
            endtikzpicturepar



            The par is important, else the bubble will not be centered at all.






            share|improve this answer































              3














              If your goal is to center the dialog bubble, instead of using the center environment, you should try to use centering with a par at the end of the content of your environment:



              NewEnvirondialogtheo[1]
              centering
              begintikzpicture
              node[BoxDialog] (boxtheo)
              beginminipage0.9textwidth
              BODY
              endminipage
              ;
              node[TitlTheo] at (boxtheo.north) textbf#1;
              endtikzpicturepar



              The par is important, else the bubble will not be centered at all.






              share|improve this answer





























                3












                3








                3







                If your goal is to center the dialog bubble, instead of using the center environment, you should try to use centering with a par at the end of the content of your environment:



                NewEnvirondialogtheo[1]
                centering
                begintikzpicture
                node[BoxDialog] (boxtheo)
                beginminipage0.9textwidth
                BODY
                endminipage
                ;
                node[TitlTheo] at (boxtheo.north) textbf#1;
                endtikzpicturepar



                The par is important, else the bubble will not be centered at all.






                share|improve this answer















                If your goal is to center the dialog bubble, instead of using the center environment, you should try to use centering with a par at the end of the content of your environment:



                NewEnvirondialogtheo[1]
                centering
                begintikzpicture
                node[BoxDialog] (boxtheo)
                beginminipage0.9textwidth
                BODY
                endminipage
                ;
                node[TitlTheo] at (boxtheo.north) textbf#1;
                endtikzpicturepar



                The par is important, else the bubble will not be centered at all.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 27 at 9:17

























                answered Mar 27 at 9:15









                KersouManKersouMan

                1427 bronze badges




                1427 bronze badges


























                    3














                    If you try to place a theorem inside center environment, you will realize that it doesn't work.



                    Edit: I mean that the code:



                    begincenter
                    begintheo
                    test
                    endtheo
                    endcenter


                    would result to a non-centered theorem.



                    So, my solution is a "hack" that just indenting your environment as much as needed:



                    documentclass[a4paper,11pt,twoside]book
                    usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]geometry
                    usepackageamsthm
                    usepackagelipsum
                    usepackageenviron

                    usepackagetikz
                    usetikzlibraryshapes,decorations % Για φάνσι κουτακια

                    theoremstyleplain
                    newtheoremtheoSometheorem[chapter]

                    tikzstyleBoxDialog = [draw=black, fill=white, very thick,
                    rectangle callout, rounded corners, densely dashed,callout relative pointer=(-0.4cm,-0.4cm), inner sep=4pt, inner ysep=8pt]
                    tikzstyleTitlTheo =[fill=white, text=black]

                    newsaveboxtheobox
                    newlengththeoidentlength
                    NewEnvirondialogtheo[1]
                    saveboxtheoboxhbox
                    begintikzpicture
                    node [BoxDialog] (boxtheo)%
                    beginminipage0.6textwidth
                    BODY
                    endminipage
                    ;
                    node[TitlTheo] at (boxtheo.north) textbf#1;
                    endtikzpicture
                    setlengththeoidentlengthdimexpr(textwidth-wdtheobox)/2relax
                    noindenthspace*theoidentlengthuseboxtheobox


                    begindocument
                    lipsum[1]
                    begindialogtheotitle theorem

                    begintheo
                    theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
                    endtheo
                    enddialogtheo

                    enddocument


                    enter image description here



                    PS: My solution is just an alternative [that I think could be useful in many cases if centering fails], and just added as such (an alternative) approach.






                    share|improve this answer



























                    • I don't agree with you about theorems problem with centering. If I wrap around BODY the command begincenterSomethingendcenter, like this: begincenterSomethingendcenterBODYbegincenterSomethingendcenter, then there is no problem with centering the dialog and the theorem.

                      – Kώστας Κούδας
                      Mar 27 at 9:39












                    • Γεια σου @ΚώσταςΚούδας (:Hi) : check the edit to see what I mean because possibly I didn't understood your goal or/and you didn't understood what I tried to do.

                      – koleygr
                      Mar 27 at 9:46












                    • Καλημέρα, @koleygr ! I thought that you meant that if I put a theorem in a center environment, I 'll have errors. So I understand your proposition!

                      – Kώστας Κούδας
                      Mar 27 at 9:49











                    • No, as you see, it will not give errors, but will just use all the available text width. Something like begincenter beginminipage0.5textwidth begintheo test endtheo endminipage endcenter would center anyway... My proposal is just a more general approach that could help in similar problems. (Just adding for its idea.) Have a nice day. PS: Replace the library snakes with decorations as your compiler is suggesting.

                      – koleygr
                      Mar 27 at 9:53
















                    3














                    If you try to place a theorem inside center environment, you will realize that it doesn't work.



                    Edit: I mean that the code:



                    begincenter
                    begintheo
                    test
                    endtheo
                    endcenter


                    would result to a non-centered theorem.



                    So, my solution is a "hack" that just indenting your environment as much as needed:



                    documentclass[a4paper,11pt,twoside]book
                    usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]geometry
                    usepackageamsthm
                    usepackagelipsum
                    usepackageenviron

                    usepackagetikz
                    usetikzlibraryshapes,decorations % Για φάνσι κουτακια

                    theoremstyleplain
                    newtheoremtheoSometheorem[chapter]

                    tikzstyleBoxDialog = [draw=black, fill=white, very thick,
                    rectangle callout, rounded corners, densely dashed,callout relative pointer=(-0.4cm,-0.4cm), inner sep=4pt, inner ysep=8pt]
                    tikzstyleTitlTheo =[fill=white, text=black]

                    newsaveboxtheobox
                    newlengththeoidentlength
                    NewEnvirondialogtheo[1]
                    saveboxtheoboxhbox
                    begintikzpicture
                    node [BoxDialog] (boxtheo)%
                    beginminipage0.6textwidth
                    BODY
                    endminipage
                    ;
                    node[TitlTheo] at (boxtheo.north) textbf#1;
                    endtikzpicture
                    setlengththeoidentlengthdimexpr(textwidth-wdtheobox)/2relax
                    noindenthspace*theoidentlengthuseboxtheobox


                    begindocument
                    lipsum[1]
                    begindialogtheotitle theorem

                    begintheo
                    theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
                    endtheo
                    enddialogtheo

                    enddocument


                    enter image description here



                    PS: My solution is just an alternative [that I think could be useful in many cases if centering fails], and just added as such (an alternative) approach.






                    share|improve this answer



























                    • I don't agree with you about theorems problem with centering. If I wrap around BODY the command begincenterSomethingendcenter, like this: begincenterSomethingendcenterBODYbegincenterSomethingendcenter, then there is no problem with centering the dialog and the theorem.

                      – Kώστας Κούδας
                      Mar 27 at 9:39












                    • Γεια σου @ΚώσταςΚούδας (:Hi) : check the edit to see what I mean because possibly I didn't understood your goal or/and you didn't understood what I tried to do.

                      – koleygr
                      Mar 27 at 9:46












                    • Καλημέρα, @koleygr ! I thought that you meant that if I put a theorem in a center environment, I 'll have errors. So I understand your proposition!

                      – Kώστας Κούδας
                      Mar 27 at 9:49











                    • No, as you see, it will not give errors, but will just use all the available text width. Something like begincenter beginminipage0.5textwidth begintheo test endtheo endminipage endcenter would center anyway... My proposal is just a more general approach that could help in similar problems. (Just adding for its idea.) Have a nice day. PS: Replace the library snakes with decorations as your compiler is suggesting.

                      – koleygr
                      Mar 27 at 9:53














                    3












                    3








                    3







                    If you try to place a theorem inside center environment, you will realize that it doesn't work.



                    Edit: I mean that the code:



                    begincenter
                    begintheo
                    test
                    endtheo
                    endcenter


                    would result to a non-centered theorem.



                    So, my solution is a "hack" that just indenting your environment as much as needed:



                    documentclass[a4paper,11pt,twoside]book
                    usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]geometry
                    usepackageamsthm
                    usepackagelipsum
                    usepackageenviron

                    usepackagetikz
                    usetikzlibraryshapes,decorations % Για φάνσι κουτακια

                    theoremstyleplain
                    newtheoremtheoSometheorem[chapter]

                    tikzstyleBoxDialog = [draw=black, fill=white, very thick,
                    rectangle callout, rounded corners, densely dashed,callout relative pointer=(-0.4cm,-0.4cm), inner sep=4pt, inner ysep=8pt]
                    tikzstyleTitlTheo =[fill=white, text=black]

                    newsaveboxtheobox
                    newlengththeoidentlength
                    NewEnvirondialogtheo[1]
                    saveboxtheoboxhbox
                    begintikzpicture
                    node [BoxDialog] (boxtheo)%
                    beginminipage0.6textwidth
                    BODY
                    endminipage
                    ;
                    node[TitlTheo] at (boxtheo.north) textbf#1;
                    endtikzpicture
                    setlengththeoidentlengthdimexpr(textwidth-wdtheobox)/2relax
                    noindenthspace*theoidentlengthuseboxtheobox


                    begindocument
                    lipsum[1]
                    begindialogtheotitle theorem

                    begintheo
                    theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
                    endtheo
                    enddialogtheo

                    enddocument


                    enter image description here



                    PS: My solution is just an alternative [that I think could be useful in many cases if centering fails], and just added as such (an alternative) approach.






                    share|improve this answer















                    If you try to place a theorem inside center environment, you will realize that it doesn't work.



                    Edit: I mean that the code:



                    begincenter
                    begintheo
                    test
                    endtheo
                    endcenter


                    would result to a non-centered theorem.



                    So, my solution is a "hack" that just indenting your environment as much as needed:



                    documentclass[a4paper,11pt,twoside]book
                    usepackage[a4paper,left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]geometry
                    usepackageamsthm
                    usepackagelipsum
                    usepackageenviron

                    usepackagetikz
                    usetikzlibraryshapes,decorations % Για φάνσι κουτακια

                    theoremstyleplain
                    newtheoremtheoSometheorem[chapter]

                    tikzstyleBoxDialog = [draw=black, fill=white, very thick,
                    rectangle callout, rounded corners, densely dashed,callout relative pointer=(-0.4cm,-0.4cm), inner sep=4pt, inner ysep=8pt]
                    tikzstyleTitlTheo =[fill=white, text=black]

                    newsaveboxtheobox
                    newlengththeoidentlength
                    NewEnvirondialogtheo[1]
                    saveboxtheoboxhbox
                    begintikzpicture
                    node [BoxDialog] (boxtheo)%
                    beginminipage0.6textwidth
                    BODY
                    endminipage
                    ;
                    node[TitlTheo] at (boxtheo.north) textbf#1;
                    endtikzpicture
                    setlengththeoidentlengthdimexpr(textwidth-wdtheobox)/2relax
                    noindenthspace*theoidentlengthuseboxtheobox


                    begindocument
                    lipsum[1]
                    begindialogtheotitle theorem

                    begintheo
                    theorem theorem theorem theorem theorem theorem theorem theorem theorem theorem
                    endtheo
                    enddialogtheo

                    enddocument


                    enter image description here



                    PS: My solution is just an alternative [that I think could be useful in many cases if centering fails], and just added as such (an alternative) approach.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Mar 27 at 9:44

























                    answered Mar 27 at 9:20









                    koleygrkoleygr

                    14.4k1 gold badge10 silver badges40 bronze badges




                    14.4k1 gold badge10 silver badges40 bronze badges















                    • I don't agree with you about theorems problem with centering. If I wrap around BODY the command begincenterSomethingendcenter, like this: begincenterSomethingendcenterBODYbegincenterSomethingendcenter, then there is no problem with centering the dialog and the theorem.

                      – Kώστας Κούδας
                      Mar 27 at 9:39












                    • Γεια σου @ΚώσταςΚούδας (:Hi) : check the edit to see what I mean because possibly I didn't understood your goal or/and you didn't understood what I tried to do.

                      – koleygr
                      Mar 27 at 9:46












                    • Καλημέρα, @koleygr ! I thought that you meant that if I put a theorem in a center environment, I 'll have errors. So I understand your proposition!

                      – Kώστας Κούδας
                      Mar 27 at 9:49











                    • No, as you see, it will not give errors, but will just use all the available text width. Something like begincenter beginminipage0.5textwidth begintheo test endtheo endminipage endcenter would center anyway... My proposal is just a more general approach that could help in similar problems. (Just adding for its idea.) Have a nice day. PS: Replace the library snakes with decorations as your compiler is suggesting.

                      – koleygr
                      Mar 27 at 9:53


















                    • I don't agree with you about theorems problem with centering. If I wrap around BODY the command begincenterSomethingendcenter, like this: begincenterSomethingendcenterBODYbegincenterSomethingendcenter, then there is no problem with centering the dialog and the theorem.

                      – Kώστας Κούδας
                      Mar 27 at 9:39












                    • Γεια σου @ΚώσταςΚούδας (:Hi) : check the edit to see what I mean because possibly I didn't understood your goal or/and you didn't understood what I tried to do.

                      – koleygr
                      Mar 27 at 9:46












                    • Καλημέρα, @koleygr ! I thought that you meant that if I put a theorem in a center environment, I 'll have errors. So I understand your proposition!

                      – Kώστας Κούδας
                      Mar 27 at 9:49











                    • No, as you see, it will not give errors, but will just use all the available text width. Something like begincenter beginminipage0.5textwidth begintheo test endtheo endminipage endcenter would center anyway... My proposal is just a more general approach that could help in similar problems. (Just adding for its idea.) Have a nice day. PS: Replace the library snakes with decorations as your compiler is suggesting.

                      – koleygr
                      Mar 27 at 9:53

















                    I don't agree with you about theorems problem with centering. If I wrap around BODY the command begincenterSomethingendcenter, like this: begincenterSomethingendcenterBODYbegincenterSomethingendcenter, then there is no problem with centering the dialog and the theorem.

                    – Kώστας Κούδας
                    Mar 27 at 9:39






                    I don't agree with you about theorems problem with centering. If I wrap around BODY the command begincenterSomethingendcenter, like this: begincenterSomethingendcenterBODYbegincenterSomethingendcenter, then there is no problem with centering the dialog and the theorem.

                    – Kώστας Κούδας
                    Mar 27 at 9:39














                    Γεια σου @ΚώσταςΚούδας (:Hi) : check the edit to see what I mean because possibly I didn't understood your goal or/and you didn't understood what I tried to do.

                    – koleygr
                    Mar 27 at 9:46






                    Γεια σου @ΚώσταςΚούδας (:Hi) : check the edit to see what I mean because possibly I didn't understood your goal or/and you didn't understood what I tried to do.

                    – koleygr
                    Mar 27 at 9:46














                    Καλημέρα, @koleygr ! I thought that you meant that if I put a theorem in a center environment, I 'll have errors. So I understand your proposition!

                    – Kώστας Κούδας
                    Mar 27 at 9:49





                    Καλημέρα, @koleygr ! I thought that you meant that if I put a theorem in a center environment, I 'll have errors. So I understand your proposition!

                    – Kώστας Κούδας
                    Mar 27 at 9:49













                    No, as you see, it will not give errors, but will just use all the available text width. Something like begincenter beginminipage0.5textwidth begintheo test endtheo endminipage endcenter would center anyway... My proposal is just a more general approach that could help in similar problems. (Just adding for its idea.) Have a nice day. PS: Replace the library snakes with decorations as your compiler is suggesting.

                    – koleygr
                    Mar 27 at 9:53






                    No, as you see, it will not give errors, but will just use all the available text width. Something like begincenter beginminipage0.5textwidth begintheo test endtheo endminipage endcenter would center anyway... My proposal is just a more general approach that could help in similar problems. (Just adding for its idea.) Have a nice day. PS: Replace the library snakes with decorations as your compiler is suggesting.

                    – koleygr
                    Mar 27 at 9:53


















                    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%2f481640%2fproblem-with-theorem-tikzpicture-and-center-environment%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

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript