Page Layoutwrapfig, titlesec | Wrapped Figure near Section Heading

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
CoolnessItself
Posts: 47
Joined: Wed Nov 11, 2009 9:30 pm

wrapfig, titlesec | Wrapped Figure near Section Heading

Post by CoolnessItself »

Code: Select all

\documentclass{article}
\usepackage{blindtext}
\usepackage[nobottomtitles]{titlesec}
\usepackage{wrapfig}

\begin{document}
\section{blah}
\Blindtext 

\begin{wrapfigure}{R}{0.2\textwidth}
\rule{2cm}{2cm}
\end{wrapfigure}


\section{blah}
\Blindtext 

\end{document}
Without titlesec or without the sections, it works fine. Otherwise, latex acts like there is another wrapfigure at the beginning of each paragraph for the remainder of the document.
Attachments
titlesec-wrapfig.png
titlesec-wrapfig.png (73.54 KiB) Viewed 4441 times
Last edited by localghost on Tue Jan 24, 2012 10:19 am, 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.

crdafisica
Posts: 10
Joined: Thu Jun 26, 2008 4:25 am

wrapfig, titlesec | Wrapped Figure near Section Heading

Post by crdafisica »

Hi,

The problem can be solved by putting the wrapfigure command after the beginning of the section. That way only the first paragraph will have the desired effect.

Regards

Code: Select all

\documentclass{article}
\usepackage{blindtext}
\usepackage[nobottomtitles]{titlesec}
\usepackage{wrapfig}

\begin{document}

\section{blah}

\Blindtext 

\section{blahblah}

\begin{wrapfigure}{R}{0.2\textwidth}
\rule{2cm}{2cm}
\end{wrapfigure}

\Blindtext 

\end{document}
MadEgg
Posts: 5
Joined: Wed Feb 04, 2009 4:13 pm

Re: wrapfig, titlesec | Wrapped Figure near Section Heading

Post by MadEgg »

I have the same problem, but this suggestion does not help me. I doesn't matter how many text, sections or subsections I put above the wrapfigure, it still acts like there is a wrapped figure in every paragraph from then on.

Also, I shouldn't change the contents/structure of my document to use a package, right? What is the cause of the problem? There should be some neater way to fix this, right?
crdafisica
Posts: 10
Joined: Thu Jun 26, 2008 4:25 am

Re: wrapfig, titlesec | Wrapped Figure near Section Heading

Post by crdafisica »

Hi MadEgg,

Sometimes there are incompatibilities between commands in a specific kind of document. Maybe you can write a minimum working example and post here. Otherwise will be difficult for me to understand your problem since you could be using several different packages and document classes.
Have you tried to compile the code I've suggested ? What happened? This could be useful to find out if the problem is in your document or its the latex distribution itself.
Are your latex packages up to date ?

Regards
Post Reply