TikZ 欧几里得问题

TikZ 欧几里得问题
\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}

在上面的代码中,如果我们删除符号,%则会在图形和标题之间产生巨大的垂直空间。如何删除这个空间以及为什么会出现这种情况?

答案1

问题是边界框还包含未绘制但用于构造圆弧的辅助点。您可以通过添加 来解决这个问题overlay

\documentclass[a4paper,11pt,openany]{book}
\usepackage{float}  % figure wont float anymore
\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}

在此处输入图片描述

答案2

tkz-euclide 3.02不需要使用overlay

\documentclass[a4paper,11pt,openany]{book}
\usepackage{float}  % figure wont float anymore
\usepackage{tkz-euclide}
\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}
\tkzDrawCircle[R,thick](O,5 cm)
\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[above](O)
\tkzLabelPoints[right](A,D,E)
\tkzLabelPoints[left](C)
\tkzLabelPoints[below left](B)
\end{tikzpicture}
\caption{}\label{banana}
\end{figure}
\end{document}

在此处输入图片描述

相关内容