I'm using \documentclass{tufte-book} and trying to get a full-width algorithm environment (specifically, using algorithm2e).
Minimum working example:
\documentclass{tufte-book}
\title{Full-width algorithm2e algorithms}
\usepackage{lipsum} % for dummy text only
\usepackage[lined, ruled]{algorithm2e}
\begin{document}
\lipsum[2]
\begin{algorithm}[H]
\tcp{Main loop}
\While{not converged}{
$a = a + 1$ ;
}
\caption{A text-width algorithm}
\end{algorithm}
\lipsum[2]
\marginnote[10pt]{This algorithm should be full-width, but isn't}
\begin{fullwidth}
\begin{algorithm}[H]
\tcp{Main loop}
\While{not converged}{
$a = a + 1$ ;
}
\caption{A full-width algorithm}
\end{algorithm}
\end{fullwidth}
\lipsum[2]
\end{document}
Which renders:
In the algorithm2e.sty source-code, I found the dimension algowidth defined about half way through the document.
%[snip]
\newdimen\algowidth%
%[snip]
So I've tried adjusting this length using \setlength{\algowidth}{XXX} in my example, but it doesn't seem to have any effect.
- How can I achieve full-width algorithm2e
algorithmblocks withtufte-latex? - Bonus marks if
algorithm*can be adjusted to be full-width by default. - Extra bonus marks if the algorithm caption can also be moved to hang in the margin, as is the style with
tufte-latexfull width figures and tables.
Possibly related questions that don't seem to answer this:

