6

Edit: I did compile this document:

\documentclass[DIV14,parskip=half-]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}

\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}

\usepackage{showframe}

\begin{document}

\fbox{\begin{tikzpicture}
        \tkzDefPoint(0, 0){A}
        \tkzDefPoint(4, 0){B}
        \tkzDefPoint(6, 3.5){C}
        \tkzDefPoint(2, 3.5){D}
        \draw (0, 0) node[below left] {A} -- (4, 0) node[below right] {B} -- (6, 3.5) node[above right] {C} -- (2, 3.5) node[above left] {D} -- cycle;
        \tkzCircumCenter(A,B,D)
        \tkzGetPoint{O}
        \tkzDrawCircle(O,A)
        \tkzCircumCenter(A,C,D)
        \tkzGetPoint{O}
        \tkzDrawCircle(O,A)
\end{tikzpicture}}

\end{document}

and got this output:

image of output

With this code, TiKZ generates an image nearly twice as high as needed. Above the picture is a large whitespace. Where does it come from?

Original Code:

\documentclass[DIV14,parskip=half-]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}

\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}

\begin{tikzpicture}
        \draw (0, 0) grid (10, 10);
        \tkzDefPoint(0, 0){A}
        \tkzDefPoint(4, 0){B}
        \tkzDefPoint(6, 3.5){C}
        \tkzDefPoint(2, 3.5){D}
        \draw (0, 0) node[below left] {A} -- (4, 0) node[below right] {B} -- (6, 3.5) node[above right] {C} -- (2, 3.5) node[above left] {D} -- cycle;
        \tkzCircumCenter(A,B,D)
        \tkzGetPoint{O}
        \tkzDrawCircle(O,A)
        \tkzCircumCenter(A,C,D)
        \tkzGetPoint{O}
        \tkzDrawCircle(O,A)
\end{tikzpicture}

\end{document}
  • 1
    Surround your tikzpicture with \fbox{} and put \usepackage{showframe} in your preamble. Like this you will see that there is no whitespace above your image. If it persists, update your TeX-Distribution or show us eventually missing code. – LaRiFaRi Jul 25 '14 at 07:40
  • I don't see any spurious white space when I typeset the document on Ubuntu 12.04, with an added preview environment: http://cl.ly/Wk1m – Habi Jul 25 '14 at 07:41
  • 2
    Sorry, it was my mistake: I did see some spurious whitespace at first and added the grid in ignorance of the fact that the grid itself is interpreted as part of the picture. – chaosflaws Jul 25 '14 at 07:42
  • Still, there seems to be a problem to me. See updated question. – chaosflaws Jul 25 '14 at 07:50
  • 1
    See http://tex.stackexchange.com/questions/134718 http://tex.stackexchange.com/questions/130193 – Torbjørn T. Jul 25 '14 at 08:00

1 Answers1

6

The unneeded white space comes from the command \tkzCircumCenter(...). An invisible path is used for the construction of the circle Center. It enlarges the bounding box.

You can patch this command using the package etoolbox

\usepackage{etoolbox}
\pretocmd\tkzCircumCenter{\begin{pgfinterruptboundingbox}}{}{}
\apptocmd\tkzCircumCenter{\end{pgfinterruptboundingbox}}{}{}

enter image description here

Code:

\documentclass{scrartcl}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}

\usepackage{etoolbox}
\pretocmd\tkzCircumCenter{\begin{pgfinterruptboundingbox}}{}{}
\apptocmd\tkzCircumCenter{\end{pgfinterruptboundingbox}}{}{}

\begin{document}

\fbox{\begin{tikzpicture}
        \tkzDefPoint(0, 0){A}
        \tkzDefPoint(4, 0){B}
        \tkzDefPoint(6, 3.5){C}
        \tkzDefPoint(2, 3.5){D}
        \draw (0, 0) node[below left] {A} -- (4, 0) node[below right] {B} -- (6, 3.5) node[above right] {C} -- (2, 3.5) node[above left] {D} -- cycle;
        \tkzCircumCenter(A,B,D)
        \tkzGetPoint{O}
        \tkzDrawCircle(O,A)
        \tkzCircumCenter(A,C,D)
        \tkzGetPoint{O}
        \tkzDrawCircle(O,A)
\end{tikzpicture}}

\end{document}
esdd
  • 85,675