define tikzpicture size with standalone document class












3















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 '18 at 19:31











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

    – lucky1928
    Dec 5 '18 at 19:33











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

    – Sigur
    Dec 5 '18 at 19:34











  • yes, use specific size then draw on it.

    – lucky1928
    Dec 5 '18 at 19:36
















3















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 '18 at 19:31











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

    – lucky1928
    Dec 5 '18 at 19:33











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

    – Sigur
    Dec 5 '18 at 19:34











  • yes, use specific size then draw on it.

    – lucky1928
    Dec 5 '18 at 19:36














3












3








3








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 '18 at 19:05









lucky1928lucky1928

1,2091816




1,2091816








  • 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 '18 at 19:31











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

    – lucky1928
    Dec 5 '18 at 19:33











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

    – Sigur
    Dec 5 '18 at 19:34











  • yes, use specific size then draw on it.

    – lucky1928
    Dec 5 '18 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 '18 at 19:31











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

    – lucky1928
    Dec 5 '18 at 19:33











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

    – Sigur
    Dec 5 '18 at 19:34











  • yes, use specific size then draw on it.

    – lucky1928
    Dec 5 '18 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 '18 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 '18 at 19:31













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

– lucky1928
Dec 5 '18 at 19:33





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

– lucky1928
Dec 5 '18 at 19:33













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

– Sigur
Dec 5 '18 at 19:34





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

– Sigur
Dec 5 '18 at 19:34













yes, use specific size then draw on it.

– lucky1928
Dec 5 '18 at 19:36





yes, use specific size then draw on it.

– lucky1928
Dec 5 '18 at 19:36










3 Answers
3






active

oldest

votes


















5














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

































    3














    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

































      2














      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 '18 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',
      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%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









      5














      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






























        5














        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




























          5












          5








          5







          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 '18 at 19:41

























          answered Dec 5 '18 at 19:33









          AlexGAlexG

          32.6k479145




          32.6k479145























              3














              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






























                3














                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




























                  3












                  3








                  3







                  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 '18 at 19:36

























                  answered Dec 5 '18 at 19:16









                  AndréCAndréC

                  8,64211447




                  8,64211447























                      2














                      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 '18 at 19:36


















                      2














                      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 '18 at 19:36
















                      2












                      2








                      2







                      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 '18 at 19:30









                      nidhinnidhin

                      3,352927




                      3,352927













                      • @lucky1928 This comment was for my answer?

                        – nidhin
                        Dec 5 '18 at 19:36





















                      • @lucky1928 This comment was for my answer?

                        – nidhin
                        Dec 5 '18 at 19:36



















                      @lucky1928 This comment was for my answer?

                      – nidhin
                      Dec 5 '18 at 19:36







                      @lucky1928 This comment was for my answer?

                      – nidhin
                      Dec 5 '18 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.




                      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

                      How do I know what Microsoft account the skydrive app is syncing to?

                      When does type information flow backwards in C++?

                      Grease: Live!