# [OS X TeX] Text floating around a figure

Don Green Dragon fergdc at Shaw.ca
Thu Jun 5 21:32:17 EDT 2014

Hi Herb,

Sorry to be so slow in answering. Thanks to your examples, I found out what was wrong in my example, plus a couple of other facts that I found surprising.

By good luck, my preamble contained the four lines

\documentclass{book}
\usepackage{amsmath}
\usepackage{picinpar}
\usepackage{tikz}

and in the order above. Only difference is that I’m using {book} for the document class whereas you used {article}. The form of the command that I used was

\begin{figwindow}
[2, l, \tikz \draw (0,0) circle (3 pt); , {Run around Circle} ]

which contains two errors:

1) You cannot have whitespace immediately after \begin{figwindow} Not even a single space.

2) In the case of using a \tikz command, you must enclose the command with { and }.

In other words, once I changed the format to

\begin{figwindow}[2, l, {\tikz \draw (0,0) circle (3 pt); } , {Run around Circle} ]

then I no longer obtained the error message

>>>> ================
>>>> ./LaTeXbookShort.tex:662: Use of \figwindow doesn't match its definition.
>>>> l.662 \begin{figwindow}
>>>>
>>>> ?
>>>> ==================

but the PDF was a mess because I had not specified a sufficient width’ for the graphic. Changing (3 pt) to (30 pt) made a big improvement.

However, the error described as 1) results in the graphic appearing but in a totally unsatisfactory location if you continue to ignore the error messages until the PDF appears.

In the examples in The LaTeX Companion, they supplied sufficient width for the graphic either by using \fbox{…} in the first example and in the second they specified a width within the \includegraphics command.

A last point is that the caption — «Run around Circle» in my example — does not have to be enclosed with { and } as I had guessed. However, unless you don’t mind the caption barging into the «run-around-text» then you must allow sufficient width  for the caption as well as the graphic. For example

\begin{figwindow}[2, l, {\tikz \draw (0,0) -- (2,1); } , Slanting Segment]
. . . text for run around . . .
\end{figwindow}

results in an ugly while

\begin{figwindow}[2, l, {\tikz \draw (0,0) — (3,1);} , Slanting Segment]
. . . text for run around . . .
\end{figwindow}

is much better. I found that when specifying the graphic via \includegraphics it was not necessary to surround with { and }, but no objection if used.

Well, thanks for those examples, they sure helped me,  and being able to use \begin{window} and \begin{figwindow} will be wonderful.

However, in testing, I cannot get the graphic centred or shifted to the right margin using the characters l’ or r’. The graphic remains at the left margin for both {window} and {figwindow}.

Can you centre and right align them in your setup?

On 27May2014, at 1:54 AM, Herbert Schulz <herbs at wideopenwest.com> wrote:

>
> On May 27, 2014, at 2:42 AM, Herbert Schulz <herbs at wideopenwest.com> wrote:
>
>>
>> On May 27, 2014, at 2:24 AM, Herbert Schulz <herbs at wideopenwest.com> wrote:
>>
>>>
>>> On May 26, 2014, at 10:24 PM, Don Green Dragon <fergdc at shaw.ca> wrote:
>>>
>>>> Hi Herb,
>>>>
>>>> In reply to Andre, Herb wrote
>>>>
>>>>> Howdy,
>>>>>
>>>>> Well, the package is called pininpar not picins. I just ran
>>>>>
>>>>> %%!TEX TS-program = pdflatex
>>>>> \documentclass{article}
>>>>> \usepackage{picinpar}
>>>>> \usepackage{floatflt}
>>>>> \begin{document}
>>>>> Hello World
>>>>> \end{document}
>>>>>
>>>>
>>>> Are you implying that the environments
>>>>
>>>> \begin{window} . . . \end{window}    or    \begin{figwindow} . . . \end{figwindow}
>>>>
>>>> actually work in your set up?
>>>>
>>>> Is it necessary to include \usepackage{floatflt}?
>>>>
>>>> I have tried to use the two examples in The LaTeX Companion, pages 108–109, but no luck. Despite the examples, I am not sure of the required format for either \begin{window}  or \begin{figwindow}. Here is a short version that I tried
>>>>
>>>> \begin{figwindow}
>>>> [2, l, \tikz \draw (0,0) circle (3 pt); , {Run around Circle} ]
>>>> At least six lines of text that is supposed to flow around the small circle. Circle to be at the left margin.
>>>> \end{figwindow}
>>>>
>>>> The error message is:
>>>> ================
>>>> ./LaTeXbookShort.tex:662: Use of \figwindow doesn't match its definition.
>>>> l.662 \begin{figwindow}
>>>>
>>>> ?
>>>> ==================
>>>> I tried adding the line \usepackage{floatflt} to the preamble but that did not help. I removed the caption {Run around Circle} and that made no difference.
>>>>
>>>> Can anyone point out the syntax error?
>>>>
>>>>
>>>> don green dragon
>>>> fergdc at shaw.ca
>>>
>>> Howdy,
>>>
>>> How old is the post you copied that from? It looks as though there was a problem of load order rather than use of those packages that I was discussing but I can't be sure.
>>>
>>> Finally, did you try to put the drawing inside braces or in an \mbox so that it appears as a single argument? The comma in the \tikz command could be misinterpreted by the argument parser.
>>>
>>> Good Luck,
>>>
>>> Herb Schulz
>>> (herbs at wideopenwest dot com)
>>>
>>
>> Howdy,
>>
>> Enclosed is a file that uses the example on page 108 of The LaTeX Companion'. I doubled the length of the paragraph since the text width is much larger than the example given.
>>
>> <picinparTest.tex>
>>
>> Good Luck,
>>
>> Herb Schulz
>> (herbs at wideopenwest dot com)
>
> Howdy,
>
> And here is your example with the tikz circle (made at 40pt rather than 3 points).
>
> <picinparTest.tex>
>
> Good Luck,
> <<snip>>

don green dragon
fergdc at shaw.ca