# How to connect a subscheme to main scheme in chemfig?

I have the following reaction scheme plotted with chemfig as shown in figure:

MWE

\documentclass{article}
\usepackage{chemfig}

\begin{document}

\schemestart
A \arrow(a--b){->[*{0}$\mathrm{-HO}$][*{0}$\mathrm{+O_{2}}$]}[-90] B
\arrow(@b--c){->[][]} C
% \subscheme{\arrow{->}\lewis{1.,R}}%
\arrow(@b--d){<=>[][*{0}$\mathrm{+O_{2}}$]}[-90] D
\arrow(@d--f){}[0,1.5] F + \arrow(--g){0}[]G
\arrow(@g--i){}[90] I
\arrow(@i--c){}[-180,,,,dashed]
\arrow(@d--@f){->[$\mathrm{-\lewis{1.,HO}}$][]}
\arrow(@b--@f){->[$\mathrm{+O_{2}}$][$\mathrm{-\lewis{1.,HO}}$]}
\arrow(@d--e){<=>[][]}[-90] E
\arrow(@e--h){->[$\mathrm{-\lewis{3.,OH}}$][]} H
\arrow(@e--@f){->[$\mathrm{-\lewis{1.,HO}}$][]}
\schemestop

\end{document}


Why is there a large gap between the compounds 'F' and 'G'? If I fix with the MWE (below) this is what I get:

MWE

\documentclass{article}
\usepackage{chemfig}

\begin{document}

\schemestart
A \arrow(a--b){->[*{0}$\mathrm{-HO}$][*{0}$\mathrm{+O_{2}}$]}[-90] B
\arrow(@b--c){->[][]} C
% \subscheme{\arrow{->}\lewis{1.,R}}%
\arrow(@b--d){<=>[][*{0}$\mathrm{+O_{2}}$]}[-90] D
\arrow(@d--f){}[0,1.5] F + \arrow(--g){0}[0,0]G
\arrow(@g--i){}[90] I
\arrow(@i--c){}[-180,,,,dashed]
\arrow(@d--@f){->[$\mathrm{-\lewis{1.,HO}}$][]}
\arrow(@b--@f){->[$\mathrm{+O_{2}}$][$\mathrm{-\lewis{1.,HO}}$]}
\arrow(@d--e){<=>[][]}[-90] E
\arrow(@e--h){->[$\mathrm{-\lewis{3.,OH}}$][]} H
\arrow(@e--@f){->[$\mathrm{-\lewis{1.,HO}}$][]}
\schemestop

\end{document}


What is the correct way to fix this?

You can use a separate node for the + and another one for the G:

\arrow(@d--f){}[0,1.5] F
\arrow(@f.east--p.west){0}[0,0]+
\arrow(@p.east--g.west){0}[0,0]G


Note that you also need to replace the line with \arrow(@i--c) by \arrow(@i--@c). I also needed to add [,,solid] at the end of the \arrow(@d--@f) line: otherwise that arrow became dashed too.

\documentclass{article}
\usepackage{chemfig}

\begin{document}

\schemestart
A \arrow(a--b){->[*{0}$\mathrm{-HO}$][*{0}$\mathrm{+O_{2}}$]}[-90] B
\arrow(@b--c){->[][]} C
% \subscheme{\arrow{->}\lewis{1.,R}}%
\arrow(@b--d){<=>[][*{0}$\mathrm{+O_{2}}$]}[-90] D
\arrow(@d--f){}[0,1.5] F \arrow(@f.east--p.west){0}[0,0]+ \arrow(@p.east--g.west){0}[0,0]G
\arrow(@g--i){}[90] I
\arrow(@i--@c){->}[,,dashed]
\arrow(@d--@f){->[$\mathrm{-\lewis{1.,HO}}$][]}[,,solid]
\arrow(@b--@f){->[$\mathrm{+O_{2}}$][$\mathrm{-\lewis{1.,HO}}$]}
\arrow(@d--e){<=>[][]}[-90] E
\arrow(@e--h){->[$\mathrm{-\lewis{3.,OH}}$][]} H
\arrow(@e--@f){->[$\mathrm{-\lewis{1.,HO}}$][]}
\schemestop

\end{document}