Graphics, Figures & TablesHow to wrap a tikz picture?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
drowsy
Posts: 44
Joined: Tue Dec 23, 2008 6:00 am

How to wrap a tikz picture?

Post by drowsy »

Hi,

how can I wrap my text around a tikz picture?

The picture is a tall and narrow diagram column.

I tried wrapfig and floatflt, but they produce compilation errors.
Last edited by drowsy on Mon Jan 26, 2009 7:53 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to wrap a tikz picture?

Post by localghost »

Please build a minimal working example (MWE) to show this undesired behaviour. Attach the log file if necessary. To simplify this task, you can replace your picture by drawing a grid.

Code: Select all

\draw[style=help lines] (-3,-10) grid (3,10);
Longer text passages can be generated with the blindtext package.


Best regards
Thorsten¹
drowsy
Posts: 44
Joined: Tue Dec 23, 2008 6:00 am

How to wrap a tikz picture?

Post by drowsy »

Well, wrapfig compiles, but it says:
\begin{wrapfigure}{l}{10cm}
\begin{tikzpicture}

Package wrapfig Warning: wrapfigure used inside a conflicting environment on in
put line 8.


Package wrapfig Warning: Stationary wrapfigure forced to float on input line 34
.
Basically, it moves the picture like 14 pages later.

I will produce a MWE, but the document is very large, so it takes time to make it minimal.

In the meantime, can you tell me what works for you?
This might help faster and better then requesting MWEs...
drowsy
Posts: 44
Joined: Tue Dec 23, 2008 6:00 am

Re: How to wrap a tikz picture?

Post by drowsy »

ok, the problem was that I put it inside a very long definition
environment and did not notice that.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to wrap a tikz picture?

Post by localghost »

drowsy wrote:Well, wrapfig compiles, but it says:

Code: Select all

Package wrapfig Warning: wrapfigure used inside a conflicting environment on in
put line 8.


Package wrapfig Warning: Stationary wrapfigure forced to float on input line 34
.
In your initial post you talked about errors. But these messages are (only) warnings.
drowsy wrote:[...] In the meantime, can you tell me what works for you?
This might help faster and better then requesting MWEs [...]
A MWE should always show what you are doing wrong and not what is working for me. Another point is that I'm not intended to give a solution immediately. It would have no learning effect. Nevertheless you get my MWE with wrapfig.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[margin=2cm]{geometry}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{tikz}
\usepackage{wrapfig}
\usepackage{lmodern}
\usepackage{blindtext}

\parindent0em

\begin{document}
  \begin{wrapfigure}{r}{7cm}
    \centering
    \begin{tikzpicture}
      \draw[style=help lines] (-3,-8) grid (3,8);
    \end{tikzpicture}
    \caption{Tall and narrow figure}\label{fig:tnfigure}
  \end{wrapfigure}
  \blindtext[4]
\end{document}
The dimensions of the picture can of course be adapted.
drowsy
Posts: 44
Joined: Tue Dec 23, 2008 6:00 am

How to wrap a tikz picture?

Post by drowsy »

localghost wrote: In your initial post you talked about errors.
I did, but the very first sentence was asking for an example.
Hi,

how can I wrap my text around a tikz picture?
Anyway, thank you. Problem solved ;)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to wrap a tikz picture?

Post by localghost »

drowsy wrote:[...] the very first sentence was asking for an example [...]
But you also talked about compilation and your own efforts. And I'm still interested in these efforts in the sense of a MWE.
drowsy
Posts: 44
Joined: Tue Dec 23, 2008 6:00 am

How to wrap a tikz picture?

Post by drowsy »

localghost wrote: And I'm still interested in these efforts in the sense of a MWE.
Huh? See my earlier post, the problem was that I had a loooong
definition(did not notice it) and a float inside.
Post Reply