4

In the example below, I have a problem between the geometry setting and wrapfig and the \setlength{\columnsep}{0pt} command. When removing either the \geometry{...} or the \setlength{...} command, there is no problem.

EDIT : The problem occurs whith LaTeX but not with pdfLaTeX.

Near the question 3 a symbol ` is comming from somewhere ...

How to solve this?

\documentclass[a4paper,10pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[a4paper,centering,reversemarginpar]{geometry}
\usepackage{pstricks-add}
\usepackage[french]{babel} %german,francais
\usepackage{wrapfig}

\geometry{top=1cm,left=1.5cm,bottom=1cm,footskip=.5cm}

\begin{document}


\setlength{\columnsep}{0pt}%
\begin{wrapfigure}{r}{0pt}
\begin{pspicture}(-5,-1)(5,5)
Essai
\end{pspicture}
\end{wrapfigure}
Soit un segment [AB] de longueur 8 cm et le demi-cercle C de diamètre [AB], de centre O.
M est un point de demi-cercle C et H est le pied de la hauteur issue de M dans le triangle AOM.
On souhaite savoir où placer le point M pour que l'aire du triangle soit égale à 4.
\par\smallskip
On note $x=\rm AH$ et on appelle $f$ la fonction qui modélise l'aire de AOM.
\begin{enumerate}
\item A quel ensemble appartient la variable $x$ ?
\item 
\begin{enumerate}
\item Exprimer $f(x)$ en fonction de AO et MH.
\item En utilisant le théorème de Pythagore montrer que ${\rm MH}^2=16-(4-x)^2$.
\item En déduire une expression de $f(x)$.
\end{enumerate}
\item 
\begin{enumerate}
\item Montrer que le problème posé revient à résoudre ${\rm MH}^2=4$
\item Résoudre dans R l'équation $X^2=12$
\end{enumerate}
\item Résoudre le problème posé.
\end{enumerate}


\end{document}

My document

5
  • This is a strange behavior. If you leave the geometry package away, the backtick also disappears. I have no idea.
    – Jan
    Jan 24, 2017 at 8:36
  • Remove left=1.5cm, and there and no backtick.
    – Ross
    Jan 24, 2017 at 9:07
  • Thank you for your answer. When removing \setlength{\columnsep}{0pt}% there is no backtick too ... But this is not a solution for me : how to set the left margin now ? Is this this is a bug from "geometry" ?
    – Oli
    Jan 24, 2017 at 12:29
  • The problem occurs with pdflatex too -- you only need a suitable sized graphic. E.g. I can get it with \fbox{\rule{10cm}{5cm}. Your wrapfig overlaps a list and depending on the exact place where the graphic ends you get unwanted side-effects -- that's why it works when you change the geometry. Adding e.g. \par\medskip before the problematic \item helps too. Jan 26, 2017 at 15:05
  • Thank you. I understand now why I did'nt have this problem in the last years ...
    – Oli
    Jan 26, 2017 at 18:46

2 Answers 2

2

Adding \WFclear at the end of the second enumerate seems to fix it. I would still avoid using list environments which overlap wrapfig in any way.

\documentclass[a4paper,10pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[a4paper,centering,reversemarginpar]{geometry}
\usepackage{pstricks-add}
\usepackage[french]{babel} %german,francais
\usepackage{wrapfig}

\geometry{top=1cm,left=1.5cm,bottom=1cm,footskip=.5cm}

\begin{document}


\setlength{\columnsep}{0pt}%
\begin{wrapfigure}{r}{0pt}
\fbox{\begin{pspicture}(-5,-1)(5,5)
Essai
\end{pspicture}}
\end{wrapfigure}
Soit un segment [AB] de longueur 8 cm et le demi-cercle C de diamètre [AB], de centre O.
M est un point de demi-cercle C et H est le pied de la hauteur issue de M dans le triangle AOM.
On souhaite savoir où placer le point M pour que l'aire du triangle soit égale à 4.
\par\smallskip
On note $x=\rm AH$ et on appelle $f$ la fonction qui modélise l'aire de AOM.
\begin{enumerate}
\item A quel ensemble appartient la variable $x$ ?
\item 
\begin{enumerate}
\item Exprimer $f(x)$ en fonction de AO et MH.
\item En utilisant le théorème de Pythagore montrer que ${\rm MH}^2=16-(4-x)^2$.
\item En déduire une expression de $f(x)$.
\end{enumerate}\WFclear
\item 
\begin{enumerate}
\item Montrer que le problème posé revient à résoudre ${\rm MH}^2=4$
\item Résoudre dans R l'équation $X^2=12$
\end{enumerate}
\item Résoudre le problème posé.
\end{enumerate}

\end{document}
2
  • Thank you. I use wrapfig and enulmerate for a long time and I never had this strange bug. It occurs with LaTeX (and XeLaTeX) but not with pdfLaTeX. And as said before, not when "left=1.5cm" is removed in geometry. It's amazing ! Is this a known bug ???
    – Oli
    Jan 24, 2017 at 17:06
  • The konwn problem with wrapfig and enumerate or itemize is when the wrafigure is putted inside the enumerate. But here it is outside.
    – Oli
    Jan 24, 2017 at 17:11
1

The macro \WF@fudgeparshape should be corrected: it misses \parshape after \WF@finale:

\def\WF@fudgeparshape{\relax \ifnum\c@WF@wrappedlines<\tw@ \WF@finale
        \parshape   %%% <<<<< Missed in the original
  \else \afterassignment\WF@fudgeparshapee \fam \fi}

P.S. Well, \WF@finale is also buggy — but it is a different story!

3
  • Thank you for your answer. Will this update be integrated in the package update ?
    – Oli
    Dec 23, 2019 at 8:31
  • I’m afraid to ask… The date of 2003 on the package tells a lot… Is Donald active now? Dec 23, 2019 at 8:57
  • This problem and another T.SE report of Delta appearing in \intertext are the same problem. I tracked down the missing \parshape (for the Delta problem). Why didn't anyone report the bug? Even with just a link to here. Thanks @IlyaZakharevich for tracking the problem too (but no report from you either). I am working on wrapfig now. What about \WF@finale? Apr 10, 2020 at 10:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .