13

While playing around with shadings I accidentally created a black hole (a zero-width rectangle) which ate all my pictures and text on the page:

\documentclass{article}
\usepackage{tikz}

\begin{document}
Still there: 
\begin{tikzpicture}
\draw[fill=red] (0,0)rectangle(2,2);
\end{tikzpicture}

The black hole:
\begin{tikzpicture}%zero width rectangle with shading:
\draw[left color=red, right color=blue] (2,0) rectangle (2,2);
\end{tikzpicture}

A picture lost in the black hole:
\begin{tikzpicture}
\draw[fill=blue] (0,0)rectangle(2,2);
\end{tikzpicture}

Some text lost in the black hole.
\end{document}

There are no errors in the log. The black hole ends with the page. I get it with all engines. The pdf opens without problem but gsview complains and don't open the ps.

I made a bug report but perhaps someone here is interested to find out what's going on.

12
  • A red/blue shaded black hole! Mar 27, 2013 at 14:28
  • I was rather disappointed that the black hole didn't eat anything in my tests... You can see yourself here. +1 nevertheless for the funny title and description
    – JLDiaz
    Mar 27, 2013 at 14:34
  • @JLDiaz: It seems to depend on the viewer. I get it with reader 8 + 9 but not with sumatra. Mar 27, 2013 at 14:47
  • I don't get a "black hole" with evince. Just a zero width rectangle.
    – Toscho
    Mar 27, 2013 at 14:57
  • 1
    The question title would be better for April 1st. :-) Apr 2, 2013 at 20:09

1 Answer 1

2

I think that the problem is that you set the x dimension of the second rectancular at 0. Try this:

\documentclass{article}
\usepackage{tikz}

\begin{document}
Still there: 
\begin{tikzpicture}
\draw[fill=red] (0,0)rectangle(2,2);
\end{tikzpicture}

The black hole:
\begin{tikzpicture}%zero width rectangle with shading:
\draw[left color=red, right color=blue] (2,0) rectangle (4,2);
\end{tikzpicture}

A picture lost in the black hole:
\begin{tikzpicture}
\draw[fill=blue] (0,0)rectangle(2,2);
\end{tikzpicture}

Some text lost in the black hole.
\end{document}
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .