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: double lines are shiftedtikz 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
A steel cutting sword?
Is the derivative with respect to a fermion field Grassmann-odd?
How to use libraries with delays inside within a time critical STM32 HAL application?
Why aren't space telescopes put in GEO?
Grammar Question Regarding "Are the" or "Is the" When Referring to Something that May or May not be Plural
Count rotary dial pulses in a phone number (including letters)
Why is this Simple Puzzle impossible to solve?
Would Jetfuel for a modern jet like an F-16 or a F-35 be producable in the WW2 era?
Is it rude to call a professor by their last name with no prefix in a non-academic setting?
Is Jon Snow the last of his House?
Gladys goes shopping
Why did David Cameron offer a referendum on the European Union?
Is the field of q-series 'dead'?
Installed Tankless Water Heater - Internet loss when active
number headings
Plot twist where the antagonist wins
Why would Ryanair allow me to book this journey through a third party, but not through their own website?
Purpose and meaning of "dabei" in the sentence "sehen Sie dabei nicht ins Bildlexikon"?
Did the UK Government ask for the Irish backstop?
NIntegrate doesn't evaluate
How to deal with a colleague who is being aggressive?
Boss wants me to falsify a report. How should I document this unethical demand?
Should breaking down something like a door be adjudicated as an attempt to beat its AC and HP, or as an ability check against a set DC?
What are the real benefits of using Salesforce DX?
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: double lines are shiftedtikz 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
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
add a comment |
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
add a comment |
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
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
tikz-pgf
asked May 20 at 1:24
bp2017bp2017
1,181116
1,181116
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
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
This does not have any unnecessary gap. If you uncomment
path[draw,red](n1.north east)--(n1.north west);
you get
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.
See also loopspace answer here tex.stackexchange.com/a/130472/2388 regarding "exact bounding box".
– Ulrike Fischer
May 20 at 7:06
@UlrikeFischer Yes, but this doesn't work for Bezier curves AFAIK
– marmot
May 20 at 12:03
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
This does not have any unnecessary gap. If you uncomment
path[draw,red](n1.north east)--(n1.north west);
you get
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.
See also loopspace answer here tex.stackexchange.com/a/130472/2388 regarding "exact bounding box".
– Ulrike Fischer
May 20 at 7:06
@UlrikeFischer Yes, but this doesn't work for Bezier curves AFAIK
– marmot
May 20 at 12:03
add a comment |
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
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
This does not have any unnecessary gap. If you uncomment
path[draw,red](n1.north east)--(n1.north west);
you get
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.
See also loopspace answer here tex.stackexchange.com/a/130472/2388 regarding "exact bounding box".
– Ulrike Fischer
May 20 at 7:06
@UlrikeFischer Yes, but this doesn't work for Bezier curves AFAIK
– marmot
May 20 at 12:03
add a comment |
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
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
This does not have any unnecessary gap. If you uncomment
path[draw,red](n1.north east)--(n1.north west);
you get
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.
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
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
This does not have any unnecessary gap. If you uncomment
path[draw,red](n1.north east)--(n1.north west);
you get
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.
edited May 20 at 1:54
answered May 20 at 1:28
marmotmarmot
130k6164312
130k6164312
See also loopspace answer here tex.stackexchange.com/a/130472/2388 regarding "exact bounding box".
– Ulrike Fischer
May 20 at 7:06
@UlrikeFischer Yes, but this doesn't work for Bezier curves AFAIK
– marmot
May 20 at 12:03
add a comment |
See also loopspace answer here tex.stackexchange.com/a/130472/2388 regarding "exact bounding box".
– Ulrike Fischer
May 20 at 7:06
@UlrikeFischer Yes, but this doesn't work for Bezier curves AFAIK
– marmot
May 20 at 12:03
See also loopspace answer here tex.stackexchange.com/a/130472/2388 regarding "exact bounding box".
– Ulrike Fischer
May 20 at 7:06
See also loopspace answer here tex.stackexchange.com/a/130472/2388 regarding "exact bounding box".
– Ulrike Fischer
May 20 at 7:06
@UlrikeFischer Yes, but this doesn't work for Bezier curves AFAIK
– marmot
May 20 at 12:03
@UlrikeFischer Yes, but this doesn't work for Bezier curves AFAIK
– marmot
May 20 at 12:03
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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