summaryrefslogtreecommitdiff
path: root/graphics/mol2chemfig/doc/doc-source/chapters/hydrogens.tex
blob: 0f1d4fdfa49ae72687123cd6469b317b247ec343 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\subsection{Adding and deleting hydrogens}

The next example renders an SDF file for doxorubicin, downloaded from PubChem%
%
\footnote{We could also just have used the \texttt{-i pubchem} option, but since we are going to reuse the file, a local copy is handy.}

\lstinputlisting{doxo-from-sdf.sh}

This gives us (yikes)

\cfpic{doxo-raw.tex}

Let's remove the explicit hydrogens with option \lstinline!--hydrogens=delete! or \lstinline!-y delete!:

\lstinputlisting{doxo-strip-h.sh}

This gives

\cfpic{doxo-stripped.tex}

It is also possible to \emph{add} hydrogens to a structure that does not supply them; for example:

\lstinputlisting{phenol-add-h.sh}

produces

\cfpic{phenol-with-hydrogens.tex}

By default, \mcf neither removes nor adds hydrogens. Note also that adding hydrogens will trigger coordinate recalculation (see section \ref{sec:recalc}).