1

I want to show the reaction between Sodium benzoate and soda lime to give benzene and na2co3

Here is my code

\documentclass[11pt]{article}

\usepackage{fullpage}

\usepackage{chemfig,chemmacros}

\def\benzene{\chemfig{**6(------)}}
\def\upsidebenzene{\chemfig{[2]**6(------)}}
\def\sodiumbenzoate{\chemfig{[2]**6(-(-COONa)-----)}}
\def\NaOH{\chemfig{NaOH}}
\def\CaO{\chemfig{CaO}}

\begin{document}
\schemestart
       \sodiumbenzoate 
       + 
       \NaOH
       \arrow{->[\footnotesize\chemfig{CaO}][$\Delta$]}
       \benzene +  \CaO
    \schemestop
\end{document}

the main problem is there is no space between + and CaO (at reactant side) and i couldn't find any idea to write names below the symbol . I mean i don't know how to write sodium benzoate below its structure . And CaO and Na2C03 don't align in center with respect to benzene ring

Can someone please give me code to fix it Thank you

  • Welcome to TeX.sx! chemfig has \chemname{<structure>}{<name>}. As for the »+« problem: either put \arrow{0}[,0] after \sodiumbenzoate or define the structure differently: \newcommand*\sodiumbenzoate{\chemfig{COONa-[4]**6(------)}} (remember that the first atom in a chemfig structure determines its baseline!) – clemens Jun 22 '15 at 9:20
  • My comment above corresponds to your question before the edit... but the solution is the same for the updated question: put \arrow{0}[,0] to reset the baseline in order to achieve centered alignment or define the structures differently to give them another baseline. – clemens Jun 22 '15 at 9:24
  • @clemens and what about centering the NaOH with respect to benzene ? Can you give me code from /begin document? – aftershock Jun 22 '15 at 9:26
  • As I said: put \arrow{0}[,0] after benzene to center following input with respect to benzene – clemens Jun 22 '15 at 9:28
  • I added an answer – clemens Jun 22 '15 at 9:51
3

A name can be put below a molecule with \chemname{<molecule>}{<name>}.

In a scheme everything between different \arrows is consideres as one compound and the arrow is centered to the whole structure. This can be made visible with \schemedebug{true}:

enter image description here

So one possibility is to put invisible arrows of zero length (\arrow{0}[,0]) in between:

\schemedebug{true}
\schemestart
  \sodiumbenzoate \arrow{0}[,0]
  + 
  \NaOH
  \arrow{->[\footnotesize\chemfig{CaO}][$\Delta$]}
  \benzene \arrow{0}[,0] + \CaO
\schemestop

enter image description here

In combination this would give (note that I use a different possibility to draw sodium benzoate in order to give it a different baseline (page 4 of the chemfig manual: »ChemFig always places the first atom of the molecule on the baseline of the preceding code.«)):

\schemedebug{true}
\schemestart
  \chemname{\chemfig{COONa-[4]**6(------)}}{sodium benzoate}
  \+
  NaOH
  \arrow{->[\footnotesize\chemfig{CaO}][$\Delta$]}
  \chemfig{**6(------)}
  \arrow{0}[,0]
  \+
  CaO
\schemestop

enter image description here

The name disturbs alignment again. Now you can either not use \chemname but put the name below with more invisible arrows or you can adjust the anchor where the \arrow starts (have a look at the (.{4.85}--) argument of \arrow and study section »Anchoring« in part »reaction schemes« of the chemfig manual):

\schemedebug{true}
\schemestart
  \chemname{\chemfig{COONa-[4]**6(------)}}{sodium benzoate}
  \+
  NaOH
  \arrow(.{4.85}--){->[\footnotesize\chemfig{CaO}][$\Delta$]}
  \chemfig{**6(------)}
  \arrow{0}[,0]
  \+
  CaO
\schemestop

There may be other solutions, too. I always tend to forget one or more ways…

enter image description here

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.