Graphics, Figures & Tableswrapfigure isn't wrapping

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
j.e. turcotte
Posts: 3
Joined: Fri Aug 14, 2009 8:02 pm

wrapfigure isn't wrapping

Post by j.e. turcotte »

Hello... please see the following [almost certainly ill-educated] latex. Ever since we were forced (for and external reason) over to pdflatex, we've had to move away from epsfig to graphicx, and change our syntax away from a table based layout to the following (on the presumption that the image 'edging to the document margins' was freaking out our hylafax faxing server (of course, I've not had any success sending tests like the following EITHER even though there appears to be no problem OTHER than overlapping text and image... but that's not what i'm trying to fix in this forum post)).

Please draft up a 250px by 320px .png of your own as that is the same dimenion as our images. Anyhow... the image should dominate the right, forcing a couple of the lines on the left to wrap to a new line. However, whenever I try, I see the two overlapping in contrast to ALL documentation out there I can find on the topic of either wrapfigure OR wraptable says should be happening.

Having to deal with these things so infrequently, I'm not particularly conversant in LaTeX, so I really don't know what I'm doing wrong, much less how to fix it.

Thanks

...

Code: Select all

\documentclass[11pt]{letter}
\usepackage{vmargin}
\usepackage{wrapfig}
\usepackage[pdftex]{graphicx}
\DeclareGraphicsExtensions{.png}
\begin{document}
\setmargnohfrb{1in}{1in}{1in}{.9in}
\begin{letter}

\begin{wrapfigure}{r}{0.6\textwidth}
\begin{center}
\includegraphics[width=0.58\textwidth]{250x320.png}
\end{center}
\end{wrapfigure}

\LARGE
{\bfseries
TO:}

{\mdseries
Mister So and So and So}

{\bigskip\bfseries
FROM:}

{\mdseries
Mr. So and So}

{\mdseries
38 Example Rd.}

{\mdseries
Example, MA 01000}

{\bfseries
\textmd{(111) 111 - 1111}}

{\bigskip\bfseries
DATE:}

{\mdseries
August 5, 2009}

{\bigskip\bfseries
RE:}

{\mdseries
Your Example of Example Examples}

{\bigskip\bigskip\bigskip\bigskip\bigskip\LARGE\bfseries
Comments:}

{\mdseries\fontfamily{augie}\selectfont
Here is a bunch of text and a bunch of text and a bunch of text and a bunch of text and a bunch of text and a bunch of text and a bunch of text and a bunch of text and a bunch of text and an example too.}

\end{letter}
\end{document}
\bye

Recommended reading 2024:

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

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

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

wrapfigure isn't wrapping

Post by frabjous »

For some reason someone else may be able to explain, it seems to work better if you use \textbf{...} and \textmd{...} rather than {\bfseries ...} and {\mdseries ...}

Code: Select all

    \documentclass[11pt]{letter}
    \usepackage{vmargin}
    \usepackage{wrapfig}
    \usepackage{lipsum}
    \usepackage[pdftex]{graphicx}
    \DeclareGraphicsExtensions{.png}
    \begin{document}
    \setmargnohfrb{1in}{1in}{1in}{.9in}
    \begin{letter}

    \begin{wrapfigure}[12]{r}{0.6\textwidth}
    \begin{center}
    \includegraphics[width=0.58\textwidth]{250x320.png}
    \end{center}
    \end{wrapfigure}
    \LARGE
    \textbf{TO:}

    \textmd{%
    Mister So and So and So}

    \bigskip\textbf{%
    FROM:}

    \textmd{%
    Mr. So and So}

    \textmd{%
    38 Example Rd.}

    \textmd{%
    Example, MA 01000}

    \textbf{%
    \textmd{(111) 111 - 1111}}

    \bigskip\textbf{%
    DATE:}

    \textmd{%
    August 5, 2009}

    \bigskip\textbf{%
    RE:}

    \textmd{%
    Your Example of Example Examples}

    \bigskip\bigskip\bigskip\bigskip\bigskip\LARGE\textbf{%
    Comments:}

    \textmd{\fontfamily{augie}\selectfont
    Here is a bunch of text and a bunch of text and a bunch of text and a bunch of text and a bunch of text and a bunch of text and a bunch of text and a bunch of text and a bunch of text and an example too.}

    \end{letter}
    \end{document}
    \bye
I haven't used this document class, but doesn't it have special commands for the "to:" and "from:" fields as well?
j.e. turcotte
Posts: 3
Joined: Fri Aug 14, 2009 8:02 pm

wrapfigure isn't wrapping

Post by j.e. turcotte »

thanks for the attempt; unfortunately I get:

Code: Select all

pdflatex 21.tex 
This is pdfTeX, Version 3.14159-1.10b (Web2C 7.4.5)
(./21.tex{/usr/share/texmf/pdftex/config/pdftex.cfg}
LaTeX2e <2001/06/01>
Babel <v3.7h> and hyphenation patterns for american, french, german, ngerman, n
ohyphenation, loaded.
(/usr/share/texmf/tex/latex/base/letter.cls
Document Class: letter 1999/04/29 v1.2z Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size11.clo))
(/usr/share/texmf/tex/latex/misc/vmargin.sty
Package: vmargin 2000/08/01 V2.3 (VK) set document margins
) (/usr/share/texmf/tex/latex/misc/wrapfig.sty)

! LaTeX Error: File `lipsum.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
We seem to be lacking this package/style
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: wrapfigure isn't wrapping

Post by frabjous »

Oops, that's a package I was using when testing -- it produces random text. You can just delete the line that reads \usepackage{lipsum}.

Incidentally, however, you seem to be using an old version of LaTeX, so you might want to update.
j.e. turcotte
Posts: 3
Joined: Fri Aug 14, 2009 8:02 pm

Re: wrapfigure isn't wrapping

Post by j.e. turcotte »

hay hay hay, you win!

Thanks a lot; now I only need to figure out why hylafax (we fax the pdf results) dies when trying to send the darn thing... but that's a whole other monster likely unrelated to LaTeX anyways.
Post Reply