When there is not enough space for TikZ picture at the end of a text, it will goes to the next page, and leaves an empty space after the text. Is there a standard method for putting TikZ picture in the middle of text, flowing the text to the next page, instead of pushing TikZ picture?
A possible method is using wrapfig page, to put TikZ picture inside wrapfigure. This is a flexible method for floating smaller (e.g. half-sized) TikZ picture within text. I am curious if there is a simpler method for arranging full-width TikZ picture within text to avoid any gap throughout the text.
Here is a very simple example:
\documentclass{article}
\usepackage{mdframed}
\usepackage{lipsum}
\usepackage{tikz}
\begin{document}
\begin{mdframed}
\lipsum[1-2]
\begin{tikzpicture}
\draw[fill=blue] (0,0) rectangle (11,11);
\end{tikzpicture}
\end{mdframed}
\end{document}
Since the TikZ picture does not fit in the first page, it will goes to the second page and leave an empty space at the bottom of first page. I want to keep the TikZ picture in the first page, and push the excess text to the second page.
In a long text with several TikZ pictures, I want to avoid any gap within the text.
tikzpicturewithin afigureenvironment? – cmhughes Jun 03 '12 at 22:49mdframedand simply addedtikzpictureat the end of my text. – Googlebot Jun 03 '12 at 22:50\documentclassand the appropriate packages so that those trying to help don't have to recreate it.This will also serve as a test case and ensure that the solution actually works for you.
– Peter Grill Jun 04 '12 at 00:35overlay). But when the box is in the flow, it's a TeX's box and you need to use the tools linked to floats, figures etc. This is the problem to place a box or a figure in the flow. With pdftex, there are several limitations and this problem is sometimes not easy. – Alain Matthes Jun 04 '12 at 08:33figureenvironment around yourtikzpicture. – Stephan Lehmke Jun 04 '12 at 08:55wrapfigto do so. I just asked this question to find if there is a simpler approach for this purpose. – Googlebot Jun 04 '12 at 09:08wrapfigis good for narrow pictures, but not for full-width ones.figure(which you can use without a dedicated package) is for full-width pictures. – Stephan Lehmke Jun 04 '12 at 09:11{figure}with an{mdframed}environment won’t work … – Tobi Jun 04 '12 at 09:36wrapfig, and am looking for a better solution. This isfloat within floatand leads to! LaTeX Error: Not in outer par mode.– Googlebot Jun 04 '12 at 09:41mdframedwithtcolorbox?tcolorboxis absolutely awesome, but it is not as flexible asmdframedlike spreading the frame over multiple pages. – Googlebot Jun 04 '12 at 10:21mdframedat all in the text, but it changes the situation drastically! There is no need to append new material with an "Edit" headline. It's normally much better to simply rephrase the exiting part as required. Older revisions of every posts are still accessible anyway. – Martin Scharrer Jun 07 '12 at 10:59