tikz : too much white space over tikzpicture
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
MWE .
I do not understand why there is too much blank space on the image.Any advice on how to fix it .Thx
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
begindocument
fbox
begintikzpicture
tkzInittkzClip[space = 1]
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
endtikzpicture
enddocument
tikz-pgf tkz-euclide
add a comment |Â
up vote
2
down vote
favorite
MWE .
I do not understand why there is too much blank space on the image.Any advice on how to fix it .Thx
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
begindocument
fbox
begintikzpicture
tkzInittkzClip[space = 1]
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
endtikzpicture
enddocument
tikz-pgf tkz-euclide
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
MWE .
I do not understand why there is too much blank space on the image.Any advice on how to fix it .Thx
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
begindocument
fbox
begintikzpicture
tkzInittkzClip[space = 1]
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
endtikzpicture
enddocument
tikz-pgf tkz-euclide
MWE .
I do not understand why there is too much blank space on the image.Any advice on how to fix it .Thx
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
begindocument
fbox
begintikzpicture
tkzInittkzClip[space = 1]
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
endtikzpicture
enddocument
tikz-pgf tkz-euclide
tikz-pgf tkz-euclide
asked 56 mins ago
robintux
263
263
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
I didn't try to track down the exact source of the problem, but it is a known problem, that the bounding box not only takes into account all visible objects, but also coordinates used in the computation of paths etc. I think this might also be the issue here.
As a workaround, remove tkzInittkzClip[space = 1]
and wrap everything which should not influence the bounding box in a pgfinterruptboundingbox
environment.
If you want the bounding box to be a bit bigger than the triangle, you could add path ([xshift=-1cm,yshift=-1cm]current bounding box.south west) ([xshift=1cm,yshift=1cm]current bounding box.north east);
as suggested by @marmot in his comment below.
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
pgfplotssetcompat=1.16
begindocument
fbox
begintikzpicture
% tkzInittkzClip[space = 1]
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
beginpgfinterruptboundingbox
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
endpgfinterruptboundingbox
path ([xshift=-1cm,yshift=-1cm]current bounding box.south west) ([xshift=1cm,yshift=1cm]current bounding box.north east);
endtikzpicture
enddocument
@marmot Added. Thanks a lot for the suggestion
â samcarter
36 mins ago
add a comment |Â
up vote
1
down vote
In addition to the solution given by @samcarter, it is enough to frame the figure with a rectangle draw(-1,-1)rectangle(11,7);
without using a fbox
to solve this problem.
Edit: thanks a lot to marmot who saw the error I hadn't seen!
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
begindocument
%fbox
begintikzpicture
tkzInit[xmax=10,ymax=6]
tkzClip[space = 1]
draw(-1,-1)rectangle(11,7);
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
%beginpgfinterruptboundingbox
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
%endpgfinterruptboundingbox
endtikzpicture
%
enddocument
1
Sorry, all your proposal does is to add a hard coded rectangle. The bounding box is still too large since it also has the points in that are relevant to the path construction. To see what I mean, adddraw[red] (current bounding box.south west) rectangle (current bounding box.north east);
at the end of the tikz code. I work with pdflatex.
â marmot
9 mins ago
@marmot When I compile the document this way with pdflatex on MikTex I get the result shown. What are you working with?
â AndréC
6 mins ago
1
Could you please adddraw[red] (current bounding box.south west) rectangle (current bounding box.north east);
just beforeendtikzpicture
and show what you get then?
â marmot
4 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
I didn't try to track down the exact source of the problem, but it is a known problem, that the bounding box not only takes into account all visible objects, but also coordinates used in the computation of paths etc. I think this might also be the issue here.
As a workaround, remove tkzInittkzClip[space = 1]
and wrap everything which should not influence the bounding box in a pgfinterruptboundingbox
environment.
If you want the bounding box to be a bit bigger than the triangle, you could add path ([xshift=-1cm,yshift=-1cm]current bounding box.south west) ([xshift=1cm,yshift=1cm]current bounding box.north east);
as suggested by @marmot in his comment below.
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
pgfplotssetcompat=1.16
begindocument
fbox
begintikzpicture
% tkzInittkzClip[space = 1]
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
beginpgfinterruptboundingbox
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
endpgfinterruptboundingbox
path ([xshift=-1cm,yshift=-1cm]current bounding box.south west) ([xshift=1cm,yshift=1cm]current bounding box.north east);
endtikzpicture
enddocument
@marmot Added. Thanks a lot for the suggestion
â samcarter
36 mins ago
add a comment |Â
up vote
3
down vote
I didn't try to track down the exact source of the problem, but it is a known problem, that the bounding box not only takes into account all visible objects, but also coordinates used in the computation of paths etc. I think this might also be the issue here.
As a workaround, remove tkzInittkzClip[space = 1]
and wrap everything which should not influence the bounding box in a pgfinterruptboundingbox
environment.
If you want the bounding box to be a bit bigger than the triangle, you could add path ([xshift=-1cm,yshift=-1cm]current bounding box.south west) ([xshift=1cm,yshift=1cm]current bounding box.north east);
as suggested by @marmot in his comment below.
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
pgfplotssetcompat=1.16
begindocument
fbox
begintikzpicture
% tkzInittkzClip[space = 1]
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
beginpgfinterruptboundingbox
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
endpgfinterruptboundingbox
path ([xshift=-1cm,yshift=-1cm]current bounding box.south west) ([xshift=1cm,yshift=1cm]current bounding box.north east);
endtikzpicture
enddocument
@marmot Added. Thanks a lot for the suggestion
â samcarter
36 mins ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
I didn't try to track down the exact source of the problem, but it is a known problem, that the bounding box not only takes into account all visible objects, but also coordinates used in the computation of paths etc. I think this might also be the issue here.
As a workaround, remove tkzInittkzClip[space = 1]
and wrap everything which should not influence the bounding box in a pgfinterruptboundingbox
environment.
If you want the bounding box to be a bit bigger than the triangle, you could add path ([xshift=-1cm,yshift=-1cm]current bounding box.south west) ([xshift=1cm,yshift=1cm]current bounding box.north east);
as suggested by @marmot in his comment below.
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
pgfplotssetcompat=1.16
begindocument
fbox
begintikzpicture
% tkzInittkzClip[space = 1]
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
beginpgfinterruptboundingbox
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
endpgfinterruptboundingbox
path ([xshift=-1cm,yshift=-1cm]current bounding box.south west) ([xshift=1cm,yshift=1cm]current bounding box.north east);
endtikzpicture
enddocument
I didn't try to track down the exact source of the problem, but it is a known problem, that the bounding box not only takes into account all visible objects, but also coordinates used in the computation of paths etc. I think this might also be the issue here.
As a workaround, remove tkzInittkzClip[space = 1]
and wrap everything which should not influence the bounding box in a pgfinterruptboundingbox
environment.
If you want the bounding box to be a bit bigger than the triangle, you could add path ([xshift=-1cm,yshift=-1cm]current bounding box.south west) ([xshift=1cm,yshift=1cm]current bounding box.north east);
as suggested by @marmot in his comment below.
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
pgfplotssetcompat=1.16
begindocument
fbox
begintikzpicture
% tkzInittkzClip[space = 1]
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
beginpgfinterruptboundingbox
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
endpgfinterruptboundingbox
path ([xshift=-1cm,yshift=-1cm]current bounding box.south west) ([xshift=1cm,yshift=1cm]current bounding box.north east);
endtikzpicture
enddocument
edited 36 mins ago
answered 45 mins ago
samcarter
78.9k787253
78.9k787253
@marmot Added. Thanks a lot for the suggestion
â samcarter
36 mins ago
add a comment |Â
@marmot Added. Thanks a lot for the suggestion
â samcarter
36 mins ago
@marmot Added. Thanks a lot for the suggestion
â samcarter
36 mins ago
@marmot Added. Thanks a lot for the suggestion
â samcarter
36 mins ago
add a comment |Â
up vote
1
down vote
In addition to the solution given by @samcarter, it is enough to frame the figure with a rectangle draw(-1,-1)rectangle(11,7);
without using a fbox
to solve this problem.
Edit: thanks a lot to marmot who saw the error I hadn't seen!
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
begindocument
%fbox
begintikzpicture
tkzInit[xmax=10,ymax=6]
tkzClip[space = 1]
draw(-1,-1)rectangle(11,7);
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
%beginpgfinterruptboundingbox
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
%endpgfinterruptboundingbox
endtikzpicture
%
enddocument
1
Sorry, all your proposal does is to add a hard coded rectangle. The bounding box is still too large since it also has the points in that are relevant to the path construction. To see what I mean, adddraw[red] (current bounding box.south west) rectangle (current bounding box.north east);
at the end of the tikz code. I work with pdflatex.
â marmot
9 mins ago
@marmot When I compile the document this way with pdflatex on MikTex I get the result shown. What are you working with?
â AndréC
6 mins ago
1
Could you please adddraw[red] (current bounding box.south west) rectangle (current bounding box.north east);
just beforeendtikzpicture
and show what you get then?
â marmot
4 mins ago
add a comment |Â
up vote
1
down vote
In addition to the solution given by @samcarter, it is enough to frame the figure with a rectangle draw(-1,-1)rectangle(11,7);
without using a fbox
to solve this problem.
Edit: thanks a lot to marmot who saw the error I hadn't seen!
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
begindocument
%fbox
begintikzpicture
tkzInit[xmax=10,ymax=6]
tkzClip[space = 1]
draw(-1,-1)rectangle(11,7);
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
%beginpgfinterruptboundingbox
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
%endpgfinterruptboundingbox
endtikzpicture
%
enddocument
1
Sorry, all your proposal does is to add a hard coded rectangle. The bounding box is still too large since it also has the points in that are relevant to the path construction. To see what I mean, adddraw[red] (current bounding box.south west) rectangle (current bounding box.north east);
at the end of the tikz code. I work with pdflatex.
â marmot
9 mins ago
@marmot When I compile the document this way with pdflatex on MikTex I get the result shown. What are you working with?
â AndréC
6 mins ago
1
Could you please adddraw[red] (current bounding box.south west) rectangle (current bounding box.north east);
just beforeendtikzpicture
and show what you get then?
â marmot
4 mins ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
In addition to the solution given by @samcarter, it is enough to frame the figure with a rectangle draw(-1,-1)rectangle(11,7);
without using a fbox
to solve this problem.
Edit: thanks a lot to marmot who saw the error I hadn't seen!
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
begindocument
%fbox
begintikzpicture
tkzInit[xmax=10,ymax=6]
tkzClip[space = 1]
draw(-1,-1)rectangle(11,7);
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
%beginpgfinterruptboundingbox
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
%endpgfinterruptboundingbox
endtikzpicture
%
enddocument
In addition to the solution given by @samcarter, it is enough to frame the figure with a rectangle draw(-1,-1)rectangle(11,7);
without using a fbox
to solve this problem.
Edit: thanks a lot to marmot who saw the error I hadn't seen!
documentclassarticle
usepackagetkz-euclide
usetkzobjall
usepackagepgfplots
usetikzlibrarycalc,patterns,angles,quotes,arrows,intersections,through,backgrounds,arrows.meta,positioning,math,babel
begindocument
%fbox
begintikzpicture
tkzInit[xmax=10,ymax=6]
tkzClip[space = 1]
draw(-1,-1)rectangle(11,7);
tkzPoint[pos = left](0,0)A
tkzPoint[pos = above](4,6)B
tkzPoint[pos = right](10,0)C
tkzDrawPolygon(A,B,C)
%beginpgfinterruptboundingbox
tkzInCenter(A,B,C) tkzGetPointI
tkzDefPointBy[projection=onto B--C](I)
tkzGetPointH
tkzDefPointBy[projection=onto A--C](I)
tkzGetPointK
tkzDefPointBy[projection=onto A--B](I)
tkzGetPointL
tkzDrawSegments[dotted](I,L I,H I,K)
tkzDrawSegments[dashed](I,A I,B I,C)
tkzDrawCircle(I,H)
tkzMarkRightAngles%
[fill=gray!10,](I,L,B B,H,I C,K,I)
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--B--H;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = L--B--I;
tkzLabelAngle[pos=0.7,](H,B,I)$alpha$;
tkzLabelAngle[pos=0.7,](L,B,I)$alpha$;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = K--A--I;
pic[draw=black,text=black,-,angle eccentricity=0.7,angle radius=0.5cm]angle = I--A--L;
tkzLabelAngle[pos=0.7,](L,A,I)$beta$;
tkzLabelAngle[pos=0.7,](I,A,K)$beta$;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = H--C--I;
pic[draw=black,text=black,-,angle eccentricity=0.1,angle radius=0.7cm]angle = I--C--K;
tkzLabelAngle[pos=1,](H,C,I)$gamma$;
tkzLabelAngle[pos=1,](I,C,K)$gamma$;
%endpgfinterruptboundingbox
endtikzpicture
%
enddocument
edited 22 secs ago
answered 19 mins ago
AndréC
4,072833
4,072833
1
Sorry, all your proposal does is to add a hard coded rectangle. The bounding box is still too large since it also has the points in that are relevant to the path construction. To see what I mean, adddraw[red] (current bounding box.south west) rectangle (current bounding box.north east);
at the end of the tikz code. I work with pdflatex.
â marmot
9 mins ago
@marmot When I compile the document this way with pdflatex on MikTex I get the result shown. What are you working with?
â AndréC
6 mins ago
1
Could you please adddraw[red] (current bounding box.south west) rectangle (current bounding box.north east);
just beforeendtikzpicture
and show what you get then?
â marmot
4 mins ago
add a comment |Â
1
Sorry, all your proposal does is to add a hard coded rectangle. The bounding box is still too large since it also has the points in that are relevant to the path construction. To see what I mean, adddraw[red] (current bounding box.south west) rectangle (current bounding box.north east);
at the end of the tikz code. I work with pdflatex.
â marmot
9 mins ago
@marmot When I compile the document this way with pdflatex on MikTex I get the result shown. What are you working with?
â AndréC
6 mins ago
1
Could you please adddraw[red] (current bounding box.south west) rectangle (current bounding box.north east);
just beforeendtikzpicture
and show what you get then?
â marmot
4 mins ago
1
1
Sorry, all your proposal does is to add a hard coded rectangle. The bounding box is still too large since it also has the points in that are relevant to the path construction. To see what I mean, add
draw[red] (current bounding box.south west) rectangle (current bounding box.north east);
at the end of the tikz code. I work with pdflatex.â marmot
9 mins ago
Sorry, all your proposal does is to add a hard coded rectangle. The bounding box is still too large since it also has the points in that are relevant to the path construction. To see what I mean, add
draw[red] (current bounding box.south west) rectangle (current bounding box.north east);
at the end of the tikz code. I work with pdflatex.â marmot
9 mins ago
@marmot When I compile the document this way with pdflatex on MikTex I get the result shown. What are you working with?
â AndréC
6 mins ago
@marmot When I compile the document this way with pdflatex on MikTex I get the result shown. What are you working with?
â AndréC
6 mins ago
1
1
Could you please add
draw[red] (current bounding box.south west) rectangle (current bounding box.north east);
just before endtikzpicture
and show what you get then?â marmot
4 mins ago
Could you please add
draw[red] (current bounding box.south west) rectangle (current bounding box.north east);
just before endtikzpicture
and show what you get then?â marmot
4 mins ago
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f456741%2ftikz-too-much-white-space-over-tikzpicture%23new-answer', 'question_page');
);
Post as a guest
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
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
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