# Full width text shifts all marginfix-ed floats off the page to the right

I'm using marginfix to fix the positioning of sidenotes in some Tufte documents, but whenever a page contains any text in a fullwidth environment, all marginal material on that page is shifted to the right, so that while it is positioned "correctly" relative to the full width text, it overflows the page and is shifted away from all regular width text:

\documentclass[]{tufte-handout}
\usepackage{marginfix}
\begin{document}
This is text before some full width text. The footnote that goes with it is way over there.\footnote{This note goes with the text before the full width text.}
\begin{fullwidth}This is some full width text. Its presence on a page using \texttt{marginfix} pushes all notes to the right off the page.\end{fullwidth}
This is some other text, after the full width text, and its note is also way over there.\footnote{This note goes with the text after the full width text.}
\end{document}


Is there a way to prevent this behavior when using marginfix, perhaps by patching Tufte or wrapping the fullwidth environment?

-

The trick is to use minipage to redefine fullwidth with the correct width value:

\documentclass[]{tufte-handout}

\makeatletter
\newlength{\fullwidthlength}
\AtBeginDocument{\setlength{\fullwidthlength}{\@tufte@fullwidth}}
\makeatother
\renewenvironment{fullwidth}{\noindent\begin{minipage}{\fullwidthlength}\strut}{\strut\end{minipage}}

\usepackage{marginfix}

\begin{document}
This is text before some full width text. The footnote that goes with it is way over there.\footnote{This note goes with the text before the full width text.}

\begin{fullwidth}This is some full width text. Its presence on a page using \texttt{marginfix} pushes all notes to the right off the page.\end{fullwidth}

This is some other text, after the full width text, and its note is also way over there.\footnote{This note goes with the text after the full width text.}

\end{document}

-
Thanks to lockstep for providing the correct width value! –  raxacoricofallapatorius Mar 16 '12 at 21:44