2

I have the following chemical reaction scheme with MWE below:

MWE

\documentclass{article}
\usepackage{chemfig}

\begin{document}

\schemestart
P \arrow(P--Q){<=>[$\mathrm{k_{pq}}$]} Q
\arrow{<=>[$\mathrm{k_{qs}}$]}[30] S \arrow(S--T){<=>[][$\mathrm{k_{st}}$]}[-30] T
\arrow(@Q--R){<=>[][$\mathrm{k_{qr}}$]}[-30] R
\arrow(@R--@T){<=>[][$\mathrm{k_{rt}}$]}
\arrow(@T--U){<=>[][$\mathrm{k_{tu}}$]} U
\arrow(@U--V){->[$\mathrm{k_{uv}}$]} V
\schemestop

\end{document}

How can I added a shaded polygon to a particular scheme? As an example see image below:

enter image description here

2 Answers 2

2

chemfig uses TikZ, and you can place normal \draw macros in a \chemmove. The benefit of this is that the node names are directly available, so no additional markup in the form of \tikzmarks is needed.

output of code

\documentclass{article}
\usepackage{chemfig}

\begin{document}
%\schemedebug{true} % uncomment to see node names
\schemestart
P \arrow(P--Q){<=>[$\mathrm{k_{pq}}$]} Q
\arrow{<=>[$\mathrm{k_{qs}}$]}[30] S \arrow(S--T){<=>[][$\mathrm{k_{st}}$]}[-30] T
\arrow(@Q--R){<=>[][$\mathrm{k_{qr}}$]}[-30] R
\arrow(@R--@T){<=>[][$\mathrm{k_{rt}}$]}
\arrow(@T--U){<=>[][$\mathrm{k_{tu}}$]} U
\arrow(@U--V){->[$\mathrm{k_{uv}}$]} V
%
\chemmove{%
  \draw [red,thick] ([shift={(-5pt,1em)}]Q.north west) -- ([yshift=1em]S.north) --
                    ([yshift=1em]T.north) -- ([shift={(5pt,1em)}]U.north east) --
                    ([shift={(5pt,-1.5em)}]U.south east) --
                    ([yshift=-1.5em]T.south) -- ([yshift=-2em]R.south) --
                    ([shift={(-5pt,-2em)}]Q.south west) -- cycle;
}
\schemestop
\end{document}
2
  • This works fine, but would there be an option to arrange the polygon such that the polygon is behind the reaction scheme?
    – nxkryptor
    Feb 6, 2018 at 11:50
  • @nxkryptor Don't know, the obvious method using the backgrounds library didn't work. I'd suggest asking a new question about that. Feb 6, 2018 at 12:22
2

Here is a way using tikzmark:

\documentclass{article}
\usepackage{chemfig}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

\begin{document}

\schemestart
P \arrow(P--Q){<=>[$\mathrm{k_{pq}}$]} \tikzmark{myA}Q
\arrow{<=>[$\mathrm{k_{qs}}$]}[30] \tikzmark{myB}S \arrow(S--T){<=>[][$\mathrm{k_{st}}$]}[-30] T\tikzmark{myC}
\arrow(@Q--R){<=>[][$\mathrm{k_{qr}}$]}[-30] R \tikzmark{myD}
\arrow(@R--@T){<=>[][$\mathrm{k_{rt}}$]}
\arrow(@T--U){<=>[][$\mathrm{k_{tu}}$]} U \tikzmark{myE}
\arrow(@U--V){->[$\mathrm{k_{uv}}$]} V
\schemestop

\begin{tikzpicture}[overlay,remember picture]
  \coordinate (A) at ([xshift=-5pt,yshift=-10pt]myA);
  \coordinate (B) at ([xshift=-5pt,yshift=15pt]myA);
  \coordinate (C) at ([xshift=5pt,yshift=20pt]myB);
  \coordinate (D) at ([xshift=5pt,yshift=15pt]myC);
  \coordinate (E) at ([xshift=5pt,yshift=-10pt]myC);
  \coordinate (F) at ([xshift=-5pt,yshift=-15pt]myD);
  \coordinate (G) at ([xshift=5pt,yshift=15pt]myE);
  \coordinate (H) at ([xshift=5pt,yshift=-10pt]myE);

  \draw[red,thick] (A)--(B)--(C)--(D)--(G)--(H)--(E)--(F)--(A);

\end{tikzpicture}

\end{document}

Output: enter image description here

You must log in to answer this question.

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