How to eliminate gap at the start and at the end of a line when it's drawn along a side of a node's bounding box?tikz bounding box / cropping: too much space for curvesHow to define the default vertical distance between nodes?Define tikz node based on pagenodesComputing the rectangle encompassing a node and a pointNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionDraw a transparency gradient arc over a rectangle with tikzDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?beginfigure… endfigure is not working with tikz package

Department head said that group project may be rejected. How to mitigate?

What is the required burn to keep a satellite at a Lagrangian point?

Can diplomats be allowed on the flight deck of a commercial European airline?

why "American-born", not "America-born"?

What is this dime sized black bug with white on the segments near Loveland Colorodao?

Is a world with one country feeding everyone possible?

Why is this python script running in background consuming 100 % CPU?

Palindromic Pan digital Special Square wants you to reveal its Root

Team member is vehemently against code formatting

Why do the i8080 I/O instructions take a byte-sized operand to determine the port?

Why is unzipped file smaller than zipped file

Efficient Algorithms for Destroyed Document Reconstruction

What does it mean for something to be strictly less than epsilon for an arbitrary epsilon?

A nasty indefinite integral

Computing elements of a 1000 x 60 matrix exhausts RAM

Find this Unique UVC Palindrome ( ignoring signs and decimal) from Given Fractional Relationship

JavaScript: Access 'this' when calling function stored in variable

(For training purposes) Are there any openings with rook pawns that are more effective than others (and if so, what are they)?

Split into three!

Why is Ni[(PPh₃)₂Cl₂] tetrahedral?

Nunc est bibendum: gerund or gerundive?

If a character has cast the Fly spell on themselves, can they "hand off" to the Levitate spell without interruption?

How would a physicist explain this starship engine?

"Official wife" or "Formal wife"?



How to eliminate gap at the start and at the end of a line when it's drawn along a side of a node's bounding box?


tikz bounding box / cropping: too much space for curvesHow to define the default vertical distance between nodes?Define tikz node based on pagenodesComputing the rectangle encompassing a node and a pointNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionDraw a transparency gradient arc over a rectangle with tikzDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?beginfigure… endfigure is not working with tikz package













1















There are some gaps.



documentclassstandalone
usepackagetikz
begindocument
begintikzpicture
path node(n1)text;
path[draw](n1.north east)--(n1.north west);
% uncomment following line to see gaps clearly
%path[draw](n1.north west)--(n1.south west);
endtikzpicture
enddocument











share|improve this question


























    1















    There are some gaps.



    documentclassstandalone
    usepackagetikz
    begindocument
    begintikzpicture
    path node(n1)text;
    path[draw](n1.north east)--(n1.north west);
    % uncomment following line to see gaps clearly
    %path[draw](n1.north west)--(n1.south west);
    endtikzpicture
    enddocument











    share|improve this question
























      1












      1








      1








      There are some gaps.



      documentclassstandalone
      usepackagetikz
      begindocument
      begintikzpicture
      path node(n1)text;
      path[draw](n1.north east)--(n1.north west);
      % uncomment following line to see gaps clearly
      %path[draw](n1.north west)--(n1.south west);
      endtikzpicture
      enddocument











      share|improve this question














      There are some gaps.



      documentclassstandalone
      usepackagetikz
      begindocument
      begintikzpicture
      path node(n1)text;
      path[draw](n1.north east)--(n1.north west);
      % uncomment following line to see gaps clearly
      %path[draw](n1.north west)--(n1.south west);
      endtikzpicture
      enddocument








      tikz-pgf






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 3 hours ago









      bp2017bp2017

      966116




      966116




















          1 Answer
          1






          active

          oldest

          votes


















          3














          documentclass[tikz]standalone
          begindocument
          begintikzpicture
          path node(n1)text;
          path[draw,line cap=rect](n1.north east)--(n1.north west);
          % uncomment following line to see gaps clearly
          %path[draw](n1.north west)--(n1.south west);
          endtikzpicture
          enddocument


          enter image description here



          What is going on here? Let's start with



          documentclass[tikz]standalone
          begindocument
          begintikzpicture
          path node[draw](n1)text;
          path[fill=blue](n1.north east) circle[radius=0.1pt]
          (n1.north west)circle[radius=0.1pt];
          path[draw,red](n1.north east)--(n1.north west);
          endtikzpicture
          enddocument


          enter image description here



          This does not have any unnecessary gap. If you uncomment



           path[draw,red](n1.north east)--(n1.north west);


          you get



          enter image description here



          So the gap is there. This is because TikZ is rather "generous" with the bounding box, here it adds the "natural extension" of the line which emerges when you do line cap=rect. Note that the bounding box gets much more "overestimated", see e.g. here. AFAIK there is no built-in way to obtain the exact bounding box.






          share|improve this answer




















          • 1





            @JouleV I added a longe explanation together with links to related posts.

            – marmot
            3 hours ago











          • @JouleV Thanks! I fixed it. (This html editor drives me insane.)

            – marmot
            3 hours ago











          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%2f491679%2fhow-to-eliminate-gap-at-the-start-and-at-the-end-of-a-line-when-its-drawn-along%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          documentclass[tikz]standalone
          begindocument
          begintikzpicture
          path node(n1)text;
          path[draw,line cap=rect](n1.north east)--(n1.north west);
          % uncomment following line to see gaps clearly
          %path[draw](n1.north west)--(n1.south west);
          endtikzpicture
          enddocument


          enter image description here



          What is going on here? Let's start with



          documentclass[tikz]standalone
          begindocument
          begintikzpicture
          path node[draw](n1)text;
          path[fill=blue](n1.north east) circle[radius=0.1pt]
          (n1.north west)circle[radius=0.1pt];
          path[draw,red](n1.north east)--(n1.north west);
          endtikzpicture
          enddocument


          enter image description here



          This does not have any unnecessary gap. If you uncomment



           path[draw,red](n1.north east)--(n1.north west);


          you get



          enter image description here



          So the gap is there. This is because TikZ is rather "generous" with the bounding box, here it adds the "natural extension" of the line which emerges when you do line cap=rect. Note that the bounding box gets much more "overestimated", see e.g. here. AFAIK there is no built-in way to obtain the exact bounding box.






          share|improve this answer




















          • 1





            @JouleV I added a longe explanation together with links to related posts.

            – marmot
            3 hours ago











          • @JouleV Thanks! I fixed it. (This html editor drives me insane.)

            – marmot
            3 hours ago















          3














          documentclass[tikz]standalone
          begindocument
          begintikzpicture
          path node(n1)text;
          path[draw,line cap=rect](n1.north east)--(n1.north west);
          % uncomment following line to see gaps clearly
          %path[draw](n1.north west)--(n1.south west);
          endtikzpicture
          enddocument


          enter image description here



          What is going on here? Let's start with



          documentclass[tikz]standalone
          begindocument
          begintikzpicture
          path node[draw](n1)text;
          path[fill=blue](n1.north east) circle[radius=0.1pt]
          (n1.north west)circle[radius=0.1pt];
          path[draw,red](n1.north east)--(n1.north west);
          endtikzpicture
          enddocument


          enter image description here



          This does not have any unnecessary gap. If you uncomment



           path[draw,red](n1.north east)--(n1.north west);


          you get



          enter image description here



          So the gap is there. This is because TikZ is rather "generous" with the bounding box, here it adds the "natural extension" of the line which emerges when you do line cap=rect. Note that the bounding box gets much more "overestimated", see e.g. here. AFAIK there is no built-in way to obtain the exact bounding box.






          share|improve this answer




















          • 1





            @JouleV I added a longe explanation together with links to related posts.

            – marmot
            3 hours ago











          • @JouleV Thanks! I fixed it. (This html editor drives me insane.)

            – marmot
            3 hours ago













          3












          3








          3







          documentclass[tikz]standalone
          begindocument
          begintikzpicture
          path node(n1)text;
          path[draw,line cap=rect](n1.north east)--(n1.north west);
          % uncomment following line to see gaps clearly
          %path[draw](n1.north west)--(n1.south west);
          endtikzpicture
          enddocument


          enter image description here



          What is going on here? Let's start with



          documentclass[tikz]standalone
          begindocument
          begintikzpicture
          path node[draw](n1)text;
          path[fill=blue](n1.north east) circle[radius=0.1pt]
          (n1.north west)circle[radius=0.1pt];
          path[draw,red](n1.north east)--(n1.north west);
          endtikzpicture
          enddocument


          enter image description here



          This does not have any unnecessary gap. If you uncomment



           path[draw,red](n1.north east)--(n1.north west);


          you get



          enter image description here



          So the gap is there. This is because TikZ is rather "generous" with the bounding box, here it adds the "natural extension" of the line which emerges when you do line cap=rect. Note that the bounding box gets much more "overestimated", see e.g. here. AFAIK there is no built-in way to obtain the exact bounding box.






          share|improve this answer















          documentclass[tikz]standalone
          begindocument
          begintikzpicture
          path node(n1)text;
          path[draw,line cap=rect](n1.north east)--(n1.north west);
          % uncomment following line to see gaps clearly
          %path[draw](n1.north west)--(n1.south west);
          endtikzpicture
          enddocument


          enter image description here



          What is going on here? Let's start with



          documentclass[tikz]standalone
          begindocument
          begintikzpicture
          path node[draw](n1)text;
          path[fill=blue](n1.north east) circle[radius=0.1pt]
          (n1.north west)circle[radius=0.1pt];
          path[draw,red](n1.north east)--(n1.north west);
          endtikzpicture
          enddocument


          enter image description here



          This does not have any unnecessary gap. If you uncomment



           path[draw,red](n1.north east)--(n1.north west);


          you get



          enter image description here



          So the gap is there. This is because TikZ is rather "generous" with the bounding box, here it adds the "natural extension" of the line which emerges when you do line cap=rect. Note that the bounding box gets much more "overestimated", see e.g. here. AFAIK there is no built-in way to obtain the exact bounding box.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 3 hours ago

























          answered 3 hours ago









          marmotmarmot

          128k6162308




          128k6162308







          • 1





            @JouleV I added a longe explanation together with links to related posts.

            – marmot
            3 hours ago











          • @JouleV Thanks! I fixed it. (This html editor drives me insane.)

            – marmot
            3 hours ago












          • 1





            @JouleV I added a longe explanation together with links to related posts.

            – marmot
            3 hours ago











          • @JouleV Thanks! I fixed it. (This html editor drives me insane.)

            – marmot
            3 hours ago







          1




          1





          @JouleV I added a longe explanation together with links to related posts.

          – marmot
          3 hours ago





          @JouleV I added a longe explanation together with links to related posts.

          – marmot
          3 hours ago













          @JouleV Thanks! I fixed it. (This html editor drives me insane.)

          – marmot
          3 hours ago





          @JouleV Thanks! I fixed it. (This html editor drives me insane.)

          – marmot
          3 hours ago

















          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%2f491679%2fhow-to-eliminate-gap-at-the-start-and-at-the-end-of-a-line-when-its-drawn-along%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

          Log på Navigationsmenu

          Wonderful Copenhagen (sang) Eksterne henvisninger | NavigationsmenurSide på frankloesser.comWonderful Copenhagen

          Detroit Tigers Spis treści Historia | Skład zespołu | Sukcesy | Członkowie Baseball Hall of Fame | Zastrzeżone numery | Przypisy | Menu nawigacyjneEncyclopedia of Detroit - Detroit TigersTigers Stadium, Detroit, MITigers Timeline 1900sDetroit Tigers Team History & EncyclopediaTigers Timeline 1910s1935 World Series1945 World Series1945 World Series1984 World SeriesComerica Park, Detroit, MI2006 World Series2012 World SeriesDetroit Tigers 40-Man RosterDetroit Tigers Coaching StaffTigers Hall of FamersTigers Retired Numberse