I am using the algorithms environment from algorithm2e in a modified way with reduced width (following the solution here), see the MWE below.
This generates an overfull box that I'd like to get rid of. How can I achieve this?
\documentclass{article}
\usepackage{lipsum}
\usepackage{etoolbox}
\usepackage[ruled]{algorithm2e}
\SetCustomAlgoRuledWidth{0.6\textwidth}
\makeatletter
\patchcmd{\@algocf@start}{%
\begin{lrbox}{\algocf@algobox}%
}{%
\rule{0.2\textwidth}{\z@}%
\begin{lrbox}{\algocf@algobox}%
\begin{minipage}{0.6\textwidth}%
}{}{}
\patchcmd{\@algocf@finish}{%
\end{lrbox}%
}{%
\end{minipage}%
\end{lrbox}%
}{}{}
\makeatother
\begin{document}
\lipsum[1]
\begin{algorithm}[h]
\caption{NaiveSelect}\label{algo:naive-option}
Some alg step ;
\end{algorithm}
\lipsum[2]
\end{document}
The logfile says Overfull \hbox (276.00105pt too wide) in paragraph at lines 24--27.