4

I'd like to make a chemical scheme in a document I'm writing. However, the code I am trying to compile gives some errors. The error occurs at the line 11 (line after arrow command, with \chemname).

I think this might also have to do with the text I'm trying to insert. Can I just insert text instead of a \chemname{\chemfig{}}{} or can I use something like the following code: \chemname{}{Glucose oxidase-FAD}

MWE:

\documentclass{article}
\usepackage{chemfig}
\begin{document}
\schemestart
\chemname
{\chemfig{*6((<:OH)-(<OH)-(<:OH)-(<OH)-O-(>-OH)}}
{\beta -D-glucose}
\+
Glucose oxidase-FAD
\arrow{<=>}
\chemname
{\chemfig{*6((<:OH)-(<OH)-(<:OH)-(=O)-O-(>-OH)}}
{\delta -D-gluconolactone}
\+
Glucose oxidase-$\text{FADH}_2$
\schemestop
\end{document}

Thanks for helping out a rookie!

3

You have several errors in your code:

  • the \chemfig formulae are both missing a closing ) to end the ring.
  • \beta and \delta must be placed in math mode.
  • \text is undefined; you need to load amsmath or amstext.
\documentclass{article}
\usepackage{chemfig,amsmath}
\begin{document}

\schemestart
  \chemname
    {\chemfig{*6((<:OH)-(<OH)-(<:OH)-(<OH)-O-(>-OH))}}
    {$\beta$-D-glucose}
  \+
  Glucose oxidase-FAD
  \arrow{<=>}
  \chemname
    {\chemfig{*6((<:OH)-(<OH)-(<:OH)-(=O)-O-(>-OH))}}
    {$\delta$-D-gluconolactone}
  \+
  Glucose oxidase-$\text{FADH}_2$
\schemestop

\end{document}

Possible further improvements:

\documentclass{article}
\usepackage{chemfig,amsmath}
\usepackage{chemmacros}
\chemsetup{
  formula = chemformula ,
  greek   = textgreek
}

\usepackage{showframe}% show page dimensions

\begin{document}

\begin{center}
  \setatomsep{2.2em}%
  \schemestart[-90]
    \chemname
      {\chemfig{*6((<:HO)-(<OH)-(<:OH)-(<OH)-O-(>-HO))}}
      {\iupac{\b-\D-glucose}}
    \+
    \iupac{Glucose oxidase-FAD}
    \arrow{<=>}
    \chemname
      {\chemfig{*6((<:HO)-(<OH)-(<:OH)-(=O)-O-(>-HO))}}
      {\iupac{\d-\D-gluconolactone}}
    \+
    \iupac{Glucose oxidase-FADH$_2$}
  \schemestop
\end{center}

\end{document}

enter image description here

| improve this answer | |
  • Thank you for your help! I indeed forgot to include amsmath in the MWE, but it is included in the LaTeX code I'm using. I also tried putting \beta and \gamma in math mode, but in trying to solve my problem I must have taken them out. I indeed believe the issue was the ) I forgot to add. Thanks! One litte thing left: Is there a quick way to fit the scheme to the \textwidth? – Henry O. Apr 25 '16 at 13:07
  • @HenryO. see my updated answer – cgnieder Apr 26 '16 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.