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
    yesterday










  • I mean use fixed picture size to draw something on it.
    – lucky1928
    yesterday










  • So, you want to draw any picture on a page sized 10x10?
    – Sigur
    yesterday










  • yes, use specific size then draw on it.
    – lucky1928
    yesterday















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
    yesterday










  • I mean use fixed picture size to draw something on it.
    – lucky1928
    yesterday










  • So, you want to draw any picture on a page sized 10x10?
    – Sigur
    yesterday










  • yes, use specific size then draw on it.
    – lucky1928
    yesterday













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 yesterday









lucky1928

1,1751716




1,1751716








  • 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
    yesterday










  • I mean use fixed picture size to draw something on it.
    – lucky1928
    yesterday










  • So, you want to draw any picture on a page sized 10x10?
    – Sigur
    yesterday










  • yes, use specific size then draw on it.
    – lucky1928
    yesterday














  • 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
    yesterday










  • I mean use fixed picture size to draw something on it.
    – lucky1928
    yesterday










  • So, you want to draw any picture on a page sized 10x10?
    – Sigur
    yesterday










  • yes, use specific size then draw on it.
    – lucky1928
    yesterday








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
yesterday




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
yesterday












I mean use fixed picture size to draw something on it.
– lucky1928
yesterday




I mean use fixed picture size to draw something on it.
– lucky1928
yesterday












So, you want to draw any picture on a page sized 10x10?
– Sigur
yesterday




So, you want to draw any picture on a page sized 10x10?
– Sigur
yesterday












yes, use specific size then draw on it.
– lucky1928
yesterday




yes, use specific size then draw on it.
– lucky1928
yesterday










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
        yesterday













      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 yesterday

























          answered yesterday









          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 yesterday

























                  answered yesterday









                  AndréC

                  6,79711140




                  6,79711140






















                      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
                        yesterday

















                      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
                        yesterday















                      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 yesterday









                      nidhin

                      2,189923




                      2,189923












                      • @lucky1928 This comment was for my answer?
                        – nidhin
                        yesterday




















                      • @lucky1928 This comment was for my answer?
                        – nidhin
                        yesterday


















                      @lucky1928 This comment was for my answer?
                      – nidhin
                      yesterday






                      @lucky1928 This comment was for my answer?
                      – nidhin
                      yesterday




















                      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

                      Morgemoulin

                      Scott Moir

                      Souastre