2

I would like to to write the following equation in my document in latex. Gamma radiation chemical equation

I am using \usepackage[version=3]{mhchem}. How can I write that in latex to get a similar outcome? (The arrow can be shorter but has to be a "wave"). Cheers

2

I don't think this is easy with mhchem (but I may be mistaken…)

The following try uses the chemformula package instead of mhchem and uses TikZ/pgf and Jake's complete sines decoration for the wavy line. chemformula allows to define new arrows for the usage in chemical reactions. Since the syntax differs in significant details from mhchem's this may or may not be a viable solution for you.

As a shortcut for the usage I define a style

\tikzset{
  wave/.style={
    decorate,decoration={
      complete sines,
      segment length=3pt,
      amplitude=2pt
    }
  }
}

Now I load the chemformula package and define a new arrow:

\NewChemArrow{w>}{
  \path (cf_arrow_end) -- +(-5pt,0) coordinate (xxx) ; 
  \draw[chemarrow,wave] (cf_arrow_start) -- (xxx) ;
   \draw[chemarrow,-cf] (xxx) -- (cf_arrow_end);
}

Now this can be used just like any other of chemformula's arrows:

\ch{P w>[$\gamma$-radiation] P^*}

enter image description here

The complete code:

\documentclass{article}
\usepackage{chemformula,tikz}

% https://tex.stackexchange.com/a/25689
\usetikzlibrary{decorations.pathmorphing}
\pgfdeclaredecoration{complete sines}{initial}{
  \state{initial}[
    width = +0pt ,
    next state = sine,
    persistent precomputation = {
      \pgfmathsetmacro\matchinglength{
        \pgfdecoratedinputsegmentlength /
        int(\pgfdecoratedinputsegmentlength/\pgfdecorationsegmentlength)
      }
      \setlength{\pgfdecorationsegmentlength}{\matchinglength pt}
    }
  ]{}
  \state{sine}[width=\pgfdecorationsegmentlength]{
    \pgfpathsine{
      \pgfpoint
        {0.25\pgfdecorationsegmentlength}
        {0.5\pgfdecorationsegmentamplitude}
      }
    \pgfpathcosine{
      \pgfpoint
        {0.25\pgfdecorationsegmentlength}
        {-0.5\pgfdecorationsegmentamplitude}
      }
    \pgfpathsine{
      \pgfpoint
        {0.25\pgfdecorationsegmentlength}
        {-0.5\pgfdecorationsegmentamplitude}
      }
    \pgfpathcosine{
      \pgfpoint
        {0.25\pgfdecorationsegmentlength}
        {0.5\pgfdecorationsegmentamplitude}
      }
  }
  \state{final}{}
}

% a shortcut to use the new decoration:
\tikzset{
  wave/.style={
    decorate,decoration={
      complete sines,
      segment length=3pt,
      amplitude=2pt
    }
  }
}

% a new arrow:
\NewChemArrow{w>}{
  \path (cf_arrow_end) -- +(-5pt,0) coordinate (xxx) ; 
  \draw[chemarrow,wave] (cf_arrow_start) -- (xxx) ;
   \draw[chemarrow,-cf] (xxx) -- (cf_arrow_end);
}

\begin{document}

\ch{P w> P^*}

\ch{P w>[$\gamma$-radiation] P^*}

\end{document}

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.