define tikzpicture size with standalone document class











up vote
3
down vote

favorite












When drawing with standalone document class, the output image will automatically centered. for example, if I draw a circle with 5cm, then the image output will be 5cm. How can I keep 5cm circle in the center but output image size keep to 10cm?
I know the border=5cm option but I wish to use some command to define the picture dimension then I can always get the exact size, say 10cmx10cm.










share|improve this question


















  • 1




    What do you mean by picture dimension? Do you want the paper size? You can use geometry package to control everything, paper size, margins, and so on.
    – Sigur
    Dec 5 at 19:31










  • I mean use fixed picture size to draw something on it.
    – lucky1928
    Dec 5 at 19:33










  • So, you want to draw any picture on a page sized 10x10?
    – Sigur
    Dec 5 at 19:34










  • yes, use specific size then draw on it.
    – lucky1928
    Dec 5 at 19:36















up vote
3
down vote

favorite












When drawing with standalone document class, the output image will automatically centered. for example, if I draw a circle with 5cm, then the image output will be 5cm. How can I keep 5cm circle in the center but output image size keep to 10cm?
I know the border=5cm option but I wish to use some command to define the picture dimension then I can always get the exact size, say 10cmx10cm.










share|improve this question


















  • 1




    What do you mean by picture dimension? Do you want the paper size? You can use geometry package to control everything, paper size, margins, and so on.
    – Sigur
    Dec 5 at 19:31










  • I mean use fixed picture size to draw something on it.
    – lucky1928
    Dec 5 at 19:33










  • So, you want to draw any picture on a page sized 10x10?
    – Sigur
    Dec 5 at 19:34










  • yes, use specific size then draw on it.
    – lucky1928
    Dec 5 at 19:36













up vote
3
down vote

favorite









up vote
3
down vote

favorite











When drawing with standalone document class, the output image will automatically centered. for example, if I draw a circle with 5cm, then the image output will be 5cm. How can I keep 5cm circle in the center but output image size keep to 10cm?
I know the border=5cm option but I wish to use some command to define the picture dimension then I can always get the exact size, say 10cmx10cm.










share|improve this question













When drawing with standalone document class, the output image will automatically centered. for example, if I draw a circle with 5cm, then the image output will be 5cm. How can I keep 5cm circle in the center but output image size keep to 10cm?
I know the border=5cm option but I wish to use some command to define the picture dimension then I can always get the exact size, say 10cmx10cm.







tikz-pgf






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 5 at 19:05









lucky1928

1,1921716




1,1921716








  • 1




    What do you mean by picture dimension? Do you want the paper size? You can use geometry package to control everything, paper size, margins, and so on.
    – Sigur
    Dec 5 at 19:31










  • I mean use fixed picture size to draw something on it.
    – lucky1928
    Dec 5 at 19:33










  • So, you want to draw any picture on a page sized 10x10?
    – Sigur
    Dec 5 at 19:34










  • yes, use specific size then draw on it.
    – lucky1928
    Dec 5 at 19:36














  • 1




    What do you mean by picture dimension? Do you want the paper size? You can use geometry package to control everything, paper size, margins, and so on.
    – Sigur
    Dec 5 at 19:31










  • I mean use fixed picture size to draw something on it.
    – lucky1928
    Dec 5 at 19:33










  • So, you want to draw any picture on a page sized 10x10?
    – Sigur
    Dec 5 at 19:34










  • yes, use specific size then draw on it.
    – lucky1928
    Dec 5 at 19:36








1




1




What do you mean by picture dimension? Do you want the paper size? You can use geometry package to control everything, paper size, margins, and so on.
– Sigur
Dec 5 at 19:31




What do you mean by picture dimension? Do you want the paper size? You can use geometry package to control everything, paper size, margins, and so on.
– Sigur
Dec 5 at 19:31












I mean use fixed picture size to draw something on it.
– lucky1928
Dec 5 at 19:33




I mean use fixed picture size to draw something on it.
– lucky1928
Dec 5 at 19:33












So, you want to draw any picture on a page sized 10x10?
– Sigur
Dec 5 at 19:34




So, you want to draw any picture on a page sized 10x10?
– Sigur
Dec 5 at 19:34












yes, use specific size then draw on it.
– lucky1928
Dec 5 at 19:36




yes, use specific size then draw on it.
– lucky1928
Dec 5 at 19:36










3 Answers
3






active

oldest

votes

















up vote
5
down vote



accepted










Add a bounding box to the tikzpicture. Then you can freely arrange objects therein.



documentclass[tikz]{standalone}
begin{document}
begin{tikzpicture}
useasboundingbox (-5,-5) rectangle (5,5);
filldraw (-5,-5) rectangle ++(1,1);
draw(0,0)circle(2.5);
end{tikzpicture}
end{document}





share|improve this answer






























    up vote
    3
    down vote













    Add a 2.5 cm border on each side with the standalone option border=2.5cm, since 2.5cm+5cm+2.5 cm=10cm.



    documentclass[tikz,border=2.5cm]{standalone}
    begin{document}
    tikzdraw(0,0)circle(2.5cm);
    end{document}


    enter image description here






    share|improve this answer






























      up vote
      2
      down vote













      How about this?



      documentclass[tikz]{standalone}
      begin{document}
      begin{tikzpicture}
      node[rectangle,minimum size=20cm]{};
      draw(0,0)circle(5cm);
      end{tikzpicture}
      end{document}


      enter image description here






      share|improve this answer





















      • @lucky1928 This comment was for my answer?
        – nidhin
        Dec 5 at 19:36













      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',
      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%2f463366%2fdefine-tikzpicture-size-with-standalone-document-class%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      5
      down vote



      accepted










      Add a bounding box to the tikzpicture. Then you can freely arrange objects therein.



      documentclass[tikz]{standalone}
      begin{document}
      begin{tikzpicture}
      useasboundingbox (-5,-5) rectangle (5,5);
      filldraw (-5,-5) rectangle ++(1,1);
      draw(0,0)circle(2.5);
      end{tikzpicture}
      end{document}





      share|improve this answer



























        up vote
        5
        down vote



        accepted










        Add a bounding box to the tikzpicture. Then you can freely arrange objects therein.



        documentclass[tikz]{standalone}
        begin{document}
        begin{tikzpicture}
        useasboundingbox (-5,-5) rectangle (5,5);
        filldraw (-5,-5) rectangle ++(1,1);
        draw(0,0)circle(2.5);
        end{tikzpicture}
        end{document}





        share|improve this answer

























          up vote
          5
          down vote



          accepted







          up vote
          5
          down vote



          accepted






          Add a bounding box to the tikzpicture. Then you can freely arrange objects therein.



          documentclass[tikz]{standalone}
          begin{document}
          begin{tikzpicture}
          useasboundingbox (-5,-5) rectangle (5,5);
          filldraw (-5,-5) rectangle ++(1,1);
          draw(0,0)circle(2.5);
          end{tikzpicture}
          end{document}





          share|improve this answer














          Add a bounding box to the tikzpicture. Then you can freely arrange objects therein.



          documentclass[tikz]{standalone}
          begin{document}
          begin{tikzpicture}
          useasboundingbox (-5,-5) rectangle (5,5);
          filldraw (-5,-5) rectangle ++(1,1);
          draw(0,0)circle(2.5);
          end{tikzpicture}
          end{document}






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 5 at 19:41

























          answered Dec 5 at 19:33









          AlexG

          31.8k477141




          31.8k477141






















              up vote
              3
              down vote













              Add a 2.5 cm border on each side with the standalone option border=2.5cm, since 2.5cm+5cm+2.5 cm=10cm.



              documentclass[tikz,border=2.5cm]{standalone}
              begin{document}
              tikzdraw(0,0)circle(2.5cm);
              end{document}


              enter image description here






              share|improve this answer



























                up vote
                3
                down vote













                Add a 2.5 cm border on each side with the standalone option border=2.5cm, since 2.5cm+5cm+2.5 cm=10cm.



                documentclass[tikz,border=2.5cm]{standalone}
                begin{document}
                tikzdraw(0,0)circle(2.5cm);
                end{document}


                enter image description here






                share|improve this answer

























                  up vote
                  3
                  down vote










                  up vote
                  3
                  down vote









                  Add a 2.5 cm border on each side with the standalone option border=2.5cm, since 2.5cm+5cm+2.5 cm=10cm.



                  documentclass[tikz,border=2.5cm]{standalone}
                  begin{document}
                  tikzdraw(0,0)circle(2.5cm);
                  end{document}


                  enter image description here






                  share|improve this answer














                  Add a 2.5 cm border on each side with the standalone option border=2.5cm, since 2.5cm+5cm+2.5 cm=10cm.



                  documentclass[tikz,border=2.5cm]{standalone}
                  begin{document}
                  tikzdraw(0,0)circle(2.5cm);
                  end{document}


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Dec 5 at 19:36

























                  answered Dec 5 at 19:16









                  AndréC

                  6,89711140




                  6,89711140






















                      up vote
                      2
                      down vote













                      How about this?



                      documentclass[tikz]{standalone}
                      begin{document}
                      begin{tikzpicture}
                      node[rectangle,minimum size=20cm]{};
                      draw(0,0)circle(5cm);
                      end{tikzpicture}
                      end{document}


                      enter image description here






                      share|improve this answer





















                      • @lucky1928 This comment was for my answer?
                        – nidhin
                        Dec 5 at 19:36

















                      up vote
                      2
                      down vote













                      How about this?



                      documentclass[tikz]{standalone}
                      begin{document}
                      begin{tikzpicture}
                      node[rectangle,minimum size=20cm]{};
                      draw(0,0)circle(5cm);
                      end{tikzpicture}
                      end{document}


                      enter image description here






                      share|improve this answer





















                      • @lucky1928 This comment was for my answer?
                        – nidhin
                        Dec 5 at 19:36















                      up vote
                      2
                      down vote










                      up vote
                      2
                      down vote









                      How about this?



                      documentclass[tikz]{standalone}
                      begin{document}
                      begin{tikzpicture}
                      node[rectangle,minimum size=20cm]{};
                      draw(0,0)circle(5cm);
                      end{tikzpicture}
                      end{document}


                      enter image description here






                      share|improve this answer












                      How about this?



                      documentclass[tikz]{standalone}
                      begin{document}
                      begin{tikzpicture}
                      node[rectangle,minimum size=20cm]{};
                      draw(0,0)circle(5cm);
                      end{tikzpicture}
                      end{document}


                      enter image description here







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Dec 5 at 19:30









                      nidhin

                      2,659926




                      2,659926












                      • @lucky1928 This comment was for my answer?
                        – nidhin
                        Dec 5 at 19:36




















                      • @lucky1928 This comment was for my answer?
                        – nidhin
                        Dec 5 at 19:36


















                      @lucky1928 This comment was for my answer?
                      – nidhin
                      Dec 5 at 19:36






                      @lucky1928 This comment was for my answer?
                      – nidhin
                      Dec 5 at 19:36




















                      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.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • 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%2f463366%2fdefine-tikzpicture-size-with-standalone-document-class%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

                      "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                      Alcedinidae

                      Origin of the phrase “under your belt”?