# Why autoref lets text ignore wrapfigure [closed]

I just ran into a problem concerning autoref in combination with the wrapfigure environment of the wrapfig package.

Minimal example:

\documentclass{article}

\usepackage{wrapfig}
\usepackage{hyperref}
\usepackage[demo]{graphicx}

\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}

\begin{wrapfigure}{R}{0.5\textwidth}
\includegraphics[width=0.5\textwidth]{}
\end{wrapfigure}

\autoref{ref} % arbitrary reference
\blindtext

\end{document}


The result looks like:

               ######################
REFtextextextex|extextextextextext  |
textextextextex|extextextextextext  |
textextextextex|...                 |
|                    |
|      PICTURE       |
######################


When I use ref instead of autoref the text is correctly aligned beside the wrapfig. EDIT: Both pdflatex and texi2pdf produce this result. Any ideas?

SOLVED: Updating from TeX Live 2009 (default for Ubuntu 10.04 at the moment) to TeX Live 2012 solved the problem.

Old file list:

[...]
wrapfig.sty    2003/01/31  v 3.6
hyperref.sty    2009/10/09 v6.79a Hypertext links for LaTeX
[...]


Note the old version of hyperref. Under Ubuntu TeX Live can be upgraded by adding the repository ppa:texlive-backports/ppa and calling apt-get upgrade.

-

## closed as too localized by Joseph Wright♦May 19 '13 at 10:48

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Welcome to TeX.SX! You may have a look on our starter guide. – Marco Daniel May 19 '13 at 8:59
Your example works fine for me. – Marco Daniel May 19 '13 at 8:59
As @MarcoDaniel says, the example works fine. However, I note that your don't have a \label for the \autoref, which will alter the amount of text involved. (I'd also suggest using \usepackage[demo]{graphicx} to make the MWE compilable without edits.) – Joseph Wright May 19 '13 at 9:45
@JosephWright I added the demo option, thanks. A valid label does not change the situation, so I removed it for the sake of minimalism. – JD3 May 19 '13 at 9:49
@JD3 I've tried your example with both TeX Live 2012 and 2013 (pretest), and have no issues. Could you (1) edit in a picture showing the output you get for the MWE and (2) add \listfiles to the MWE and edit in the resulting File list from your .log file? – Joseph Wright May 19 '13 at 9:51

I cannot reproduce the problem (pdflatex, latex + dvips + ps2pdf, xelatex):

\listfiles
\documentclass{article}

\usepackage{wrapfig}
\usepackage[demo]{graphicx}

\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}
$$E=mc^2\label{ref}$$

\begin{wrapfigure}{R}{0.5\textwidth}
\includegraphics[width=0.5\textwidth]{dummypic}
\end{wrapfigure}

\autoref{ref} % arbitrary reference
\blindtext

\end{document}


From the version list:

 *File List*
[...]
wrapfig.sty    2003/01/31  v 3.6
hyperref.sty    2012/11/06 v6.83m Hypertext links for LaTeX
[...]

-