9

I'm writing a reaction but the names of the D-Glucose and D-Mannose are not aligned with the name of the D-Fructose. Here's what I have. I tried to use \chemnameinit{} but it simply didn't work :(

Also, I'd like to put a title like a table or image but I don't know how.

\usepackage{chemfig}
\begin{document}

\definesubmol{x}{(-[4]H)(-[0]OH)}
\definesubmol{y}{(-[0]H)(-[4]HO)}

\begin{center}
\schemestart
    \chemname{\chemfig{[2]CH_2 \cdot OH-!x-!x-!y-!x-(-[3]H)=[1]O}}{D-Glucosa}
    \arrow{<=>[Base][]}
    \chemname{\chemfig{[2]CH_2 \cdot OH-!x-!x-!y-(=[0]O)-CH_2 \cdot OH}}{D-Fructosa}
    \arrow{<=>[Base][]}
    \chemname{\chemfig{[2]CH_2 \cdot OH-!x-!x-!y-!y-(-[3]H)=[1]O}}{D-Manosa}
\schemestop
\end{center}

\end{document}

enter image description here

AJMC2002
  • 127

2 Answers2

6

chemfig places the molecules in a bounding box defined by TikZ. I haven't found how to modify or act on this bounding box. So, I propose a quick hack by adding 35 pt to the default size of the text of the \chemname[35pt] command.

screenshot

\documentclass[12pt]{article}
\usepackage{chemfig}
\begin{document}

\definesubmol{x}{(-[4]H)(-[0]OH)}
\definesubmol{y}{(-[0]H)(-[4]HO)}

\begin{center}

\schemestart
    \chemname{\chemfig{[2]CH_2 \cdot OH-!x-!x-!y-!x-(-[3]H)=[1]O}}{D-Glucosa}
    \arrow{<=>[Base][]}
    \chemname[35pt]{\chemfig{[2]CH_2 \cdot OH-!x-!x-!y-(=[0]O)-CH_2 \cdot OH}}{D-Fructosa}
    \arrow{<=>[Base][]}
    \chemname{\chemfig{[2]CH_2 \cdot OH-!x-!x-!y-!y-(-[3]H)=[1]O}}{D-Manosa}
\schemestop

\end{center}

\end{document}
AndréC
  • 24,137
5

A solution with vphantom

\documentclass[12pt]{article}
\usepackage{chemfig}
\begin{document}

\definesubmol{x}{(-[4]H)(-[0]OH)}
\definesubmol{y}{(-[0]H)(-[4]HO)}

\begin{center}

\schemestart
    \chemname{\chemfig{ [2]CH_2 \cdot OH-!x-!x-!y-!x-(-[3]H)=[1]O}}{D-Glucosa}
    \arrow{<=>[Base][]}
    \chemname{\vphantom{\chemfig{[2]CH_2 \cdot OH-!x-!x-!y-!x-(-[3]H)=[1]O}}
        \chemfig{[2]CH_2 \cdot OH-!x-!x-!y-(=[0]O)-CH_2 \cdot OH}}{D-Fructosa}
    \arrow{<=>[Base][]}
    \chemname{\chemfig{[2]CH_2 \cdot OH-!x-!x-!y-!y-(-[3]H)=[1]O}}{D-Manosa}
\schemestop

\end{center}

\end{document}
polyn
  • 5,614