[Tex/LaTex] How to fix this overfull hbox

chemfigline-breakingwarnings

\documentclass[10pt]{article}
\usepackage{chemfig}
\usepackage[margin=1.2in]{geometry}
\newcommand{\chem}{\setatomsep{2em}\chemfig}

\begin{document}

\begin{itemize}
\item[--] 1$^\circ$ Alcohol $\rightarrow$  Aldehyde\\
\centerline{\schemestart
\chem{R-C(-[2]OH)(-[6]H)-H} \arrow{0}[,0] \+ [O] \arrow \chem{R-[:30]C(=[2]O)-[:-30]H} \arrow{0}[,0] \+ H$_2$O
\schemestop}
\end{itemize}

\end{document}

The above gives:

Overfull \hbox (25.00003pt too wide) in paragraph

It was working but now it doesn't, how can I fix it?

Best Answer

\centerline{ isn't really a latex command (it is in the latex format but just escaped from plain TeX). It makes a box \hsize wide but does not know about latex list structures and the indentation they introduce. So you line is too wide by 25pt which will be the left margin of the list item. Just remove \centerline and replace it with a \begin{center}...\end{center}.

Related Question