\documentclass[a4paper,11pt,openany]{book}
\usepackage{float}  % figure wont float anymore
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{xcolor}
\usepackage{geometry}
\geometry{paperwidth=21cm,paperheight=29.7cm, body={18cm,25.7cm}, top=2.5cm, left=1.5cm}
\usepackage{hyperref}
\usepackage{caption}
\captionsetup[figure]{labelsep=space}


\begin{document}
\chapter{Angles}

\begin{figure}[H]\centering
\begin{tikzpicture}[scale=0.35]
\tkzDefPoint(0,0){O}
\tkzDefPoint(-4.2,2.71293199){C}
\tkzDefPoint(4,3){E}
\tkzDefPoint(3,-4){D}
\tkzDefPoint(0,-5){B}
\tkzInterLL(B,C)(E,D) \tkzGetPoint{A}
\draw[thick] (O)node[above]{$O$} circle[radius=5];
\tkzInterLL(A,B)(C,D) \tkzGetPoint{I};
\tkzDrawPoints[color=black](A,B,C,D,E,O)
%\tkzMarkAngle[color=red](D,A,B);
\tkzDrawLine(A,C)
\tkzDrawLine(A,E)
\tkzLabelPoints[right](A,D,E)
\tkzLabelPoints[left](C)
\tkzLabelPoints[below left](B)
\end{tikzpicture}
\caption{}\label{banana}
\end{figure}
\end{document}

In the above code, if we remove the % symbol we obtain a huge vertical space between the figure and the caption. How to remove this space and why does it behave like this?

up vote 3 down vote accepted

The issue is that the bounding box also includes auxiliary points that are not drawn, but used to construct the arc. You can cure this by adding overlay.

\documentclass[a4paper,11pt,openany]{book}
\usepackage{float}  % figure wont float anymore
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usepackage{xcolor}
\usepackage{geometry}
\geometry{paperwidth=21cm,paperheight=29.7cm, body={18cm,25.7cm}, top=2.5cm, left=1.5cm}
\usepackage{hyperref}
\usepackage{caption}
\captionsetup[figure]{labelsep=space}


\begin{document}
\chapter{Angles}

\begin{figure}[H]\centering
\begin{tikzpicture}[scale=0.35]
\tkzDefPoint(0,0){O}
\tkzDefPoint(-4.2,2.71293199){C}
\tkzDefPoint(4,3){E}
\tkzDefPoint(3,-4){D}
\tkzDefPoint(0,-5){B}
\tkzInterLL(B,C)(E,D) \tkzGetPoint{A}
\draw[thick] (O)node[above]{$O$} circle[radius=5];
\tkzInterLL(A,B)(C,D) \tkzGetPoint{I};
\tkzDrawPoints[color=black](A,B,C,D,E,O)
\tkzMarkAngle[color=red,overlay](D,A,B);
\tkzDrawLine(A,C)
\tkzDrawLine(A,E)
\tkzLabelPoints[right](A,D,E)
\tkzLabelPoints[left](C)
\tkzLabelPoints[below left](B)
\end{tikzpicture}
\caption{}\label{banana}
\end{figure}
\end{document}

enter image description here

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.