1

I am trying to make my assignments look better. Here is the code and the current output:

\documentclass{article}
\usepackage[version=4,layout=stacked]{mhchem}
\usepackage{graphicx}
\usepackage{chemfig}
\usepackage{xymtexpdf}
\usepackage{tikz}
\begin{document}
      
How to align SOCl2/Peroxide and arrow to the middle of the ring, not the middle of the molecule?

Also how to do the same in xymtex?

\schemestart \chemfig{*6(----(-OH)--)} \arrow{->[SOCl$_2$]}  \schemestop

\schemestart \chemfig{*6(-=-=(-CH_2-[::-90]CH=[:0]CH_2)-=)} \arrow{->[Peroxide]} \schemestop

The first sentence is correct with the correct placement of organic molecule , how to change xymtex to do the same in second?

(Correct) - Out of {\tiny\setchemfig{atom sep=1.5em}\chemfig{*6(--=-(-X)--)}} and {\tiny\setchemfig{atom sep=1.5em}\chemfig{*6(--=(-X)---)}} which is an example of allylic halide?

(Need Correction) - Out of \fbox{\cyclohexanev[b]{1==OH}} and \fbox{\cyclohexanev[b]{2==OH}} which is an example of allylic halide?

(correct) - \scalebox{0.6}{\schemestart \chemfig{NO_2-*6(-=-(-CH_2-CH_3)=-=)} \arrow{->[Br$_2$][UV Light]} \schemestop}

(incorrect) - \fbox{\ce{\bzdrh{1==NO$_2$;4==CH$_2$-CH$_3$} ->[Br_2, UV Light]}}


\end{document}

It might look huge, but its descriptive of my issue. Here is the current output:

https://imgur.com/a/rActl46

enter image description here

As you can see,

  1. in the first example the SOCl2 arrow is slightly above the middle of the ring. i would like to align it with the middle of the cyclohexane ring ( not the molecule, just the ring)

  2. same with the peroxide reaction as well

  3. (3rd and 4th reaction/sentence)for the third reaction this is the correct output i would like that i am getting with chemfig, however i am more fond of how the ring is drawn on xymtex. how do i resize or shift, or remake in xymtex so that the molecule lines up with the text just like in chemfig?

  4. (last two reactions with NO2 group) the arrow is lined up at the centre of the molecular with chemfig but its not when i do the same example with xymtex. how do i line up the reaction arrow?

Thanks in advance for your help folks!

1 Answer 1

2
  1. and 2) This can be done by marking (@{x}) the chemical bond on the ring near the arrow. Chemfig always places the tag in the middle of the chemical bond, which is what you want.

I increased the length of the arrow, too

\schemestart

\chemfig{*6(---[@{a}]-(-OH)--)} \arrow(@{a}--){->[SOCl$_2$]}[,1.5]

\schemestop

\schemestart

\chemfig{*6(-=-[@{b}]=(-CH_2-[::-90]CH=[:0]CH_2)-=)} \arrow(@{b}--){->[Peroxide]}[,1.5]

\schemestop

enter image description here

  1. You can use "quickreaction"

    \documentclass{article}

    \usepackage[version=4,layout=stacked]{mhchem}

    \usepackage{xparse}

    \usepackage{chemfig}

    \usepackage{xymtexpdf}

    \usepackage{tikz}

    \usepackage[iupac]{quickreaction}

    \begin{document}

     \begin{quickreaction}
    
     \parbox{4cm}{(Need Correction) - Out of} \& \fbox{\cyclohexanev[b]{1==OH}} \& \parbox{1cm}{and} \& \fbox{\cyclohexanev[b]{2==OH}} \& \parbox{5cm}{which is an example \\ of allylic halide?} \\
    
     \end{quickreaction}
    

    \end{document}

enter image description here

  1. More QuickReaction

\begin{quickreaction}

(incorrect) - & \hspace{1cm} \ce{\bzdrh{1==NO$_2$;4==CH$_2$-CH$_3$}} &\hspace{1cm} \ce{->[Br_2, UV Light]} \

\end{quickreaction}

enter image description here

It is possible to write (4) only with chemfig and quick reaction

\begin{quickreaction}

(incorrect) & \chemfig{O_2N-*6(=-=(-CH_2-CH_3)-=-)} & \quickarrow[Br$_2$][UV Light] \

\end{quickreaction}

enter image description here

2
  • issues 1 and 2 are resolved perfectly. however for the quickreaction part, do i have to specify the \parbox{somelength} and \hspace{somelength}or will it automatically resize?
    – Aman
    Commented Jul 16, 2023 at 8:03
  • The \parbox command requires (as far as I know) specifying the length of the text. I mainly used parbox so that the long text in (3) could be placed on more than one line without disturbing the alignment of other objects. QuickReaction is designed to be used in conjunction with ChemFig. Using QuickReaction together with text and \ce on the same line caused problems that were avoided by adding spaces \hspace{}
    – CrocoDuck
    Commented Jul 16, 2023 at 15:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .