\TitlePicture{%
\parbox{.7\linewidth}{%
Since the documentation is already long enough I decided to provide an
extra file containing only examples and a few words where to find possibly
interesting code.\par
For all the undocumented little macros like \cmd{fscrp} or \cmd{delm} have
a look in the \paket*{chemmacros} documentation.
}
}
\begin{document}
\section{Addition Reaction}\label{sec:addition}
A simple reaction scheme with two different products.
If you put something relative to an arrow you might have to consider that the
arrow's anchor point is in the middle of the arrow. That's why \cmd{mesomeric}
is shifted with \code{yshift=-2.5em} in line 9.
\begin{beispiel}[code only]
\begin{rxnscheme}[,,,.8]{Mesomerism}
\setatomsep{1.6em}
% main reaction:
\reactant[,start]{ \chemname{\chemfig{*6(-=-=(-[,,,,white]\phantom{Br})-=)}}{benzene \cmpd{benzene}} }
\arrow[,,2.8]{}{}
\reactant{ \chemname{\chemfig{*6(-=-=(-Br)-=)}}{bromobenzene \cmpd{bromobenzene}} }
% branch:
\arrow[start.below,,,pfeil_a]{\ch{Br2} / \ch{AlBr3}}{$-\ch{AlBr4-}$}
\mesomeric[!!pfeil_a.below!!,mesomerism,xshift=8.5em,!!yshift=-2.5em!!]{
\reactant{
\chemfig{*6(=[@{e1}]-=-(-[:120]Br)(-[:60]H)-(-[:-30,.4,,,white]\fplus)-[@{e2}])}
\elmove{e1}{60:4mm}{e2}{0:4mm}
}
\marrow
\reactant{
\chemfig{*6(-(-[:90,.4,,,white]\fplus)-[@{e4}]=[@{e3}]-(-[:120]Br)(-[:60]H)-=)}
\elmove{e3}{180:4mm}{e4}{150:4mm}
}
\marrow
\reactant{
\chemfig{*6(-=-(-[:-150,.4,,,white]\fplus)-(-[:120]Br)(-[:60]H)-=)}
}
}
% last arrow inside a branch, since it cannot be shifted by itself:
\branch[above=of mesomerism,,xshift=7.5em]{
\arrow[above]{$-\Hpl$}{}
}
\end{rxnscheme}
\end{beispiel}
\section{The Former Titlepage}
This scheme used to be on the title page of the examples file. It isn't any more
but here's the scheme, anyway.
\begin{rxnscheme}[,,,.7]{The Titlepage}
\setatomsep{1.5em}\footnotesize
\reactant[,a]{ \chemfig{C(-[4]*6(=-=-=-))(-[2]*6(=-=-=-))(-[6,,,2]HO)-C(-[2]CH_3)(-[6]OH)-CH_3} }
\arrow[a.20]{}{}
\reactant[20]{ \chemfig{C(-[4]*6(=-=-=-))(-[2]*6(=-=-=-))(-[@{e1}6,,,2]H_2@{e2}\chembelow{O}{\fplus})-C(-[2]CH_3)(-[6]OH)-CH_3}\elmove{e1}{10:4mm}{e2}{-10:4mm} }
\arrow[,,1.42]{$-\ch{H2O}$}{}
\reactant{ \chemfig{\chembelow{C}{\fplus}(-[4]*6(=-=-=-))(-[2]*6(=-=-=-))-C(-[2]CH_3)(-[6]OH)-CH_3} }{}
\arrow[a.-20,-|>]{}{}
\reactant[-20]{ \chemfig{C(-[4]*6(=-=-=-))(-[2]*6(=-=-=-))(-[6,,,2]HO)-C(-[2]CH_3)(-[@{e3}6]@{e4}\chembelow{O}{\fplus}H_2)-CH_3}\elmove{e3}{170:4mm}{e4}{-170:4mm} }
\arrow[,,1.42]{$-\ch{H2O}$}{}
\reactant[,end]{ \chemfig{C(-[4]*6(=-=-=-))(-[2]*6(=-=-=-))(-[6,,,2]HO)-\chembelow{C}{\fplus}(-[2]CH_3)-CH_3} }
\anywhere{below=of end}{}
\end{rxnscheme}
\section{Substitution vs. Elimination}
\begin{rxnscheme}{Substitution vs. Elimination}
% first reaction:
\reactant[,start_a]{\chemfig{@{H}H-[@{b1}:-60]\chemabove{C}{\scriptstyle\beta}(<[:-100]H)(<:[:-150]H)-[@{b2}]\chemabove{C}{\scriptstyle\alpha}(<[:20]H)(<:[:60]H)-[@{b3}:-60]@{X1}X}}
\arrow{E2}{}
\reactant{\chemfig{H-[:60]C(-[:120]H)=C(-[:60]H)-[:-60]H}}
\chemand
\reactant{\ch{X-}}
\chemand
\reactant{\chemfig{O(-[:60]H)-[:-60]H}}
% second reaction:
\reactant[start_a.-90,start_b,yshift=-4em]{\chemfig{H-[:-60]C(<[:-100]H)(<:[:-150]H)-@{C}C(<[:20]H)(<:[:60]H)-[@{b4}:-60]@{X2}X}}
\arrow{S$_\text{N}$2}{}
\reactant{\chemfig{H-[:-60]C(<[:-100]H)(<:[:-150]H)-C(<[:-80]H)(<:[:-30]H)-[:60]OH}}
\chemand
\reactant{\ch{X-}}
% nucleophile/base:
\anywhere{start_b.135,nuc,xshift=-3em,yshift=2em}{\chemfig{H-@{O}\chemabove{\lewis{026,O}}{\hspace{5mm}\fscrm}}}
% electron movements:
\anywhere{nuc.0}{
\elmove{O}{90:1.5cm}{H}{180:1cm}
\elmove{b1}{60:1cm}{b2}{90:5mm}
\elmove{b3}{-170:5mm}{X1}{180:5mm}
\elmove{O}{-90:1cm}{C}{100:1.5cm}
\elmove{b4}{-170:5mm}{X2}{180:5mm}
}
\end{rxnscheme}
You may see in line 20 that the \cmd{elmove} commands are put inside of
\cmd{anywhere}. This is necessary in order to produce the right scheme. But this
time you can position \cmd{anywhere} literally anywhere.
\begin{beispiel}[code only]
\begin{rxnscheme}{Substitution vs. Elimination}
% first reaction:
\reactant[,start_a]{\chemfig{@{H}H-[@{b1}:-60]\chemabove{C}{\scriptstyle\beta}(<[:-100]H)(<:[:-150]H)-[@{b2}]\chemabove{C}{\scriptstyle\alpha}(<[:20]H)(<:[:60]H)-[@{b3}:-60]@{X1}X}}
\arrow{\mech[e2}{}
\reactant{\chemfig{H-[:60]C(-[:120]H)=C(-[:60]H)-[:-60]H}}
\chemand
\reactant{\ch{X-}}
\chemand
\reactant{\chemfig{O(-[:60]H)-[:-60]H}}
% second reaction:
\reactant[start_a.-90,start_b,yshift=-4em]{\chemfig{H-[:-60]C(<[:-100]H)(<:[:-150]H)-@{C}C(<[:20]H)(<:[:60]H)-[@{b4}:-60]@{X2}X}}
\arrow{\mech[2]}{}
\reactant{\chemfig{H-[:-60]C(<[:-100]H)(<:[:-150]H)-C(<[:-80]H)(<:[:-30]H)-[:60]OH}}
\chemand
\reactant{\ch{X-}}
% nucleophile/base:
\anywhere{start_b.135,nuc,xshift=-3em,yshift=2em}{\chemfig{H-@{O}\chemabove{\lewis{026,O}}{\hspace{5mm}\fscrm}}}
% electron movements:
\anywhere{nuc.0}{
\elmove{O}{90:1.5cm}{H}{180:1cm}
\elmove{b1}{60:1cm}{b2}{90:5mm}
\elmove{b3}{-170:5mm}{X1}{180:5mm}
\elmove{O}{-90:1cm}{C}{100:1.5cm}
\elmove{b4}{-170:5mm}{X2}{180:5mm}
}
\end{rxnscheme}
\end{beispiel}
\section{Scheme with three Lines}\label{sec:three_lines}
\begin{rxnscheme}{Scheme with three Lines}
\setatomsep{1.5em}
\footnotesize
\reactant[,start]{\chemfig{EtO-(=[2]O)-[:-60](-Br)-[:-120](=[6]O)-[4]EtO}}
\chemand
\reactant{\chemfig{*6(-=-=-*5(-(=O)-\chemabove{\lewis{4:,N}}{\fscrm}(-[4,.7,,,draw=none]\chemabove{K}{\fscrp})-(=O)--)=)}}
\arrow{}{}
\reactant{\chemfig{*6(-=-=-*5(-(=O)-N(-(-[::-60](=[::-60]O)-[::60]EtO)-[::60](=[::60]O)-[::-60]EtO)-(=O)--)=)}}
% newline, started with \anywhere:
\anywhere{start.-90,a,xshift=-4em,yshift=-5em}{}
\arrow[a.0,,.6]{\chemabove{\lewis{0:,B}}{\fscrm}}{}
\arrow{\ch{R-X}}{}
\reactant{\chemfig{*6(-=-=-*5(-(=O)-N(-(-[4]R)(-[::-60](=[::-60]O)-[::60]EtO)-[::60](=[::60]O)-[::-60]EtO)-(=O)--)=)}}
\arrow[,,1.25]{\Hpl/\ch{H2O}}{}
\reactant{\chemfig{*6(-=-=-*5(-(=O)-N(-(-[4]R)(-[::-60](=[::-60]O)-[::60]HO_2C)-[::60](=[::60]O)-[::-60]HO_2C)-(=O)--)=)}}
% newline, started with \anywhere:
\anywhere{a.-90,b,yshift=-7em}{}
\arrow[b.0]{$- {\ch{CO2}}$}{}
\arrow{\Hpl}{\ch{H2O}}
\reactant{\chemfig{R-(-[6]H)(-[2]C|O_2\mch)-NH_3\pch}}
\end{rxnscheme}
\begin{beispiel}[code only]
\begin{rxnscheme}{Scheme with three Lines}
\setatomsep{1.5em}
\footnotesize
\reactant[,start]{\chemfig{EtO-(=[2]O)-[:-60](-Br)-[:-120](=[6]O)-[4]EtO}}
\chemand
\reactant{\chemfig{*6(-=-=-*5(-(=O)-\chemabove{\lewis{4:,N}}{\fscrm}(-[4,.7,,,draw=none]\chemabove{K}{\fscrp})-(=O)--)=)}}
\arrow{}{}
\reactant{\chemfig{*6(-=-=-*5(-(=O)-N(-(-[::-60](=[::-60]O)-[::60]EtO)-[::60](=[::60]O)-[::-60]EtO)-(=O)--)=)}}
% newline, started with \anywhere:
\anywhere{start.-90,a,xshift=-4em,yshift=-5em}{}
\arrow[a.0,,.6]{\chemabove{\lewis{0:,B}}{\fscrm}}{}
\arrow{\ch{R-X}}{}
\reactant{\chemfig{*6(-=-=-*5(-(=O)-N(-(-[4]R)(-[::-60](=[::-60]O)-[::60]EtO)-[::60](=[::60]O)-[::-60]EtO)-(=O)--)=)}}
\arrow[,,1.25]{\Hpl/\ch{H2O}}{}
\reactant{\chemfig{*6(-=-=-*5(-(=O)-N(-(-[4]R)(-[::-60](=[::-60]O)-[::60]HO_2C)-[::60](=[::60]O)-[::-60]HO_2C)-(=O)--)=)}}
% newline, started with \anywhere:
\anywhere{a.-90,b,yshift=-7em}{}
\arrow[b.0]{$- {\ch{CO2}}$}{}
\arrow{\Hpl}{\ch{H2O}}
\reactant{\chemfig{R-(-[6]H)(-[2]C|O_2\mch)-NH_3\pch}}
\end{rxnscheme}
\end{beispiel}
\section{Hydratisation}\label{sec:hydratisation}
\pgfdeclaredecoration{ddbond}{initial}{%
\state{initial}[width=2pt]{%
\pgfpathlineto{\pgfpoint{2pt}{0pt}}%
\pgfpathmoveto{\pgfpoint{1.5pt}{2pt}}%
\pgfpathlineto{\pgfpoint{2pt}{2pt}}%
\pgfpathmoveto{\pgfpoint{2pt}{0pt}}%
}%
\state{final}{%
\pgfpathlineto{\pgfpointdecoratedpathlast}%
}%
}%
\tikzset{lddbond/.style={decorate,decoration=ddbond}}%
\tikzset{rddbond/.style={decorate,decoration={ddbond,mirror}}}%
A scheme with transition states.
For this example we first declare a style for the delocalized double bonds:
\begin{beispiel}[code only]
\pgfdeclaredecoration{ddbond}{initial}{%
\state{initial}[width=2pt]{%
\pgfpathlineto{\pgfpoint{2pt}{0pt}}%
\pgfpathmoveto{\pgfpoint{1.5pt}{2pt}}%
\pgfpathlineto{\pgfpoint{2pt}{2pt}}%
\pgfpathmoveto{\pgfpoint{2pt}{0pt}}%
}%
\state{final}{%
\pgfpathlineto{\pgfpointdecoratedpathlast}%
}%
}%
\tikzset{lddbond/.style={decorate,decoration=ddbond}}%
\tikzset{rddbond/.style={decorate,decoration={ddbond,mirror}}}%
\end{beispiel}
Now the delocalized double bond can be used via \paket*{chemfig}'s fifth option
(see the \paket{chemfig} manual):
\begin{beispiel}[code only]
\chemfig{-[,,,,lddbond]-[,,,,rddbond]}
\end{beispiel}
\chemfig{-[,,,,lddbond]-[,,,,rddbond]}\par\medskip
Then the whole code looks like follows:
\begin{beispiel}[code only]
\begin{rxnscheme}{Hydratisation}
\reactant[,carbonyl_A]{\chemfig{R_2C=O}}
\anywhere{above=of carbonyl_A}{\chemfig{H-[:-30]O-[:30]H}}
\arrow[,<=>]{\tiny slow}{}
\transition[,transition_A]{\chemfig{R_2C(-[2,,2,,densely dotted]\chemabove{O}{\delp}(-[:150]H)-[:30]H)-[:-30,1.15,,,lddbond]O-[6,,,,densely dotted]H-[,,,,densely dotted]\chemabove{A}{\delm}}}
\anywhere{below=of transition_A,,text width=3cm}{(general transition state, acid cat.)}
\arrow[,<=>,.7]{}{}
\reactant{\chemfig{R_2C(-[:60]\chemabove{O}{\fscrp}H_2)-[:-60]OH}}
\arrow[below right,<=>,.7]{$-\Hpl$}{}
\reactant[below right]{\chemfig{R_2C(-[:60]OH)-[:-60]OH}}
\arrow[below left,<=>,.7]{}{\ch{H2O}}
\reactant[below left,zw]{\chemfig{R_2C(-[:60]OH)-[:-60]O|\mch}}
\arrow[left,<=>,.7]{}{}
\transition[left,transition_B]{\chemfig{R_2C(-[2,,2,,densely dotted]O(-[:150]H-[4,,,,densely dotted]\chemabove{B}{\delp})-[:30]H)-[:-30,1.15,,,lddbond]\chemabove{O}{\delm}-[6,,,,draw=none]\phantom{H}}}
\anywhere{below=of transition_B,,text width=3cm}{(general transition state, base cat.)}
\arrow[left,<=>]{\tiny langsam}{}
\reactant[left,carbonyl_B]{\chemfig{R_2C=O}}
\anywhere{above=of carbonyl_B}{\chemfig{H-[:-30]O-[:30]H}}
\end{rxnscheme}
\end{beispiel}
You can see that \cmd{anywhere} was used several times, either to place molecules
or to label molecules.
\section{Change the layout with \TikZ}\label{sec:tikz_layout}
\begin{rxnscheme}{Change the layout with \TikZ}
\colorlet{mCgreen}{green!50!gray}
\colorlet{mCblue}{cyan!50!gray}
\colorlet{mCred}{magenta!50!gray}
\tikzset{reactant/.style={draw=#1,fill=#1!10,minimum width=.8\textwidth,inner sep=1em,rounded corners}}
\mCsetup{arrowlength=3em,arrowline=very thick}
\reactant[,,reactant=mCgreen]{
\chemname{\chemfig{Alky|l--[6](-[4,,,2]Acy|l)-[6]-O-P(=[2]O)(-[6]O|\mch)-O-[:-30]-[:30]-[:-30]NH_2}}{\bfseries Phosphatidylethanolamine}
}
\arrow[below]{\iupac{\N\-acyl\|transferase}}{}
\reactant[below,,reactant=mCblue]{
\chemname{\chemfig{Alky|l--[6](-[4,,,2]Acy|l)-[6]-O-P(=[2]O)(-[6]O|\mch)-O-[:-30]-[:30]-[:-30]\chembelow{N}{H}-[:30](=[2]O)-[:-30]-[:30]-[:-30]-[:30]=_-[:-30]-[:30]=_-[:-60]-[::-60]=_[:180]-[::-30]-[::60]=_[:180]-[::-30]-[::60]-[::-60]-[::60]-[6]}}{\bfseries\iupac{\N\-arachidonoyl\-PE}}
}
\arrow[below]{Phospholipase D}{}
\reactant[below,,reactant=mCred]{
\chemname{\chemfig{HO-[:-30]-[:30]-[:-30]\chembelow{N}{H}-[:30](=[2]O)-[:-30]-[:30]-[:-30]-[:30]=_-[:-30]-[:30]=_-[:-60]-[::-60]=_[:180]-[::-30]-[::60]=_[:180]-[::-30]-[::60]-[::-60]-[::60]-[6]}}{\bfseries Anandamide}
}
\mCsetup{reset}
\end{rxnscheme}
This is an example for the usage of the \code{<tikz>} option. Please take a closer
look at lines \numlist{5;7;11;15}.
\begin{beispiel}[code only]
\begin{rxnscheme}{Change the layout with \TikZ}
\colorlet{mCgreen}{green!50!gray}
\colorlet{mCblue}{cyan!50!gray}
\colorlet{mCred}{magenta!50!gray}
!!\tikzset{reactant/.style={draw=#1,fill=#1!10,minimum width=.8\textwidth,inner sep=1em,rounded corners}}!!
\mCsetup{arrowlength=3em,arrowline=very thick}
\reactant[,,!!reactant=mCgreen!!]{
\chemname{\chemfig{Alky|l--[6](-[4,,,2]Acy|l)-[6]-O-P(=[2]O)(-[6]O|\mch)-O-[:-30]-[:30]-[:-30]NH_2}}{\bfseries Phosphatidylethanolamine}
}
\arrow[below]{}{\iupac{\N-acyl\|transferase}}
\reactant[below,,!!reactant=mCblue!!]{
\chemname{\chemfig{Alky|l--[6](-[4,,,2]Acy|l)-[6]-O-P(=[2]O)(-[6]O|\mch)-O-[:-30]-[:30]-[:-30]\chembelow{N}{H}-[:30](=[2]O)-[:-30]-[:30]-[:-30]-[:30]=_-[:-30]-[:30]=_-[:-60] -[::-60]=_[:180]-[::-30]-[::60]=_[:180]-[::-30]- [::60]-[::-60]-[::60]-[6]}}{\bfseries\iupac{\N\-arachidonoyl\-PE}}
}
\arrow[below]{}{Phospholipase D}
\reactant[below,,!!reactant=mCred!!]{
\chemname{\chemfig{HO-[:-30]-[:30]-[:-30]\chembelow{N}{H}-[:30](=[2]O)-[:-30]-[:30]-[:-30]-[:30]=_-[:-30]-[:30]=_-[:-60] -[::-60]=_[:180]-[::-30]-[::60]=_[:180]-[::-30]- [::60]-[::-60]-[::60]-[6]}}{\bfseries Anandamide}
}
\mCsetup{reset}
\end{rxnscheme}
\end{beispiel}