[Tex/LaTex] How to draw counter-ions using chemfig package

chemfigchemistrydiagrams

For my thesis I need to draw this:

enter image description here

With this code I could get everything except for the counter-ion (shown with red arrow, I do not need the red arrow and the line on the figure).

\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{chemfig}
\begin{document}
\begin{figure}[h]
\centering
{
\setatomsep{2em}
\chemname{\chemfig{[:90]Ir?[o](-[,2]N*6(-=-=-(-*6(=*6(-=-=-)-=-=?[o,{<:}]-))=))([:-90]-[,2]N*6(-(-*6(-?[o,{<}]=-=*6(-=-=-)-=))=-=-=-))([:30]<:[,2]N*6(-(-*6(=N?[o,{<}]-=-(-([:30]-)(-)([:-90]-))=-))=-(-([:90]-)(-)([:-30]-))=-=))}}{1}
}
\end{figure}
\end{document}

Could you help me to find a way to solve this problem? It there only one way to do it with TikZ environment or is there a simpler way?

Best Answer

There is also a "simple" way without tikz using LaTeX's picture environment.

The first picture environment is used to place the counter-ion that is set by the second:

\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{chemfig}
\begin{document}
\begin{figure}[h]
\centering
{
\setatomsep{2em}
\setlength{\unitlength}{2em}
\begin{picture}(0,0)
  \put(8.5,4.5){%
    \begin{picture}(0,0)
      \thicklines
      \put(.25,0){\makebox(0,0)[tl]{\chemfig{PF_{6}^{-}}}}
      \put(-1,0){\line(1,0){1}}
      \put(0,0){\line(0,-1){1}}
    \end{picture}%
  }
\end{picture}
\chemname{\chemfig{[:90]Ir?[o](-[,2]N*6(-=-=-(-*6(=*6(-=-=-)-=-=?[o,{<:}]-))=))([:-90]-[,2]N*6(-(-*6(-?[o,{<}]=-=*6(-=-=-)-=))=-=-=-))([:30]<:[,2]N*6(-(-*6(=N?[o,{<}]-=-(-([:30]-)(-)([:-90]-))=-))=-(-([:90]-)(-)([:-30]-))=-=))}}{1}
}
\end{figure}
\end{document}

Result

Remarks:

  • Some positioning for the counter-ion is necessary, but it can be relative to a atom of the molecule. Therefore the next solution is using tikz that is anyway loaded by package chemfig. This way, also an "one-liner" is possible. But using more lines would increase the readability.
  • I am missing the positive charge that makes the counter-ion a counter-ion. Or is the whole complex negative?
\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{chemfig}
\begin{document}
\begin{figure}[h]
\centering
{
\setatomsep{2em}
\chemname{\chemfig{[:90]Ir?[o](-[,2]N*6(-=-=-(-*6(=*6(-=-=-)-=-=?[o,{<:}]-))=))([:-90]-[,2]N*6(-(-*6(-?[o,{<}]=-=*6(-=-=-)-=))=-=-=-))([:30]<:[,2]N*6(-(-*6(=N?[o,{<}]-=-(-([:30]-)(-)([:-90]-))=-))=-(-([:90]-@{tr})(-)([:-30]-))=-=))}}{1}
\chemmove{\draw[very thick,inner sep=0pt](tr)++(-1.5em,-.5em)--++(0,2em)node[anchor=north
west]{\,\chemfig{^{+}}\ \ \chemfig{PF_{6}^{-}}}--++(-2em,0);}
}
\end{figure}
\end{document}

Result

And finally a variant without manual positioning. The reference point is the top right corner of the top right branch of the molecule. For clarity I have used more lines:

\documentclass[12pt,a4paper]{article}
\usepackage{graphicx}
\usepackage{chemfig}
\begin{document}
\begin{figure}[h]
\centering
\setatomsep{2em}
\chemname{\chemfig{[:90]Ir?[o](-[,2]N*6(-=-=-(-*6(=*6(-=-=-)-=-=?[o,{<:}]-))=))
\chemmove{%
  \draw[
    very thick,
  ]
    (tr-|rt)
    ++(\pgfkeysvalueof{/pgf/inner xsep}, \pgfkeysvalueof{/pgf/inner ysep})
    +(-2em,0) -- +(0,0)
      node [
        anchor=north west,
        inner sep=0pt
      ] {\,\printatom{^{+}}\ \printatom{PF_6^{-}}}
    --  +(0, -2em)
  ;%
}
\end{figure}
\end{document}

Result