2

I want to decrease distance between from the side BC to bottom of border, I tried with no border, but there is white space below side BC. This is my code

\documentclass[12pt]{standalone}
\usepackage{fouriernc}
\usepackage{tkz-euclide}
\usetkzobj{all}
%\tikzset{hidden/.style = {thin, dotted}}
\tikzset{hidden/.style = {thick, dashed}}
\tkzSetUpPoint[size = 10,fill = black]
\begin{document}
\begin{tikzpicture}[scale=1]
\tkzDefPoints{0/0/A,
6/0/D,
-3/-3/B,
3/-3/C,
1/5/S,
1/-2/H}
\tkzDefLine[parallel=through H](A,D)
 \tkzGetPoint{d}
 \tkzDefLine[parallel=through H](A,B)
 \tkzGetPoint{l}
\tkzInterLL(d,H)(A,B) \tkzGetPoint{M}
\tkzInterLL(d,H)(C,D) \tkzGetPoint{N}
\tkzInterLL(l,H)(C,B) \tkzGetPoint{P}
\tkzInterLL(l,H)(A,D) \tkzGetPoint{Q}
\tkzLabelPoints[above](S, Q)
\tkzLabelPoints[right](N,D)
\tkzLabelPoints[left](A)
\tkzLabelPoints[below](B,C,H,M,P)
\tkzDrawPoints(S,A,B,C,D,H,M,N,P,Q)
\tkzDrawSegments[hidden](S,A A,B A,D S,H M,N P,Q A,H B,H C,H D,H)
\tkzDrawPolygon[line width = 1.2pt](S,B,C)
\tkzDrawPolygon[line width = 1.2pt](S,C,D)
\tkzLabelSegment[below=2pt](B,P){$x$}
\tkzLabelSegment[below=2pt](C,P){$y$}
\tkzLabelSegment[right=4pt](C,N){$z$}
\tkzLabelSegment[right=4pt](D,N){$t$}
\end{tikzpicture}
\end{document} 

How can I decrease this white spaces?

enter image description here

1 Answers1

0

You can fix the bounding box early on:

enter image description here

The ideal place to do it would immediately after the coordinates B, D and S are labelled but before the rest of the drawing, but as I am not that familiar with tkz-euclide I just used the given coordinate and added some padding.

What is happening is that some of the drawing is using points/paths that are not shown which is resulting in a larger bounding box. The use as bounding box sets the bounding box which is not effected by any further drawings.

Code:

\documentclass[12pt]{standalone}
\usepackage{fouriernc}
\usepackage{tkz-euclide}
\usetkzobj{all}
%\tikzset{hidden/.style = {thin, dotted}}
\tikzset{hidden/.style = {thick, dashed}}
\tkzSetUpPoint[size = 10,fill = black]
\begin{document}
\begin{tikzpicture}[scale=1]
\tkzDefPoints{0/0/A,
6/0/D,
-3/-3/B,
3/-3/C,
1/5/S,
1/-2/H}

%% --------------------------------------------- Add padding around the points. \coordinate (B') at ([shift={(-10pt, -20pt)}]B); \coordinate (D') at ([shift={(20pt, 0)}]D); \coordinate (S') at ([shift={(0pt, 15pt)}]S); \draw [use as bounding box] (B') -| (D') |- (S') -| (B');% Fix the bounding box %% ---------------------------------------------

\tkzDefLineparallel=through H \tkzGetPoint{d} \tkzDefLineparallel=through H \tkzGetPoint{l}

\tkzInterLL(d,H)(A,B) \tkzGetPoint{M} \tkzInterLL(d,H)(C,D) \tkzGetPoint{N} \tkzInterLL(l,H)(C,B) \tkzGetPoint{P} \tkzInterLL(l,H)(A,D) \tkzGetPoint{Q} \tkzLabelPoints[above](S, Q) \tkzLabelPointsright \tkzLabelPointsleft \tkzLabelPointsbelow \tkzDrawPoints(S,A,B,C,D,H,M,N,P,Q) \tkzDrawSegments[hidden](S,A A,B A,D S,H M,N P,Q A,H B,H C,H D,H) \tkzDrawPolygonline width = 1.2pt \tkzDrawPolygonline width = 1.2pt \tkzLabelSegmentbelow=2pt{$x$} \tkzLabelSegmentbelow=2pt{$y$} \tkzLabelSegmentright=4pt{$z$} \tkzLabelSegmentright=4pt{$t$} \end{tikzpicture}% \end{document}

Peter Grill
  • 223,288