Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
A red/blue shaded black hole! –  Hans-Peter E. Kristiansen Mar 27 '13 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 '13 at 14:34
    
@JLDiaz: It seems to depend on the viewer. I get it with reader 8 + 9 but not with sumatra. –  Ulrike Fischer Mar 27 '13 at 14:47
    
I don't get a "black hole" with evince. Just a zero width rectangle. –  Toscho Mar 27 '13 at 14:57
1  
The question title would be better for April 1st. :-) –  Martin Schröder Apr 2 '13 at 20:09

1 Answer 1

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}
share|improve this answer
    
Welcome to TeX.sx! –  Qrrbrbirlbel Mar 30 '13 at 22:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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