How to write a chemical equation for an reaction that is still fitting inside the document?

Probably the following is closer to the desired output:

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{chemfig}
\usepackage{mol2chemfig}

\begin{document}
\scalebox{.47}{
\schemestart
\chemfig{O=[:15]-[:69](-[:123,,,2]HO)=_[:357](-[:51,,,1]OH)-[:285](<[:213]O-[:141])-[:339](<[:39,,,1]OH)-[:279]-[:339,,,1]OH} 
+ 
\chemfig{O=[:19]-[:73]-[:1]-[:289](=[:343]O)-[:217]N(-[:145])-[:271]Br} 
\arrow{->} 
\chemfig{O=[:15]-[:69](=[:123,,,1]O)-[:357](=[:51,,,1]O)-[:285](<[:213]O-[:141])-[:339](<[:39,,,1]OH)-[:279]-[:339,,,1]OH} 
+ 
\chemfig{O=[:18]-[:72]--[:288](=[:342]O)-[:216]\mcfbelow{N}{H}(-[:144])} 
+ 
\chemfig{Br-Br}
\schemestop
}
\end{document}

Wha I changed in comparison to the original:

  • removed the \ce{} command
  • placed the whole scheme between \startscheme and \stopscheme
  • replaced the mhchem-like arrow -> by the chemfig equivalent \arrow{->}
  • replaced the code of the furan-trione derivate. For this I copied the code of the dihydroxyfuranone derivate and adjusted the bonds accordingly
  • changed the factor of the scalebox to make sure the scheme fits into the textwidth of a standard article class

I think the code below works with your original code (with slight modifications).

The relevant changes are: as suggested by @leandriis

  • You can remove \ce
  • You can place the "\chemfig"s within \schemestart and \schemestop.
  • You can use an arrow defined by the chemfig package \arrow(.mid east--.mid west)

  • One suggestion made in the \chemfig package is to separate "plusses" and molecules using an invisible zero-length arrow (\arrow{0}[,0]). This causes the molecules and plusses to be treated separately and they end up aligning in a nicer way.

  • Quoting the chemfig package: 'Therefore, one must stop the compound right after the first molecule with a \arrow{0}[,0] that will draw an invisible, zero-length arrow. In order to vertically center the whole scheme, one must also set the the anchor of the first compound as "west" ... with the second optional argument of the \schemestart command'

    • edit: chemfig doc says you need to anchor the first compound to the "west" if you want vertical centering of the scheme. I removed the [west] argument shown below and I don't see a change in vertical alignment, so it does not seem necessary in this case.
  • You can also get rid of \mhchem and \mol2chemfig (this website is awesome, by the way: https://py-chemist.com/mol_2_chemfig/home it has saved me countless hours)

Here is a screenshot: enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{chemfig}
\setchemfig{+ sep left=1em, + sep right=1em, arrow offset=1em} % adjusts spacing around + symbols and the arrow
\begin{document}
    \begin{center}
        \scalebox{0.6}{
            \schemestart[][west] % "west" may be removable here
                \chemfig{O=[:15]-[:69](-[:123,,,2]HO)=_[:357](-[:51,,,1]OH)-[:285](<[:213]O-[:141])-[:339](<[:39,,,1]OH)-[:279]-[:339,,,1]OH} \arrow{0}[,0] \+ \arrow{0}[,0]
                 \chemfig{O=[:19]-[:73]-[:1]-[:289](=[:343]O)-[:217]N(-[:145])-[:271]Br}  \arrow(.mid east--.mid west) \arrow{0}[,0]
                 \chemfig{O=[:231]-[:285](-[:339](<[:39,,,1]OH)-[:279]-[:339,,,1]OH)<[:213]O-[:141](=[:195]O)-[:69](-[:357])=[:123]O} \arrow{0}[,0] \+ \arrow{0}[,0]
                 \chemfig{O=[:18]-[:72]--[:288](=[:342]O)-[:216]{N}{H}(-[:144])} \arrow{0}[,0]  \+ 
                 \chemfig{Br-Br}
             \schemestop
        }
    \end{center}
\end{document}