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

Do airline pilots ever risk not hearing communication directed to them specifically, from traffic controllers?

Download, install and reboot computer at night if needed

A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?

DOS, create pipe for stdin/stdout of command.com(or 4dos.com) in C or Batch?

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

Prevent a directory in /tmp from being deleted

How to make payment on the internet without leaving a money trail?

Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)

What is the command to reset a PC without deleting any files

The use of multiple foreign keys on same column in SQL Server

How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?

New order #4: World

Compute hash value according to multiplication method

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?

How do you conduct xenoanthropology after first contact?

TGV timetables / schedules?

How is it possible to have an ability score that is less than 3?

Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?

How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?

Is it possible to make sharp wind that can cut stuff from afar?

Why is the design of haulage companies so “special”?

What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?

Can a German sentence have two subjects?

Infinite past with a beginning?



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













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

      77.3k8171285




      77.3k8171285










      asked Mar 27 at 8:55









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

      38718




      38718




















          2 Answers
          2






          active

          oldest

          votes


















          4














          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









            4














            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





























              4














              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



























                4












                4








                4







                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

                1485




                1485





















                    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

                    13.4k11039




                    13.4k11039












                    • 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







                    -horizontal-alignment, theorems, tikz-pgf

                    Popular posts from this blog

                    Creating 100m^2 grid automatically using QGIS?Creating grid constrained within polygon in QGIS?Createing polygon layer from point data using QGIS?Creating vector grid using QGIS?Creating grid polygons from coordinates using R or PythonCreating grid from spatio temporal point data?Creating fields in attributes table using other layers using QGISCreate .shp vector grid in QGISQGIS Creating 4km point grid within polygonsCreate a vector grid over a raster layerVector Grid Creates just one grid

                    What is this called? Old film camera viewer?What makes a good film camera?What to do with an old film camera?What should one look for when buying a used film camera?What is the value and age of this pre-1967 Ricoh 35 mm camera?DSLR recommendation, question about old Canon 35mm film Camera & lensesCan anyone identify the silver rangefinder-style camera in this advertisement?What kind of a Polaroid 600-camera is this?Will an old film camera still work even when not used in a very long time?What is this camera / Can I develop the film?How to fit an action camera into antique (bellows) housing?What to check when buying used and old film bodies?

                    Why is this plane circling around the Lucknow airport every day?Why do aircraft on Flight Radar 24 jump around randomly sometimes?What airport has this walkway over a taxiway?How does Chicago O'Hare's tower sequence aircraft at peak capacity?Which airport is featured in this Delta commercial?After a crash, for how long is the airport closed?Can a passenger plane stand still in the air, or hover at a fixed location above a ground?What are those trucks towing around, and why?What is this airport outside of Cairo, Egypt?Which US airport has the lowest circling MDH?What is this airport video?