3

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

  • This is a strange behavior. If you leave the geometry package away, the backtick also disappears. I have no idea. – Jan Jan 24 '17 at 8:36
  • Remove left=1.5cm, and there and no backtick. – Ross Jan 24 '17 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 '17 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. – Ulrike Fischer Jan 26 '17 at 15:05
  • Thank you. I understand now why I did'nt have this problem in the last years ... – Oli Jan 26 '17 at 18:46
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}
  • 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 '17 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 '17 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.