summaryrefslogtreecommitdiff
path: root/graphics/mol2chemfig/doc
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/mol2chemfig/doc
Initial commit
Diffstat (limited to 'graphics/mol2chemfig/doc')
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/abstract.tex13
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/bond-lengths.tex23
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/composite.tex50
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/conclusion.tex35
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/context.tex5
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/help.tex7
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/hydrogens.tex30
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/input-modes.tex25
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/installation.tex43
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/introduction.tex43
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/output.tex53
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/polishing.tex39
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/recalculating.tex10
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/submolecules.tex46
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/tpic1.tex18
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/tpic2.tex21
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/tpic3.tex16
-rw-r--r--graphics/mol2chemfig/doc/doc-source/chapters/tutorial.tex4
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/atcc.mol49
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/caffeine-from-smiles-rotated.sh1
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/caffeine-from-smiles.sh1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/caffeine-smi.tex2
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/caffeine-smi2.tex3
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/caffeine.mol34
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/caffeine.smi1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/ce-submol1.tex56
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/ce-submol2.tex56
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/ce-submol3.tex56
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/crown-ether.mol81
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/cubane.mol25
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/daptomycin-u.sh1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/daptomycin-u.tex191
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/daptomycin.mol238
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/daptomycin.tex191
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/daptomycin1.sh1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/dcf-submol1.tex51
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/dcf-submol2.tex51
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/dcf-submol3.tex53
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein.mol63
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein1.sh2
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein2.sh3
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein3.sh3
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/doxo-from-sdf.sh1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/doxo-raw.tex145
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/doxo-strip-h.sh1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/doxo-stripped.tex74
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/fmnh.mol71
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/aspirin.tex8
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/caffeine.tex1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/chemfig-settings.tex10
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green.pngbin0 -> 45165 bytes
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green1.tex9
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green2.tex14
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green3.tex12
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/morphine-f.sh1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/morphine-f.tex40
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/morphine-k.sh1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/morphine-k.tex44
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/morphine-n.sh1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/morphine-n.tex40
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/morphine.mol51
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/morphine.sh1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/morphine.tex40
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/mp.mol42
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/mp.sh1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/mp.tex31
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/optionlist.tex115
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/phenol-add-h.sh1
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/phenol-as-submol.sh1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/phenol-as-submol.tex12
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/phenol-from-smiles-w.sh1
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/phenol-from-smiles-wz.sh1
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/phenol-from-smiles.sh1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/phenol-smi-terse.tex1
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/phenol-smi-wrapped.tex12
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/phenol-smi.tex10
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/phenol-with-hydrogens.tex26
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/plp.mol48
-rwxr-xr-xgraphics/mol2chemfig/doc/doc-source/examples/plp.sh2
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/plp.tex38
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/plp2.mol48
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/plp2.tex38
-rw-r--r--graphics/mol2chemfig/doc/doc-source/examples/twisted.mol13
-rw-r--r--graphics/mol2chemfig/doc/doc-source/mol2chemfig-doc.tex33
-rw-r--r--graphics/mol2chemfig/doc/doc-source/mol2chemfig.sty236
-rw-r--r--graphics/mol2chemfig/doc/doc-source/preamble.tex60
-rw-r--r--graphics/mol2chemfig/doc/mol2chemfig-doc.pdfbin0 -> 234181 bytes
87 files changed, 3030 insertions, 0 deletions
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/abstract.tex b/graphics/mol2chemfig/doc/doc-source/chapters/abstract.tex
new file mode 100644
index 0000000000..46c9600106
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/abstract.tex
@@ -0,0 +1,13 @@
+\begin{abstract}
+\noindent \mcf is a Python program that generates \TeX\ graphics of chemical structures provided in \mf or \smiles format. Its output is written in the syntax of the \chf package, which in turn is based on \tkz. Thus, both these packages are required in order to compile \mcf's output.
+%
+The program is available
+%
+\begin{inparaenum}[a)]
+\item through a web interface,
+\item for local installation, and
+\item as a command line-driven thin client.
+\end{inparaenum}
+%
+The thin client is a Lua script that is designed to work with recent TeXLive installations.
+\end{abstract}
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/bond-lengths.tex b/graphics/mol2chemfig/doc/doc-source/chapters/bond-lengths.tex
new file mode 100644
index 0000000000..d5993637e4
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/bond-lengths.tex
@@ -0,0 +1,23 @@
+\subsection{Bond lengths}
+
+You will have noticed that, in the above doxorubicin example, the removal of the hydrogens was accompanied by a reduction in length of the remaining bonds. This happened because, by default, \mcf scales all bond lengths such that the \emph{most frequently occurring} bond length is set equal to 1. In the unstripped version, the most frequent bonds were those to the explicit hydrogens. These were very short, which caused all other bonds to be unduly extended. Stripping the hydrogens restored a more proportioned appearance.
+
+There are two mechanisms with which we can explicitly change the bond lengths:
+
+\begin{enumerate}
+\item Within \mcf, you can use the \lstinline!--bond-scale! or \lstinline!-s! option, usually in combination with the \lstinline!--bond-stretch! or \lstinline!-t! option.
+
+\item Within \chf, you can set the unit bond length---that is, the length of a bond whose length is equals 1 inside the \lstinline!\chemfig! macro---with \chf's \lstinline!\setatomsep! macro.
+\end{enumerate}
+
+The \lstinline!\setatomsep! approach is straightforward; in this document, \lstinline!\setatomsep{16pt}! has been used throughout. The two \mcf options need a bit more explaining. The \lstinline!--bond-scale! or \lstinline!-s! option defines \mcf's overall behavior:
+
+\begin{itemize}
+\item With a setting of \lstinline!--bond-scale=keep!, \mcf will leave the bond lengths entirely alone; the \lstinline!--bond-stretch! option will have no effect in this case.
+
+\item With \lstinline!--bond-scale=normalize!, which is the default, all bonds will be scaled such that the most frequently occurring bond length is set to the value of the \lstinline!--bond-stretch! option, which defaults to 1.
+
+\item With \lstinline!--bond-scale=scale!, the value of \lstinline!--bond-stretch! will be used as a multiplier to the native length of each bond, as contained in the input file; no normalization will occur in this case.
+\end{itemize}
+
+Thus, the meaning of the \lstinline!--bond-stretch! option depends on the setting of the \lstinline!--bond-scale! option.
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/composite.tex b/graphics/mol2chemfig/doc/doc-source/chapters/composite.tex
new file mode 100644
index 0000000000..492c241ef5
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/composite.tex
@@ -0,0 +1,50 @@
+\subsection{Using generated code in composite figures}
+
+The \texttt{mol2chemfig} package loads \texttt{chemfig}, which in turn loads the general purpose graphics package \texttt{TikZ}. Through the latter package, we have access to the \texttt{tikzpicture} environment. Here is a \texttt{tikzpicture} that depicts two resonance structures of alanine bound to pyridoxal phosphate:
+
+\input{chapters/tpic1}
+
+The code for this graphics is
+
+\lstinputlisting{chapters/tpic1}
+
+The two structures were placed on the canvas using \tkz nodes. The \tkz nodes cannot contain \lstinline!\input! macros. Therefore, as a workaround, we render the structures as submol definitions with
+
+\lstinputlisting{plp.sh}
+
+and then reference those definitions from within the \lstinline!\chemfig! macros inside the nodes.
+
+Reactions such as the mesomeric transitions within pyridoxal phosphate should also show some electron pushing. The \chf package offers a mechanism for naming atoms and bonds in molecules; these names can then be used to attach push arrows. We can ask \mcf to generate atom and bond names for us, using the \lstinline!--markers! or \lstinline!-g! option:
+
+\lstinputlisting{mp.sh}
+
+This option adds a unique identifier to each atom and to each bond. The option value (\texttt{mp} in our example) is used as a prefix; this allows to unambiguously reference atoms in multiple molecules in the same drawing. In our example, atom 3 will be given the marker \lstinline!@{mp3}! for atom 3. The bond between atoms 3 and 4 will be labeled with \lstinline!@{mp3-4}!; in bond markers, the smaller atom number always comes first. The generated code now starts to get a wee bit tough on the eyeballs:
+
+\lstinputlisting[firstline=1,lastline=5]{mp.tex}
+
+\ldots
+
+In order to attach drawing elements to the nodes defined in the \mcf-rendered structures, we need to use a separate \lstinline!tikzpicture! environment, with the optional arguments \lstinline![remember picture, overlay]!. Inside this environment, we can use arbitrary \tkz commands to decorate our rendered structures. Here is an example:
+
+\lstinputlisting{chapters/tpic2.tex}
+
+which gives
+
+\input{chapters/tpic2}
+
+One important thing to note is that, when the overlay mechanism is used, the document has to be processed \emph{twice} by pdftex---otherwise, the overlaid elements tend to get misaligned.
+
+The \lstinline!\draw! commands used in the example for the electron push arrows employed the \lstinline!mcfpusharrow! \tkz style that is defined by the \mcf package. You can adjust this style to your own tastes with the \lstinline!\tikzset! macro.
+
+If the push-arrows are the \emph{only} drawing element you need, you can avoid the need for explicitly creating an overlaid second \lstinline!tikzpicture! environment by using macros predefined by either \chf and \mcf. The next example illustrates the use of the \lstinline!\mcfpush! macro defined by \mcf.
+
+\lstinputlisting{chapters/tpic3.tex}
+
+which gives
+
+\input{chapters/tpic3}
+
+The arguments of the \lstinline!\mcfpush! macro are, in order, the named anchor of the origin, the parameters of the first control point (departure angle:distance), and the second anchor and second control point (arrival angle:distance). Two optional arguments set the \lstinline!shorten <=! and \lstinline!shorten >=! lengths for the arrow in question, which override the global values which can be adjusted using the \lstinline!\tikzset! mechanism. The \lstinline!\mcfpush! macro uses the \lstinline!mcfpusharrow! \tkz style (see above). This style references two color definitions, which were redefined using \lstinline!colorlet! (supplied by package \lstinline!xcolor!) in this example. The background color (\lstinline!mcfbgcolor!) defaults to white; you will only want to change it when drawing on a non-white canvas. This color definition is also used when drawing crossing bonds in the foreground (see section \ref{sec:tweaking}).
+
+Note that internally the picture overlay mechanism is still used, so the need for processing the file through pdftex twice remains.
+
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/conclusion.tex b/graphics/mol2chemfig/doc/doc-source/chapters/conclusion.tex
new file mode 100644
index 0000000000..693129481a
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/conclusion.tex
@@ -0,0 +1,35 @@
+\section{Invoking \texttt{mol2chemfig} from within \LaTeX}
+
+Using the \lstinline!--shell-escape! option on Linux or its equivalents on other systems, \LaTeX\ can execute shell commands, capture the output and insert it directly into the document. We can use this with \mcf. If you have \mcf working and \LaTeX\ properly configured, the following command will insert the structure of FMNH directly into your document, without creating a separate file:
+
+\begin{verbatim}
+\mcfinput{-fw examples/fmnh.mol}
+\end{verbatim}
+
+\begin{center}
+\mcfinput{-fw examples/fmnh.mol}
+\end{center}
+
+\noindent Note, however, that with large documents and numerous formulas the overhead of running \texttt{mol2chemfig} on each formula during every compilation will add up.
+
+\section{\texttt{chemfig} settings used in this document}
+\label{sec:ChemfigSettings}
+
+Several settings are offered by \chf to control the appearance of structures in your documents. Below are the settings that were used in this document.
+
+\lstinputlisting{hand-coded-tex/chemfig-settings}
+
+\section{Conclusion}
+
+This tutorial has covered most capabilities of \mcf. There are a few more options that influence the appearance of the output; these should be pretty much self-explanatory.
+
+I hope \mcf will be useful to you. If you come across any bugs or issues, please send email to mpalmer\lstinline!@!uwaterloo.ca.
+
+\section{Acknowledgments}
+
+Christian Tellechea wrote the excellent \chf package, upon which \mcf is based. He also gave valuable advice and suggestions concerning \mcf itself. To the extent that \mcf understands chemistry, it owes this to the creators of \texttt{indigo}. An earlier version of \mcf used \texttt{rdkit}; however, after some experimentation, I found that \texttt{indigo} was better suited to my purpose. Nevertheless, I thank \texttt{rdkit}'s creator, Greg Landrum, for promptly and thoroughly answering all my questions.
+%
+My student Eric Brefo-Mensah tested the code extensively and uncovered numerous bugs (or rather, a whole plague of locusts). Further bugs were reported by Benjamin Abel, Philipp Bisson, and Vincent Liegeois.
+%
+% A big thank you to everyone.
+
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/context.tex b/graphics/mol2chemfig/doc/doc-source/chapters/context.tex
new file mode 100644
index 0000000000..f05692f986
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/context.tex
@@ -0,0 +1,5 @@
+\subsection{ConTeXt compatibility}
+
+Currently not available.
+
+%\tkz and \chf are both compatible with ConTeXt. I don't know the first thing about ConTeXt myself, but thankfully Christian Tellechea, the author of \chf, has provided a plain-\TeX\ file with macros that should allow \mcf to work with ConTeXt. This file, \mcfplain, is also included with the archive and should be installed alongside \chf.
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/help.tex b/graphics/mol2chemfig/doc/doc-source/chapters/help.tex
new file mode 100644
index 0000000000..b38ca5df9c
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/help.tex
@@ -0,0 +1,7 @@
+\section{Getting help}
+
+When you type \lstinline!mol2chemfig -h! or just \lstinline!mol2chemfig!, you will see a brief description of the program, as well as a list of all available options:%
+%
+\bigskip
+
+\lstinputlisting{optionlist}
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/hydrogens.tex b/graphics/mol2chemfig/doc/doc-source/chapters/hydrogens.tex
new file mode 100644
index 0000000000..0f1d4fdfa4
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/hydrogens.tex
@@ -0,0 +1,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}).
+
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/input-modes.tex b/graphics/mol2chemfig/doc/doc-source/chapters/input-modes.tex
new file mode 100644
index 0000000000..75e60f79cd
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/input-modes.tex
@@ -0,0 +1,25 @@
+\subsection{Input modes}
+
+By default, if you type \lstinline!mol2chemfig myinput!, \mcf expects \texttt{myinput} to be the name of a file that contains a molecule's description in either \mf or \smiles format. These are widely used file formats that can be exported from any chemical drawing program that I am aware of.
+%
+If you want \texttt{myinput} to be treated verbatim, rather than as a file name, you say:
+
+\begin{lstlisting}
+mol2chemfig --input=direct 'C1=CC=C(C=C1)O'
+\end{lstlisting}
+
+or, shorter:
+
+\begin{lstlisting}
+mol2chemfig -i direct 'C1=CC=C(C=C1)O'
+\end{lstlisting}
+
+When passing a smiles string as in this example, don't forget to put quotes around it; without them, the shell will try to expand it and likely cause an error.
+
+There is also the input format 'pubchem', which makes \mcf expect a numerical identifier for the pubchem database:
+
+\begin{lstlisting}
+mol2chemfig -i pubchem 996
+\end{lstlisting}
+
+This retrieves the \texttt{SDF} file for compound no.\ 996 (which happens to be phenol) from the PubChem database and uses it as input. The \texttt{SDF} format is a superset of the \texttt{molfile} format and is understood by the program as well. Obviously, you have to be online for this input mode to work.
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/installation.tex b/graphics/mol2chemfig/doc/doc-source/chapters/installation.tex
new file mode 100644
index 0000000000..afd900f9db
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/installation.tex
@@ -0,0 +1,43 @@
+\section{Installation}
+
+There are three ways to run \mcf:
+%
+\begin{inparaenum}
+\item You can use the web interface.
+\item You can install a web client version of \mcf that is operated from the command line.
+\item You can install the entire program locally.
+\end{inparaenum}
+
+With options 1 and 2, everything you need can hopefully be installed via TeXLive by the time you read this. In contrast, with option 3, some additional handiwork is required.
+
+Update: \mcf has been on CTAN for a good while now, but as far as I can tell adoption into TeXLive has not happened, and apparently isn't going to.
+
+\subsection{\LaTeX\ requirements}
+
+In order to use the code generated by \mcf in your documents, you need
+
+\begin{enumerate}
+\item \tkz, a large and powerful general graphics package.
+
+\item \chf, which defines the code format used by \mcf and uses \tkz to render it to molecule graphics.
+
+\item The \texttt{mol2chemfig.sty} package. This is a very small package that defines some auxiliary macros for \mcf.
+\end{enumerate}
+
+\tkz and \chf are available through TeXLive, and \mcf is or will hopefully soon be, too. Note that the \mcf package will load the \chf package for you, which in turn loads \tkz. Therefore, in your documents, it is sufficient to include the clause \lstinline!\usepackage{mol2chemfig}! in order to load all three of them.
+
+\subsection{Installing the Lua web client}
+
+The web client should be installed and properly configured when you install \mcf through TeXLive; this is the preferred method. You should be able to invoke it from a shell window (or command prompt, in Windows parlance) with the command
+
+\begin{lstlisting}
+$ mol2chemfig.lua
+\end{lstlisting}
+
+If you downloaded the \mcf bundle from CTAN, no automatic installation is performed. In that case, follow the instructions in the included README file.
+
+\subsection{Local installation}
+
+For the full local install of \mcf, you need a Python base installation, and additionally the \texttt{indigo} cheminformatics toolkit. On at least some Linux distributions, \texttt{indigo} is available through the package manager. On other systems, manual download (\url{http://ggasoftware.com/download/indigo}) and installation may be required.
+
+Once you have the prerequisites installed and working, download the \mcf Python code from \url{http://chimpsky.uwaterloo.ca/mol2chemfig}, unzip in a convenient location and follow the included instructions.
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/introduction.tex b/graphics/mol2chemfig/doc/doc-source/chapters/introduction.tex
new file mode 100644
index 0000000000..ad260ca6dd
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/introduction.tex
@@ -0,0 +1,43 @@
+
+\section{A few examples}
+\label{sec:example}
+
+The following is a \smiles representation of caffeine, contained in the file \texttt{caffeine.smi}:
+
+\lstinputlisting{caffeine.smi}
+
+We can turn this into \chf code with the following command:%
+%
+\footnote{The examples in this document assume that you have installed the local version of \mcf. If you installed the web client version, you must use \lstinline!mol2chemfig.lua! wherever the listed example commands use \lstinline!mol2chemfig!.}
+
+\lstinputlisting{caffeine-from-smiles.sh}
+
+This writes the following \chf code to the target file:
+
+\lstinputlisting{caffeine-smi.tex}
+
+If we load this file with \lstinline!\input{caffeine-smi.tex}!, we get the following result%
+%
+\footnote{The appearance of the chemical formulas in this document has been tweaked using some settings that are provided by the \texttt{chemfig} package. The settings used here are listed in Section \ref{sec:ChemfigSettings}.}
+
+\cfpic{caffeine-smi.tex}
+
+which is almost what we want. We adjust the rotation of the molecule and also tweak its appearance a little:
+
+\lstinputlisting{caffeine-from-smiles-rotated.sh}
+
+With these modifications, the structure looks as follows:
+
+\cfpic{caffeine-smi2.tex}
+
+Small molecules like caffeine are fairly easy to create with \chf alone. Hand-written \chf code will look cleaner and more concise than the code generated by \mcf. For example, here is the hand-coded \chf version for caffeine that will produce the exact same graphic as the last \mcf command:
+
+\lstinputlisting{hand-coded-tex/caffeine}
+%
+In particular, the syntax for specifying rings and ring substituents in \chf is remarkably powerful and elegant. With a little practice, molecules such as this one can be hand-written with little effort, and I sincerely recommend that you learn this skill. However, if you need to depict many small molecules, or fairly large ones, a tool like \mcf will come in handy. Take, for example, the lipopeptide antibiotic daptomycin, which we in this case load from a molfile:
+
+\lstinputlisting{daptomycin1.sh}
+
+\cfpic{daptomycin}
+
+This molecule might take a little longer to code by hand \ldots
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/output.tex b/graphics/mol2chemfig/doc/doc-source/chapters/output.tex
new file mode 100644
index 0000000000..9db9450716
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/output.tex
@@ -0,0 +1,53 @@
+\subsection{Output destination and formats}
+
+By default, \mcf simply writes to the terminal (stdout). Use output redirection to send the output to a file instead:
+
+\lstinputlisting{phenol-from-smiles.sh}
+
+This writes the following \chf code to the file:
+
+\lstinputlisting{phenol-smi.tex}
+
+If we input this code directly, we will not produce a graphic; instead, we will just see the code itself, only without the line breaks. To produce a graphic, the code must be enclosed in a \lstinline!\chemfig{...}! macro. This could be done manually by copying and pasting. It is usually more convenient to use the \lstinline!-w! or \lstinline!--wrap-chemfig! option:
+
+\lstinputlisting{phenol-from-smiles-w.sh}
+
+which will produce
+
+\lstinputlisting{phenol-smi-wrapped.tex}
+
+This file can then be used with \lstinline!\input{phenol-smi-wrapped}! directly:
+
+\cfpic{phenol-smi-wrapped}
+
+Note that the following will \emph{not} work:
+
+\begin{lstlisting}
+\chemfig{\input{phenol-smi.tex}}
+\end{lstlisting}
+
+This is because the \lstinline!\chemfig{...}! command puts \TeX\ into an altogether different frame of mind, in which many other commands, including \lstinline!\input!, no longer work as usual.
+
+In addition to the option \lstinline!--wrap-chemfig! or \lstinline!-w!, there is also the option \lstinline!--submol-name! or \lstinline!-l!, which will wrap the generated code into a \lstinline!\definesubmol! macro:
+
+\lstinputlisting{phenol-as-submol.sh}
+
+%\clearpage
+
+This produces
+
+\lstinputlisting{phenol-as-submol.tex}
+
+The \lstinline!\definesubmol! macro is implemented by \chf and defines a named shortcut for a molecule or fragment. This is useful if you want to integrate the generated code into larger, manually assembled structures or drawings. We will revisit this topic below.
+
+In the file listings above, each atom appears on a separate line and is annotated by a comment with its number. The \texttt{\% ->} in the last line indicates that this bond does not create a new atom but instead connects back to atom number 4 to close a ring.
+
+The formatting and annotation in the code example above is useful if you want to manually edit the generated code. If this is not required, you can create more compact output with option \lstinline!--terse! or \lstinline!-z!:
+
+\lstinputlisting{phenol-from-smiles-wz.sh}
+
+The generated code is equivalent, but with comments and whitespace stripped out:
+
+\lstinputlisting{phenol-smi-terse}
+
+%\cfpic{phenol-smi-terse} % just checkin ... chicken?
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/polishing.tex b/graphics/mol2chemfig/doc/doc-source/chapters/polishing.tex
new file mode 100644
index 0000000000..481cde81e6
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/polishing.tex
@@ -0,0 +1,39 @@
+\subsection{Tweaking the appearance of bonds}
+\label{sec:tweaking}
+
+The plain command
+
+\lstinputlisting{morphine.sh}
+
+produces
+
+\cfpic{morphine.tex}
+
+which can be improved. First, we may want to give the double (and, if present, triple) bonds a more well-proportioned look. To do so, use option \lstinline!--fancy-bonds! or \lstinline!-f!:
+
+\lstinputlisting{morphine-f.sh}
+
+which gives
+
+\cfpic{morphine-f.tex}
+
+Note that the look of the double bonds involves some \tkz trickery; in the generated code, the double bonds are no longer represented by \lstinline!=! symbols but instead by something like \lstinline!-[:120,,,,drh]!. Also note that, for this to work, you need the current version of the \mcf \LaTeX\ package.
+
+Next, the molecule contains two bonds that cross each other, and we would like to draw the vertical one in the foreground. To specify this bond, we need the numbers of the adjoining atoms. We first can let \mcf print the atom numbers:
+
+\lstinputlisting{morphine-n.sh}
+
+which gives
+
+\cfpic{morphine-n.tex}
+
+The bond that we are looking at connects atoms 19 and 20. We now can use the \lstinline!-k! or \lstinline!--crossbond! option to put it in the foreground:
+
+\lstinputlisting{morphine-k.sh}
+
+which gives us
+
+\cfpic{morphine-k.tex}
+
+To draw crossing bonds, atom numbers and proportioned double or triple bonds, \mcf relies on several custom macros and \tkz styles defined in the \texttt{mol2chemfig.sty} package. Accordingly, the generated code becomes a bit more verbose and less \chf-like.
+
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/recalculating.tex b/graphics/mol2chemfig/doc/doc-source/chapters/recalculating.tex
new file mode 100644
index 0000000000..04a6bf428c
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/recalculating.tex
@@ -0,0 +1,10 @@
+\subsection{Recalculating coordinates}
+\label{sec:recalc}
+
+Molecules specified in \texttt{SMILES} format don't have any coordinates attached to them, so \mcf needs to calculate them; this is performed automatically. Input in \texttt{molfile} format comes with coordinates attached, and \mcf uses these by default. However, we can explicitly request \mcf to discard these coordinates and calculate new ones with the \lstinline!--recalculate-coordinates! or \lstinline!-u! option. When applied to the daptomycin example from section \ref{sec:example},
+\lstinputlisting{daptomycin-u.sh}
+
+this gives us
+
+\cfpic{daptomycin-u.tex}
+
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/submolecules.tex b/graphics/mol2chemfig/doc/doc-source/chapters/submolecules.tex
new file mode 100644
index 0000000000..c4ef14ada1
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/submolecules.tex
@@ -0,0 +1,46 @@
+\subsection{Working with sub-molecules}
+
+The \chf package supplies a nifty mechanism to assemble larger molecules from predefined fragments, or sub-molecules. The following (hand-coded) example builds aspirin from two sub-molecules:
+
+\lstinputlisting{hand-coded-tex/aspirin.tex}
+
+\cfpic{hand-coded-tex/aspirin}
+
+As a more advanced example, let us piece together the structure of Sodium Green, a fluorescent sodium indicator dye (the figure below was ripped from an information sheet by the supplier, Molecular Probes).
+
+\begin{center}
+\includegraphics[width=0.75\textwidth]{examples/hand-coded-tex/sodium-green.png}
+\end{center}
+
+The molecule contains two moieties of dichlorofluorescein, attached to a crown ether via a linker. We start with dichlorofluorescein as one submol and the crown ether-cum-linkers as the other.
+
+\lstinputlisting{dichlorofluorescein1.sh}
+
+Now, we put the two pieces together, starting with the bridging carbonyl group:
+
+\lstinputlisting{hand-coded-tex/sodium-green1}
+
+which gives us the following fabulous result:
+
+\cfpic{hand-coded-tex/sodium-green1}
+
+What went wrong here? Submol expansion is essentially string substitution. When the submol is filled in, the connection to the preceding part of the molecule is made by whatever atom happens to have been rendered first, and the last rendered atom connects to the subsequent parts of the structure. So, we need to tell \mcf the order in which to render the atoms. To identify the atoms that we want to join, we display all atom numbers in the structure.
+
+\lstinputlisting[firstline=2]{dichlorofluorescein2.sh}
+
+\cfpic{hand-coded-tex/sodium-green2}
+
+For dichlorofluorescein, we need to connect to atom 22. For the crown ether, we want to enter at atom 12 coming from the left, and leave at atom 32 on the right. To render the sub-molecules accordingly, we use the \lstinline!--entry-atom! or \lstinline!-e! as well as the \lstinline!--exit-atom! or \lstinline!-x! options:
+
+\lstinputlisting[firstline=2]{dichlorofluorescein3.sh}
+
+We put the whole molecule together:
+
+\lstinputlisting{hand-coded-tex/sodium-green3.tex}
+
+This produces
+
+\cfpic{hand-coded-tex/sodium-green3}
+
+which is what we want \ldots\ well, almost; the entry and exit amine groups of the crown ether submol now each have one surplus hydrogen. This problem cannot be fixed using \mcf but requires editing of the generated code by hand.
+
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/tpic1.tex b/graphics/mol2chemfig/doc/doc-source/chapters/tpic1.tex
new file mode 100644
index 0000000000..b6cbf60595
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/tpic1.tex
@@ -0,0 +1,18 @@
+\input{plp}
+\input{plp2}
+
+\begin{center}
+\begin{tikzpicture}%
+[>=stealth, help lines/.style={very thin,draw=black!25}, x=1cm, y=1cm]
+
+% draw grid of help lines
+\draw[help lines] (0,0) grid (12,4);
+
+% place both structures
+\node[anchor=south west, inner sep=10pt] at (0,0) (plp) {\chemfig{!{plp}}};
+\node[anchor=south west, inner sep=10pt] at (7,0) (plp2) {\chemfig{!{plp2}}};
+
+\draw[<->] (plp) -- (plp2);
+
+\end{tikzpicture}
+\end{center} \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/tpic2.tex b/graphics/mol2chemfig/doc/doc-source/chapters/tpic2.tex
new file mode 100644
index 0000000000..6280b5af20
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/tpic2.tex
@@ -0,0 +1,21 @@
+\input{mp}
+
+\begin{center}
+\begin{tikzpicture}% first picture contains mol2chemfig structure
+[>=stealth, help lines/.style={very thin,draw=black!25}, x=1cm, y=1cm]
+
+\draw[help lines] (0,0) grid (6,3);
+\node[anchor=south west, inner sep=10pt] at (1,0) {\chemfig{!{mp}}};
+\end{tikzpicture}
+
+\begin{tikzpicture}[remember picture,overlay] % overlaid picture
+% places draws relative to nodes defined in the mol2chemfig structure
+
+% The mcfpusharrow tikz style is defined in the mol2chemfig package.
+\draw[mcfpusharrow](mp12-13) to [out=60,in=60,looseness=4] (mp11-12);
+\draw[mcfpusharrow](mp2-3) to [out=105,in=105,looseness=5] (mp3);
+
+% attach some arbitrary shapes
+\draw[semithick,blue,fill=red](mp17) -- ++(0.3,0.3) arc (-135:225:0.2);
+\end{tikzpicture}
+\end{center}
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/tpic3.tex b/graphics/mol2chemfig/doc/doc-source/chapters/tpic3.tex
new file mode 100644
index 0000000000..82567ec23c
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/tpic3.tex
@@ -0,0 +1,16 @@
+\input{mp}
+
+\colorlet{mcfpusharrowcolor}{red}
+\colorlet{mcfbgcolor}{yellow}
+\begin{center}
+\begin{tikzpicture}[help lines, x=1cm, y=1cm]
+
+\draw[help lines] (0,0) grid (6,3);
+\node[anchor=south west, inner sep=10pt] at (1,0) {\chemfig{!{mp}}};
+
+\mcfpush{mp12-13}{60:1.5em}{mp11-12}{60:1.5em}
+\mcfpush[-4pt][4pt]{mp2-3}{105:1.5em}{mp3}{105:1.5em}
+
+\end{tikzpicture}
+\end{center}
+
diff --git a/graphics/mol2chemfig/doc/doc-source/chapters/tutorial.tex b/graphics/mol2chemfig/doc/doc-source/chapters/tutorial.tex
new file mode 100644
index 0000000000..ddf8c9ef82
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/chapters/tutorial.tex
@@ -0,0 +1,4 @@
+\section{Tutorial}
+
+In the following, we will work through a series of examples to illustrate the use of some of \mcf's options. With all but the most basic examples, it will be assumed that you are familiar with \chf and its syntax. If you aren't, you can still use \mcf, but you will not be able to manually enhance the \chf output that it generates---your loss.
+
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/atcc.mol b/graphics/mol2chemfig/doc/doc-source/examples/atcc.mol
new file mode 100644
index 0000000000..f89a2c3c99
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/atcc.mol
@@ -0,0 +1,49 @@
+43232
+ Marvin 02171312492D
+
+ 21 23 0 0 1 0 999 V2000
+ 5.2962 -0.1515 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.7251 -0.1697 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.3278 2.3234 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.5008 2.4702 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.8930 1.6596 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.1066 0.6270 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1.9120 1.1808 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.1255 0.3840 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 4.4955 1.0815 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.8280 -0.0746 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 4.5818 0.2610 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.0159 0.2519 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.0265 1.0768 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.3173 1.4984 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.7462 1.4802 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.7567 2.3051 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 7.4553 1.0586 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 7.4764 2.7085 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 8.1750 1.4620 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 8.1855 2.2869 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.8425 3.2211 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1 11 1 0 0 0 0
+ 1 12 1 0 0 0 0
+ 2 12 2 0 0 0 0
+ 3 14 1 0 0 0 0
+ 5 4 1 0 0 0 0
+ 5 7 1 0 0 0 0
+ 5 9 1 0 0 0 0
+ 6 8 1 0 0 0 0
+ 6 10 1 0 0 0 0
+ 7 8 1 0 0 0 0
+ 9 11 1 0 0 0 0
+ 10 11 1 0 0 0 0
+ 12 13 1 0 0 0 0
+ 13 14 1 0 0 0 0
+ 13 15 1 0 0 0 0
+ 15 16 2 0 0 0 0
+ 15 17 1 0 0 0 0
+ 16 18 1 0 0 0 0
+ 17 19 2 0 0 0 0
+ 18 20 2 0 0 0 0
+ 19 20 1 0 0 0 0
+ 4 21 1 0 0 0 0
+ 6 4 2 0 0 0 0
+M END
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/caffeine-from-smiles-rotated.sh b/graphics/mol2chemfig/doc/doc-source/examples/caffeine-from-smiles-rotated.sh
new file mode 100755
index 0000000000..328348612c
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/caffeine-from-smiles-rotated.sh
@@ -0,0 +1 @@
+mol2chemfig -zwom -a -30 caffeine.smi > caffeine-smi2.tex \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/caffeine-from-smiles.sh b/graphics/mol2chemfig/doc/doc-source/examples/caffeine-from-smiles.sh
new file mode 100755
index 0000000000..33899ea052
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/caffeine-from-smiles.sh
@@ -0,0 +1 @@
+mol2chemfig -zw caffeine.smi > caffeine-smi.tex \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/caffeine-smi.tex b/graphics/mol2chemfig/doc/doc-source/examples/caffeine-smi.tex
new file mode 100644
index 0000000000..2aa7e08f8c
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/caffeine-smi.tex
@@ -0,0 +1,2 @@
+\chemfig{-[:138]N-[:84]=^[:156]N-[:228]=^[:300](-[:12]\phantom{N})-[:240](%
+=[:300]O)-[:180]N(-[:240])-[:120](=[:180]O)-[:60]N(-)-[:120]}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/caffeine-smi2.tex b/graphics/mol2chemfig/doc/doc-source/examples/caffeine-smi2.tex
new file mode 100644
index 0000000000..25a670d931
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/caffeine-smi2.tex
@@ -0,0 +1,3 @@
+\chemfig{CH_3-[:108,,1]N-[:54](-[:180,0.85,,,draw=none]\mcfcringle{1.03})%
+-[:126]N-[:198]-[:270](-[:342]\phantom{N})-[:210](=[:270]O)-[:150]N(%
+-[:210,,,2]H_3C)-[:90](=[:150]O)-[:30]N(-[:330])-[:90,,,1]CH_3}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/caffeine.mol b/graphics/mol2chemfig/doc/doc-source/examples/caffeine.mol
new file mode 100644
index 0000000000..b2d778e47e
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/caffeine.mol
@@ -0,0 +1,34 @@
+
+ Marvin 01220818012D
+
+ 14 15 0 0 0 0 999 V2000
+ 3.7321 2.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.0000 -1.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.7321 -1.0000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.5443 0.8047 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.8660 0.5000 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.5443 -0.8047 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 4.5981 0.5000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 4.5981 -0.5000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.7321 1.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.8660 -0.5000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.1279 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.7321 -2.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.8550 1.7553 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.0000 1.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1 9 2 0 0 0 0
+ 2 10 2 0 0 0 0
+ 3 8 1 0 0 0 0
+ 3 10 1 0 0 0 0
+ 3 12 1 0 0 0 0
+ 4 7 1 0 0 0 0
+ 4 11 1 0 0 0 0
+ 4 13 1 0 0 0 0
+ 5 9 1 0 0 0 0
+ 5 10 1 0 0 0 0
+ 5 14 1 0 0 0 0
+ 6 8 1 0 0 0 0
+ 6 11 2 0 0 0 0
+ 7 8 2 0 0 0 0
+ 7 9 1 0 0 0 0
+M END \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/caffeine.smi b/graphics/mol2chemfig/doc/doc-source/examples/caffeine.smi
new file mode 100644
index 0000000000..fd1cc5f151
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/caffeine.smi
@@ -0,0 +1 @@
+CN1C=NC2=C1C(=O)N(C(=O)N2C)C
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/ce-submol1.tex b/graphics/mol2chemfig/doc/doc-source/examples/ce-submol1.tex
new file mode 100644
index 0000000000..361453c98e
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/ce-submol1.tex
@@ -0,0 +1,56 @@
+\definesubmol{ce1}{
+ % 9
+ -[:180]O% 8
+ -[:240]% 6
+ =_[:300]% 5
+ (
+ -[:240]% 4
+ =_[:180]% 3
+ (
+ -[:240]O% 10
+ -[:180]% 11
+ )
+ -[:120]% 2
+ (
+ -[:180,,,2]H_2N% 12
+ )
+ =_[:60]% 1
+ -% -> 6
+ )
+ -N% 7
+ -[:240]% 13
+ -[:315]% 14
+ -[:15]O% 15
+ -[:300]% 16
+ -% 17
+ -[:60]O% 18
+ -[:345]% 19
+ -[:45]% 20
+ -[:120]N% 21
+ (
+ -[:120]% 24
+ -[:180]% 37
+ -[:231.5,1.089]O% 25
+ -[:128.1,1.084]% 23
+ -[:180]% 22
+ -[:240]\phantom{N}% -> 7
+ )
+ -% 26
+ =_[:60]% 27
+ (
+ -[:120]O% 33
+ -[:180]% 34
+ )
+ -% 31
+ =_[:300]% 30
+ (
+ -[,,,1]NH_2% 32
+ )
+ -[:240]% 29
+ (
+ =_[:180]% 28
+ -[:120]% -> 26
+ )
+ -[:300]O% 35
+ -% 36
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/ce-submol2.tex b/graphics/mol2chemfig/doc/doc-source/examples/ce-submol2.tex
new file mode 100644
index 0000000000..fa9d4f44d7
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/ce-submol2.tex
@@ -0,0 +1,56 @@
+\definesubmol{ce2}{
+ \mcfatomno{9}% 9
+ -[:180]\mcfabove{O}{\mcfatomno{8}}% 8
+ -[:240]\mcfatomno{6}% 6
+ =_[:300]\mcfatomno{5}% 5
+ (
+ -[:240]\mcfatomno{4}% 4
+ =_[:180]\mcfatomno{3}% 3
+ (
+ -[:240]\mcfbelow{O}{\mcfatomno{10}}% 10
+ -[:180]\mcfatomno{11}% 11
+ )
+ -[:120]\mcfatomno{2}% 2
+ (
+ -[:180]\mcfleft{\mcfatomno{12}}{N}% 12
+ )
+ =_[:60]\mcfatomno{1}% 1
+ -\phantom{6}% -> 6
+ )
+ -\mcfright{N}{\mcfatomno{7}}% 7
+ -[:240]\mcfatomno{13}% 13
+ -[:315]\mcfatomno{14}% 14
+ -[:15]\mcfabove{O}{\mcfatomno{15}}% 15
+ -[:300]\mcfatomno{16}% 16
+ -\mcfatomno{17}% 17
+ -[:60]\mcfabove{O}{\mcfatomno{18}}% 18
+ -[:345]\mcfatomno{19}% 19
+ -[:45]\mcfatomno{20}% 20
+ -[:120]\mcfleft{\mcfatomno{21}}{N}% 21
+ (
+ -[:120]\mcfatomno{24}% 24
+ -[:180]\mcfatomno{37}% 37
+ -[:231.5,1.089]\mcfbelow{O}{\mcfatomno{25}}% 25
+ -[:128.1,1.084]\mcfatomno{23}% 23
+ -[:180]\mcfatomno{22}% 22
+ -[:240]\phantom{N}% -> 7
+ )
+ -\mcfatomno{26}% 26
+ =_[:60]\mcfatomno{27}% 27
+ (
+ -[:120]\mcfabove{O}{\mcfatomno{33}}% 33
+ -[:180]\mcfatomno{34}% 34
+ )
+ -\mcfatomno{31}% 31
+ =_[:300]\mcfatomno{30}% 30
+ (
+ -\mcfright{N}{\mcfatomno{32}}% 32
+ )
+ -[:240]\mcfatomno{29}% 29
+ (
+ =_[:180]\mcfatomno{28}% 28
+ -[:120]\phantom{26}% -> 26
+ )
+ -[:300]\mcfbelow{O}{\mcfatomno{35}}% 35
+ -\mcfatomno{36}% 36
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/ce-submol3.tex b/graphics/mol2chemfig/doc/doc-source/examples/ce-submol3.tex
new file mode 100644
index 0000000000..1821d496c5
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/ce-submol3.tex
@@ -0,0 +1,56 @@
+\definesubmol{ce3}{
+ H_2N% 12
+ -[,,2]% 2
+ =_[:60]% 1
+ -% 6
+ (
+ -[:60]O% 8
+ -% 9
+ )
+ =_[:300]% 5
+ (
+ -[:240]% 4
+ =_[:180]% 3
+ (
+ -[:240]O% 10
+ -[:180]% 11
+ )
+ -[:120]% -> 2
+ )
+ -N% 7
+ -[:240]% 13
+ -[:315]% 14
+ -[:15]O% 15
+ -[:300]% 16
+ -% 17
+ -[:60]O% 18
+ -[:345]% 19
+ -[:45]% 20
+ -[:120]N% 21
+ (
+ -[:120]% 24
+ -[:180]% 37
+ -[:231.5,1.089]O% 25
+ -[:128.1,1.084]% 23
+ -[:180]% 22
+ -[:240]\phantom{N}% -> 7
+ )
+ -% 26
+ =_[:60]% 27
+ (
+ -[:120]O% 33
+ -[:180]% 34
+ )
+ -% 31
+ =_[:300]% 30
+ (
+ -[:240]% 29
+ (
+ -[:300]O% 35
+ -% 36
+ )
+ =_[:180]% 28
+ -[:120]% -> 26
+ )
+ -[,,,1]NH_2% 32
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/crown-ether.mol b/graphics/mol2chemfig/doc/doc-source/examples/crown-ether.mol
new file mode 100644
index 0000000000..f7cf5a32e8
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/crown-ether.mol
@@ -0,0 +1,81 @@
+
+ Marvin 05211219442D
+
+ 37 39 0 0 0 0 999 V2000
+ -2.8249 2.1308 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -3.2373 1.4163 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.8248 0.7018 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.9998 0.7018 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.5873 1.4163 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.9999 2.1308 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.7623 1.4163 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.5873 2.8452 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.7623 2.8452 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -3.2373 -0.0127 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ -4.0623 -0.0127 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -4.0623 1.4163 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.1748 0.7018 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.5914 0.1185 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.2055 0.3320 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.6180 -0.3825 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1.4430 -0.3825 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1.8555 0.3320 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.6523 0.1185 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.2357 0.7018 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.8232 1.4163 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.3498 2.1308 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.4752 2.1308 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.4107 2.1308 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1.0266 1.4272 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.6482 1.4163 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 4.0607 2.1308 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 4.0607 0.7018 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 4.8857 0.7018 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.2982 1.4163 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 4.8857 2.1308 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.1232 1.4163 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.6482 2.8452 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.8232 2.8452 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.2982 -0.0127 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.1232 -0.0127 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1.5857 2.1308 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1 2 2 0 0 0 0
+ 2 3 1 0 0 0 0
+ 3 4 2 0 0 0 0
+ 4 5 1 0 0 0 0
+ 5 6 2 0 0 0 0
+ 1 6 1 0 0 0 0
+ 5 7 1 0 0 0 0
+ 6 8 1 0 0 0 0
+ 8 9 1 0 0 0 0
+ 3 10 1 0 0 0 0
+ 10 11 1 0 0 0 0
+ 2 12 1 0 0 0 0
+ 7 13 1 0 0 0 0
+ 13 14 1 0 0 0 0
+ 14 15 1 0 0 0 0
+ 15 16 1 0 0 0 0
+ 16 17 1 0 0 0 0
+ 17 18 1 0 0 0 0
+ 18 19 1 0 0 0 0
+ 19 20 1 0 0 0 0
+ 20 21 1 0 0 0 0
+ 7 22 1 0 0 0 0
+ 22 23 1 0 0 0 0
+ 21 24 1 0 0 0 0
+ 23 25 1 0 0 0 0
+ 21 26 1 0 0 0 0
+ 27 26 2 0 0 0 0
+ 26 28 1 0 0 0 0
+ 28 29 2 0 0 0 0
+ 29 30 1 0 0 0 0
+ 30 31 2 0 0 0 0
+ 27 31 1 0 0 0 0
+ 30 32 1 0 0 0 0
+ 27 33 1 0 0 0 0
+ 33 34 1 0 0 0 0
+ 29 35 1 0 0 0 0
+ 35 36 1 0 0 0 0
+ 24 37 1 0 0 0 0
+ 37 25 1 0 0 0 0
+M END
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/cubane.mol b/graphics/mol2chemfig/doc/doc-source/examples/cubane.mol
new file mode 100644
index 0000000000..cd329e0eff
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/cubane.mol
@@ -0,0 +1,25 @@
+136090
+ OpenBabel01111309492D
+
+ 8 12 0 0 1 0 0 0 0 0999 V2000
+ 2.0000 -0.7000 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0
+ 2.0000 0.3000 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0
+ 3.0000 -0.7000 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0
+ 2.4000 -0.3000 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0
+ 3.0000 0.3000 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0
+ 2.4000 0.7000 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0
+ 3.4000 -0.3000 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0
+ 3.4000 0.7000 0.0000 C 0 0 3 0 0 0 0 0 0 0 0 0
+ 1 2 1 0 0 0 0
+ 1 3 1 0 0 0 0
+ 1 4 1 0 0 0 0
+ 2 5 1 0 0 0 0
+ 2 6 1 0 0 0 0
+ 3 5 1 0 0 0 0
+ 3 7 1 0 0 0 0
+ 4 6 1 0 0 0 0
+ 4 7 1 0 0 0 0
+ 5 8 1 0 0 0 0
+ 6 8 1 0 0 0 0
+ 7 8 1 0 0 0 0
+M END
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/daptomycin-u.sh b/graphics/mol2chemfig/doc/doc-source/examples/daptomycin-u.sh
new file mode 100755
index 0000000000..bd26c321ea
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/daptomycin-u.sh
@@ -0,0 +1 @@
+mol2chemfig -u -wf daptomycin.mol > daptomycin-u.tex \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/daptomycin-u.tex b/graphics/mol2chemfig/doc/doc-source/examples/daptomycin-u.tex
new file mode 100644
index 0000000000..7bd845b685
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/daptomycin-u.tex
@@ -0,0 +1,191 @@
+\chemfig{
+ O% 5
+ =[:305.8]% 3
+ (
+ >:[:5.8]% 2
+ (
+ -[:65.8]% 4
+ -[:5.8]% 115
+ -[:59.8]% 109
+ -[:107.8]% 110
+ -[:47.8,,,,drh]% 111
+ -[:347.8]% 112
+ -[:287.8,,,,drh]% 107
+ -[:227.8]% 108
+ (
+ -[:275.8,,,1]NH% 113
+ -[:203.8,,1]% 114
+ -[:131.8,,,,dbr={73}{73}]% -> 115
+ )
+ -[:167.8,,,,drh]% -> 109
+ )
+ -[:305.8,,,1]NH% 1
+ -[:245.8,,1]% 93
+ (
+ -[:305.8]% 95
+ -[:5.8]% 96
+ -[:305.8]% 97
+ -[:5.8]% 98
+ -[:305.8]% 99
+ -[:5.8]% 100
+ -[:305.8]% 101
+ -[:5.8]% 102
+ -[:305.8]% 103
+ )
+ =[:185.8]O% 94
+ )
+ -[:245.8]\mcfbelow{N}{H}% 6
+ -[:185.8]% 7
+ (
+ <:[:245.8]% 9
+ -[:305.8]% 10
+ (
+ -[:245.8,,,2]H_2N% 12
+ )
+ =[:5.8]O% 11
+ )
+ -[:125.8]% 8
+ (
+ =[:65.8]O% 15
+ )
+ -[:185.8]\mcfbelow{N}{H}% 13
+ -[:125.8]% 14
+ (
+ -[:65.8]% 16
+ -[:125.8]% 19
+ (
+ =[:65.8]O% 21
+ )
+ -[:185.8,,,2]HO% 20
+ )
+ <:[:185.8]% 17
+ (
+ -[:265.8,,,,dbl={84}{0}]O% 22
+ )
+ -[:125.8]\mcfabove{N}{H}% 18
+ >:[:185.8]% 23
+ -[:270]% 24
+ (
+ =[:354.2]O% 26
+ )
+ -[:258.4,,,1]NH% 25
+ -[:246.8,,1]% 27
+ -[:235.2]% 28
+ (
+ =[:319.4]O% 29
+ )
+ -[:223.5]\mcfbelow{N}{H}% 30
+ -[:211.9]% 31
+ (
+ -[:296.1]% 33
+ -[:356.1]% 34
+ -[:296.1]% 35
+ -[:356.1,,,1]NH_2% 36
+ )
+ -[:200.3]% 32
+ (
+ =[:284.5]O% 37
+ )
+ -[:188.7]\mcfbelow{N}{H}% 38
+ -[:177.1]% 39
+ (
+ <[:261.3]% 43
+ -[:321.3]% 44
+ (
+ -[:261.3,,,1]OH% 46
+ )
+ =[:21.3]O% 45
+ )
+ -[:165.5]% 40
+ (
+ =[:249.7]O% 42
+ )
+ -[:153.9]\mcfbelow{N}{H}% 41
+ -[:142.3]% 47
+ (
+ <:[:226.5]% 49
+ )
+ -[:130.6]% 48
+ (
+ =[:214.8]O% 51
+ )
+ -[:119,,,2]HN% 50
+ -[:107.4,,2]% 52
+ (
+ <[:191.6]% 54
+ -[:251.6]% 55
+ (
+ -[:191.6,,,2]HO% 57
+ )
+ =[:311.6]O% 56
+ )
+ -[:95.8]% 53
+ (
+ =[:180]O% 58
+ )
+ -[:84.2,,,2]HN% 59
+ -[:72.6,,2]% 60
+ -[:61]% 61
+ (
+ =[:145.2]O% 62
+ )
+ -[:49.4]\mcfabove{N}{H}% 63
+ -[:37.7]% 64
+ (
+ <:[:121.9]% 104
+ -[:181.9,,,2]HO% 105
+ )
+ -[:26.1]% 91
+ (
+ =[:110.3]O% 92
+ )
+ -[:14.5]\mcfabove{N}{H}% 90
+ -[:2.9]% 82
+ (
+ <[:87.1]% 84
+ (
+ -[:147.1]% 86
+ -[:87.1]% 87
+ (
+ -[:147.1,,,2]HO% 89
+ )
+ =[:27.1]O% 88
+ )
+ -[:27.1]% 85
+ )
+ -[:351.3]% 81
+ (
+ =[:75.5]O% 83
+ )
+ -[:339.7]\mcfabove{N}{H}% 71
+ -[:328.1]% 69
+ (
+ -[:316.5]% 68
+ (
+ =[:40.6]O% 70
+ )
+ -[:304.8]O% 67
+ -[:293.2]% 65
+ (
+ <:[:17.4]% 66
+ )
+ -[:281.6]% -> 23
+ )
+ <[:52.3]% 72
+ -[:112.3]% 73
+ (
+ =[:172.3]O% 75
+ )
+ -[:52.3]% 74
+ -[:112.3,,,,drh]% 80
+ (
+ -[:172.3,,,2]H_2N% 106
+ )
+ -[:52.3]% 79
+ -[:352.3,,,,drh]% 78
+ -[:292.3]% 77
+ -[:232.3,,,,drh]% 76
+ (
+ -[:172.3]% -> 74
+ )
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/daptomycin.mol b/graphics/mol2chemfig/doc/doc-source/examples/daptomycin.mol
new file mode 100644
index 0000000000..7db489f00b
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/daptomycin.mol
@@ -0,0 +1,238 @@
+16134395
+ Marvin 05101211392D
+
+115118 0 0 0 0 999 V2000
+ 5.0233 3.7420 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.0233 4.5670 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0
+ 5.7378 4.9795 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 4.3088 4.9795 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.7378 5.8045 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.4522 4.5670 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 7.1667 4.9795 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0
+ 7.8812 4.5670 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 7.1667 5.8045 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 7.8812 6.2170 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 7.8812 7.0420 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 8.5956 5.8045 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 8.5956 4.9795 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 9.3101 4.5670 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0
+ 7.8812 3.7420 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 9.3101 3.7420 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.0246 4.9795 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.7390 4.5670 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.0246 3.3295 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.7390 3.7420 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.0246 2.5045 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.0246 5.8045 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 11.4535 4.9795 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0
+ 11.4535 5.8045 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.1680 6.2170 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.7390 6.2170 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.1680 7.0420 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.8825 7.4545 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.8825 8.2795 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 13.5969 7.0420 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 14.3114 7.4545 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.0259 7.0420 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 14.3114 8.2795 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.0259 8.6920 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.0259 9.5170 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.7403 9.9295 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.0259 6.2170 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.7403 7.4545 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 16.4548 7.0420 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0
+ 17.1693 7.4545 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 17.8838 7.0420 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 17.1693 8.2795 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 16.4548 6.2170 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 17.1693 5.8045 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 17.1693 4.9795 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 17.8837 6.2170 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 18.5983 7.4545 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0
+ 19.3127 7.0420 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 18.5983 8.2795 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 19.3127 6.2170 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 20.0272 7.4545 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 20.0272 5.8045 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0
+ 20.0272 4.9795 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 20.7417 6.2170 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 21.4562 5.8045 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 22.1706 6.2170 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 21.4562 4.9795 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 20.7417 4.5670 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 19.3127 4.5670 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 19.3127 3.7420 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 18.5983 3.3295 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 18.5983 2.5045 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 17.8838 3.7420 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 17.1693 3.3295 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0
+ 12.1680 4.5670 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0
+ 12.8824 4.9795 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.1680 3.7420 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.8824 3.3295 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.8824 2.5045 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0
+ 13.5969 3.7420 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 13.5969 2.0920 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.1680 2.0920 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.1680 1.2670 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 11.4535 0.8545 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.8824 0.8545 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.7390 1.2670 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.0246 0.8545 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.0246 0.0295 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.7390 -0.3830 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 11.4535 0.0295 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 14.3114 2.5045 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.0258 2.0920 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0
+ 14.3114 3.3295 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.0258 1.2670 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 14.3114 0.8545 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.7403 0.8545 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.7403 0.0295 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 16.4548 -0.3830 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.0258 -0.3830 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.7403 2.5045 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.7403 3.3295 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 15.0259 3.7420 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.7378 3.3295 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.4522 3.7420 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.7378 2.5045 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.0233 2.0920 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.0233 1.2670 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.7377 0.8545 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.4522 1.2670 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 7.1667 0.8545 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 7.1667 0.0295 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.4522 -0.3830 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.4522 -1.2080 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 17.1693 2.5045 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 17.8837 2.0920 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.1680 -0.3830 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.7955 8.1991 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.0810 7.7866 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.0810 6.9616 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 5.7955 6.5491 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.5100 6.9616 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 6.5100 7.7866 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 4.2964 8.0415 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.8115 7.3741 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 4.2964 6.7067 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1 2 1 0 0 0 0
+ 2 3 1 0 0 0 0
+ 2 4 1 1 0 0 0
+ 4115 1 0 0 0 0
+ 3 5 2 0 0 0 0
+ 3 6 1 0 0 0 0
+ 6 7 1 0 0 0 0
+ 7 8 1 0 0 0 0
+ 7 9 1 6 0 0 0
+ 9 10 1 0 0 0 0
+ 10 11 2 0 0 0 0
+ 10 12 1 0 0 0 0
+ 8 13 1 0 0 0 0
+ 13 14 1 0 0 0 0
+ 8 15 2 0 0 0 0
+ 14 16 1 6 0 0 0
+ 14 17 1 0 0 0 0
+ 17 18 1 0 0 0 0
+ 16 19 1 0 0 0 0
+ 19 20 1 0 0 0 0
+ 19 21 2 0 0 0 0
+ 17 22 2 0 0 0 0
+ 18 23 1 0 0 0 0
+ 23 24 1 6 0 0 0
+ 24 25 1 0 0 0 0
+ 24 26 2 0 0 0 0
+ 25 27 1 0 0 0 0
+ 27 28 1 0 0 0 0
+ 28 29 2 0 0 0 0
+ 28 30 1 0 0 0 0
+ 30 31 1 0 0 0 0
+ 31 32 1 0 0 0 0
+ 31 33 1 0 0 0 0
+ 33 34 1 0 0 0 0
+ 34 35 1 0 0 0 0
+ 35 36 1 0 0 0 0
+ 32 37 2 0 0 0 0
+ 32 38 1 0 0 0 0
+ 38 39 1 0 0 0 0
+ 39 40 1 0 0 0 0
+ 40 41 1 0 0 0 0
+ 40 42 2 0 0 0 0
+ 39 43 1 6 0 0 0
+ 43 44 1 0 0 0 0
+ 44 45 2 0 0 0 0
+ 44 46 1 0 0 0 0
+ 41 47 1 0 0 0 0
+ 47 48 1 0 0 0 0
+ 47 49 1 6 0 0 0
+ 48 50 1 0 0 0 0
+ 48 51 2 0 0 0 0
+ 50 52 1 0 0 0 0
+ 52 53 1 0 0 0 0
+ 52 54 1 1 0 0 0
+ 54 55 1 0 0 0 0
+ 55 56 2 0 0 0 0
+ 55 57 1 0 0 0 0
+ 53 58 2 0 0 0 0
+ 53 59 1 0 0 0 0
+ 59 60 1 0 0 0 0
+ 60 61 1 0 0 0 0
+ 61 62 2 0 0 0 0
+ 61 63 1 0 0 0 0
+ 63 64 1 0 0 0 0
+ 23 65 1 0 0 0 0
+ 65 66 1 1 0 0 0
+ 65 67 1 0 0 0 0
+ 67 68 1 0 0 0 0
+ 68 69 1 0 0 0 0
+ 68 70 2 0 0 0 0
+ 69 71 1 0 0 0 0
+ 69 72 1 1 0 0 0
+ 72 73 1 0 0 0 0
+ 73 74 1 0 0 0 0
+ 73 75 2 0 0 0 0
+ 80 74 2 0 0 0 0
+ 76 74 1 0 0 0 0
+ 76 77 2 0 0 0 0
+ 77 78 1 0 0 0 0
+ 78 79 2 0 0 0 0
+ 79 80 1 0 0 0 0
+ 71 81 1 0 0 0 0
+ 81 82 1 0 0 0 0
+ 81 83 2 0 0 0 0
+ 82 84 1 1 0 0 0
+ 84 85 1 0 0 0 0
+ 84 86 1 0 0 0 0
+ 86 87 1 0 0 0 0
+ 87 88 2 0 0 0 0
+ 87 89 1 0 0 0 0
+ 82 90 1 0 0 0 0
+ 90 91 1 0 0 0 0
+ 91 92 2 0 0 0 0
+ 1 93 1 0 0 0 0
+ 93 94 2 0 0 0 0
+ 93 95 1 0 0 0 0
+ 95 96 1 0 0 0 0
+ 96 97 1 0 0 0 0
+ 97 98 1 0 0 0 0
+ 98 99 1 0 0 0 0
+ 99100 1 0 0 0 0
+100101 1 0 0 0 0
+101102 1 0 0 0 0
+102103 1 0 0 0 0
+ 64104 1 6 0 0 0
+104105 1 0 0 0 0
+ 64 91 1 0 0 0 0
+ 80106 1 0 0 0 0
+107108 1 0 0 0 0
+109110 1 0 0 0 0
+110111 2 0 0 0 0
+111112 1 0 0 0 0
+107112 2 0 0 0 0
+115109 1 0 0 0 0
+108109 2 0 0 0 0
+113108 1 0 0 0 0
+113114 1 0 0 0 0
+114115 2 0 0 0 0
+M END
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/daptomycin.tex b/graphics/mol2chemfig/doc/doc-source/examples/daptomycin.tex
new file mode 100644
index 0000000000..2ccf1e736f
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/daptomycin.tex
@@ -0,0 +1,191 @@
+\chemfig{
+ O% 5
+ =[:270]% 3
+ (
+ -[:210]% 2
+ (
+ <[:150]% 4
+ -[:90.4,2.094]% 115
+ -[:18]% 109
+ -[:330]% 110
+ -[:30,,,,dlh]% 111
+ -[:90]% 112
+ -[:150,,,,dlh]% 107
+ -[:210]% 108
+ (
+ -[:162]\mcfabove{N}{H}% 113
+ -[:234]% 114
+ -[:306,,,,dbl={73}{73}]% -> 115
+ )
+ -[:270,,,,dlh]% -> 109
+ )
+ -[:270,,,2]HN% 1
+ -[:330,,2]% 93
+ (
+ -[:270]% 95
+ -[:210]% 96
+ -[:270]% 97
+ -[:330]% 98
+ -[:30]% 99
+ -[:330]% 100
+ -[:270]% 101
+ -[:210]% 102
+ -[:270]% 103
+ )
+ =[:30]O% 94
+ )
+ -[:330]\mcfbelow{N}{H}% 6
+ -[:30]% 7
+ (
+ <:[:90]% 9
+ -[:30]% 10
+ (
+ -[:330,,,1]NH_2% 12
+ )
+ =[:90]O% 11
+ )
+ -[:330]% 8
+ (
+ =[:270]O% 15
+ )
+ -[:30]\mcfabove{N}{H}% 13
+ -[:330]% 14
+ (
+ <:[:270]% 16
+ -[:330]% 19
+ (
+ =[:270]O% 21
+ )
+ -[:30,,,1]OH% 20
+ )
+ -[:30]% 17
+ (
+ =[:90]O% 22
+ )
+ -[:330]\mcfbelow{N}{H}% 18
+ -[:30]% 23
+ <:[:90]% 24
+ (
+ =[:150]O% 26
+ )
+ -[:30,,,1]NH% 25
+ -[:90,,1]% 27
+ -[:30]% 28
+ (
+ =[:90]O% 29
+ )
+ -[:330]\mcfbelow{N}{H}% 30
+ -[:30]% 31
+ (
+ -[:90]% 33
+ -[:30]% 34
+ -[:90]% 35
+ -[:30,,,1]NH_2% 36
+ )
+ -[:330]% 32
+ (
+ =[:270]O% 37
+ )
+ -[:30]\mcfabove{N}{H}% 38
+ -[:330]% 39
+ (
+ <:[:270]% 43
+ -[:330]% 44
+ (
+ -[:30,,,1]OH% 46
+ )
+ =[:270]O% 45
+ )
+ -[:30]% 40
+ (
+ =[:90]O% 42
+ )
+ -[:330]\mcfbelow{N}{H}% 41
+ -[:30]% 47
+ (
+ <:[:90]% 49
+ )
+ -[:330]% 48
+ (
+ =[:30]O% 51
+ )
+ -[:270,,,2]HN% 50
+ -[:330,,2]% 52
+ (
+ <[:30]% 54
+ -[:330]% 55
+ (
+ -[:270,,,1]OH% 57
+ )
+ =[:30]O% 56
+ )
+ -[:270]% 53
+ (
+ =[:330]O% 58
+ )
+ -[:210,,,2]HN% 59
+ -[:270,,2]% 60
+ -[:210]% 61
+ (
+ =[:270]O% 62
+ )
+ -[:150]\mcfabove{N}{H}% 63
+ -[:210]% 64
+ (
+ <:[:270]% 104
+ -[:330,,,1]OH% 105
+ )
+ -[:180,1.732]% 91
+ (
+ -[:150,,,,dlhs]O% 92
+ )
+ -[:270,,,1]NH% 90
+ -[:210,,1]% 82
+ (
+ <[:270]% 84
+ (
+ -[:330]% 86
+ -[:270]% 87
+ (
+ -[:210,,,2]HO% 89
+ )
+ =[:330]O% 88
+ )
+ -[:210]% 85
+ )
+ -[:150]% 81
+ (
+ =[:90]O% 83
+ )
+ -[:210]\mcfbelow{N}{H}% 71
+ -[:150]% 69
+ (
+ -[:90]% 68
+ (
+ =[:30]O% 70
+ )
+ -[:150]O% 67
+ -[:90]% 65
+ (
+ <[:30]% 66
+ )
+ -[:150]% -> 23
+ )
+ <[:210]% 72
+ -[:270]% 73
+ (
+ =[:330]O% 75
+ )
+ -[:210]% 74
+ -[:270,,,,drh]% 80
+ (
+ -[:330,,,1]NH_2% 106
+ )
+ -[:210]% 79
+ -[:150,,,,drh]% 78
+ -[:90]% 77
+ -[:30,,,,drh]% 76
+ (
+ -[:330]% -> 74
+ )
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/daptomycin1.sh b/graphics/mol2chemfig/doc/doc-source/examples/daptomycin1.sh
new file mode 100755
index 0000000000..12314a3aec
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/daptomycin1.sh
@@ -0,0 +1 @@
+mol2chemfig -wf daptomycin.mol > daptomycin.tex \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/dcf-submol1.tex b/graphics/mol2chemfig/doc/doc-source/examples/dcf-submol1.tex
new file mode 100644
index 0000000000..3787320606
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/dcf-submol1.tex
@@ -0,0 +1,51 @@
+\definesubmol{dcf1}{
+ O% 15
+ =[:210]% 14
+ -[:270]% 13
+ (
+ -[:330]% 18
+ )
+ =_[:210]% 12
+ -[:150]% 9
+ =_[:210]% 8
+ (
+ -[:270,1.755]% 16
+ =^[:210]% 20
+ -[:270]% 21
+ =^[:330]% 22
+ -[:30]% 23
+ =^[:90]% 24
+ (
+ -[:30]% 25
+ (
+ -[:330]\mcfright{O}{^{\mcfminus}}% 27
+ )
+ =[:90]O% 26
+ )
+ -[:150]% -> 16
+ )
+ -[:150]% 5
+ -[:210]% 4
+ =_[:150]% 3
+ (
+ -[:210]% 17
+ )
+ -[:90]% 2
+ (
+ -[:150,,,2]^{\mcfminus}O% 19
+ )
+ =_[:30]% 1
+ -[:330]% 6
+ (
+ =_[:270]% -> 5
+ )
+ -[:30]O% 7
+ -[:330]% 10
+ (
+ -[:270]% -> 9
+ )
+ =_[:30]% 11
+ (
+ -[:330]% -> 14
+ )
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/dcf-submol2.tex b/graphics/mol2chemfig/doc/doc-source/examples/dcf-submol2.tex
new file mode 100644
index 0000000000..e7a95777fe
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/dcf-submol2.tex
@@ -0,0 +1,51 @@
+\definesubmol{dcf2}{
+ \mcfright{O}{\mcfatomno{15}}% 15
+ =[:210]\mcfatomno{14}% 14
+ -[:270]\mcfatomno{13}% 13
+ (
+ -[:330]\mcfatomno{18}% 18
+ )
+ =_[:210]\mcfatomno{12}% 12
+ -[:150]\mcfatomno{9}% 9
+ =_[:210]\mcfatomno{8}% 8
+ (
+ -[:270,1.755]\mcfatomno{16}% 16
+ =^[:210]\mcfatomno{20}% 20
+ -[:270]\mcfatomno{21}% 21
+ =^[:330]\mcfatomno{22}% 22
+ -[:30]\mcfatomno{23}% 23
+ =^[:90]\mcfatomno{24}% 24
+ (
+ -[:30]\mcfatomno{25}% 25
+ (
+ -[:330]\mcfright{O}{\mcfatomno{27}}% 27
+ )
+ =[:90]\mcfright{O}{\mcfatomno{26}}% 26
+ )
+ -[:150]\phantom{16}% -> 16
+ )
+ -[:150]\mcfatomno{5}% 5
+ -[:210]\mcfatomno{4}% 4
+ =_[:150]\mcfatomno{3}% 3
+ (
+ -[:210]\mcfatomno{17}% 17
+ )
+ -[:90]\mcfatomno{2}% 2
+ (
+ -[:150]\mcfleft{\mcfatomno{19}}{O}% 19
+ )
+ =_[:30]\mcfatomno{1}% 1
+ -[:330]\mcfatomno{6}% 6
+ (
+ =_[:270]\phantom{5}% -> 5
+ )
+ -[:30]\mcfabove{O}{\mcfatomno{7}}% 7
+ -[:330]\mcfatomno{10}% 10
+ (
+ -[:270]\phantom{9}% -> 9
+ )
+ =_[:30]\mcfatomno{11}% 11
+ (
+ -[:330]\phantom{14}% -> 14
+ )
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/dcf-submol3.tex b/graphics/mol2chemfig/doc/doc-source/examples/dcf-submol3.tex
new file mode 100644
index 0000000000..33413d9eb5
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/dcf-submol3.tex
@@ -0,0 +1,53 @@
+\definesubmol{dcf3}{
+ % 22
+ =_[:150]% 21
+ -[:90]% 20
+ =_[:30]% 16
+ (
+ -[:330]% 24
+ (
+ -[:30]% 25
+ (
+ -[:330]\mcfright{O}{^{\mcfminus}}% 27
+ )
+ =[:90]O% 26
+ )
+ =_[:270]% 23
+ -[:210]% -> 22
+ )
+ -[:90,1.755]% 8
+ -[:150]% 5
+ -[:210]% 4
+ =_[:150]% 3
+ (
+ -[:210]% 17
+ )
+ -[:90]% 2
+ (
+ -[:150,,,2]^{\mcfminus}O% 19
+ )
+ =_[:30]% 1
+ -[:330]% 6
+ (
+ =_[:270]% -> 5
+ )
+ -[:30]O% 7
+ -[:330]% 10
+ =_[:30]% 11
+ -[:330]% 14
+ (
+ =[:30]O% 15
+ )
+ -[:270]% 13
+ (
+ -[:330]% 18
+ )
+ =_[:210]% 12
+ -[:150]% 9
+ (
+ =_[:210]% -> 8
+ )
+ (
+ -[:90]% -> 10
+ )
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein.mol b/graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein.mol
new file mode 100644
index 0000000000..620c1683c8
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein.mol
@@ -0,0 +1,63 @@
+
+ Marvin 05191217082D
+
+ 27 30 0 0 0 0 999 V2000
+ -2.8481 3.3463 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -3.5626 2.9338 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -3.5626 2.1088 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.8481 1.6963 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.1337 2.1088 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.1337 2.9338 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.4192 3.3463 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.4192 1.6963 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.7047 2.1088 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.7047 2.9338 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.0097 3.3463 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.0097 1.6963 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.7242 2.1088 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.7242 2.9338 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1.4387 3.3463 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.4192 0.2487 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -4.2771 1.6963 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1.4387 1.6963 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -4.2771 3.3463 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0
+ -2.1337 -0.1638 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.1337 -0.9888 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.4192 -1.4013 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.7047 -0.9888 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.7047 -0.1638 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.0098 0.2487 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.0098 1.0737 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.7242 -0.1638 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0
+ 1 2 2 0 0 0 0
+ 2 3 1 0 0 0 0
+ 3 4 2 0 0 0 0
+ 4 5 1 0 0 0 0
+ 1 6 1 0 0 0 0
+ 7 6 1 0 0 0 0
+ 6 5 2 0 0 0 0
+ 5 8 1 0 0 0 0
+ 8 9 2 0 0 0 0
+ 7 10 1 0 0 0 0
+ 11 10 2 0 0 0 0
+ 10 9 1 0 0 0 0
+ 9 12 1 0 0 0 0
+ 12 13 2 0 0 0 0
+ 13 14 1 0 0 0 0
+ 11 14 1 0 0 0 0
+ 14 15 2 0 0 0 0
+ 8 16 1 0 0 0 0
+ 3 17 1 0 0 0 0
+ 13 18 1 0 0 0 0
+ 2 19 1 0 0 0 0
+ 16 20 2 0 0 0 0
+ 16 24 1 0 0 0 0
+ 20 21 1 0 0 0 0
+ 21 22 2 0 0 0 0
+ 22 23 1 0 0 0 0
+ 23 24 2 0 0 0 0
+ 24 25 1 0 0 0 0
+ 25 26 2 0 0 0 0
+ 25 27 1 0 0 0 0
+M CHG 2 19 -1 27 -1
+M END
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein1.sh b/graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein1.sh
new file mode 100755
index 0000000000..51d2b28545
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein1.sh
@@ -0,0 +1,2 @@
+mol2chemfig -l dcf1 dichlorofluorescein.mol > dcf-submol1.tex
+mol2chemfig -l ce1 crown-ether.mol > ce-submol1.tex
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein2.sh b/graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein2.sh
new file mode 100755
index 0000000000..ef10d00ea3
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein2.sh
@@ -0,0 +1,3 @@
+# numbered versions
+mol2chemfig -n -l dcf2 dichlorofluorescein.mol > dcf-submol2.tex
+mol2chemfig -n -l ce2 crown-ether.mol > ce-submol2.tex
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein3.sh b/graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein3.sh
new file mode 100755
index 0000000000..2d7c788b20
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/dichlorofluorescein3.sh
@@ -0,0 +1,3 @@
+# correctly ordered versions
+mol2chemfig -e 22 -l dcf3 dichlorofluorescein.mol > dcf-submol3.tex
+mol2chemfig -e 12 -x 32 -l ce3 crown-ether.mol > ce-submol3.tex
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/doxo-from-sdf.sh b/graphics/mol2chemfig/doc/doc-source/examples/doxo-from-sdf.sh
new file mode 100755
index 0000000000..b948344b9a
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/doxo-from-sdf.sh
@@ -0,0 +1 @@
+mol2chemfig -w doxorubicin.sdf > doxo-raw.tex \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/doxo-raw.tex b/graphics/mol2chemfig/doc/doc-source/examples/doxo-raw.tex
new file mode 100644
index 0000000000..1af8856904
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/doxo-raw.tex
@@ -0,0 +1,145 @@
+\chemfig{
+ O% 7
+ =[:300.2,1.613]% 25
+ (
+ -[:240.2,1.613]% 30
+ (
+ -[:260.2]H% 57
+ )
+ (
+ -[:340.2]H% 58
+ )
+ -[:180.2,1.613]O% 8
+ -[:240.2]H% 63
+ )
+ -[:0.2,1.613]% 14
+ (
+ <:[:240.2,1.613]O% 3
+ -[:300.2]H% 51
+ )
+ -[:90,1.68]% 15
+ (
+ -[:109.7]H% 41
+ )
+ (
+ -[:189.9]H% 42
+ )
+ -[:29.6,1.68]% 13
+ (
+ <:[:89.3,1.613]O% 1
+ >:[:149.3,1.613]% 19
+ (
+ -[:29.3]H% 45
+ )
+ -[:209.3,1.613]O% 2
+ -[:149.3,1.613]% 23
+ (
+ <[:209.3,1.613]% 29
+ (
+ -[:209.3]H% 53
+ )
+ (
+ -[:299.3]H% 54
+ )
+ -[:119.3]H% 52
+ )
+ (
+ -[:269.3]H% 50
+ )
+ -[:89.3,1.613]% 22
+ (
+ -[:29.3,1.613]% 21
+ (
+ -[:329.3,1.613]% 20
+ (
+ -[:349.3]H% 46
+ )
+ (
+ -[:69.3]H% 47
+ )
+ -[:269.3,1.613]% -> 19
+ )
+ (
+ -[:149.3]H% 48
+ )
+ <[:89.3,1.613]N% 12
+ (
+ -[:149.3]H% 56
+ )
+ -[:29.3]H% 55
+ )
+ (
+ -[:209.3]H% 49
+ )
+ <[:149.3,1.613]O% 4
+ -[:209.3]H% 59
+ )
+ (
+ -[:149.5]H% 40
+ )
+ -[:329.1,1.68]% 17
+ -[:270,1.613]% 18
+ (
+ -[:210.9,1.68]% 16
+ (
+ -[:230.6]H% 43
+ )
+ (
+ -[:310.7]H% 44
+ )
+ -[:150.4,1.68]% -> 14
+ )
+ =^[:330,1.613]% 26
+ (
+ -[:270,1.613]O% 6
+ -[:210]H% 61
+ )
+ -[:30,1.613]% 28
+ =^[:90,1.613]% 27
+ (
+ -[:150,1.613]% 24
+ (
+ =^[:210,1.613]% -> 17
+ )
+ -[:90,1.613]O% 5
+ -[:30]H% 60
+ )
+ -[:30.9,1.68]% 31
+ (
+ =[:90.7,1.613]O% 9
+ )
+ -[:330.4,1.68]% 33
+ =^[:270,1.68]% 34
+ (
+ -[:209.6,1.68]% 32
+ (
+ -[:149.1,1.68]% -> 28
+ )
+ =[:269.3,1.613]O% 10
+ )
+ -[:329.1,1.75]% 36
+ (
+ -[:269.3]H% 62
+ )
+ =^[:29.6,1.75]% 38
+ (
+ -[:329.8]H% 65
+ )
+ -[:90,1.75]% 37
+ (
+ -[:30.2]H% 64
+ )
+ =^[:150.4,1.75]% 35
+ (
+ -[:210.9,1.75]% -> 33
+ )
+ -[:90.7,1.613]O% 11
+ -[:30.7,1.613]% 39
+ (
+ -[:300.7]H% 66
+ )
+ (
+ -[:30.7]H% 67
+ )
+ -[:120.7]H% 68
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/doxo-strip-h.sh b/graphics/mol2chemfig/doc/doc-source/examples/doxo-strip-h.sh
new file mode 100755
index 0000000000..411ecf8d89
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/doxo-strip-h.sh
@@ -0,0 +1 @@
+mol2chemfig -w -y delete doxorubicin.sdf > doxo-stripped.tex \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/doxo-stripped.tex b/graphics/mol2chemfig/doc/doc-source/examples/doxo-stripped.tex
new file mode 100644
index 0000000000..c177de0873
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/doxo-stripped.tex
@@ -0,0 +1,74 @@
+\chemfig{
+ HO% 3
+ >:[:60.2,,2]% 14
+ (
+ -[:180.2]% 25
+ (
+ -[:240.2]% 30
+ -[:180.2,,,2]HO% 8
+ )
+ =[:120.2]O% 7
+ )
+ -[:90,1.042]% 15
+ -[:29.6,1.042]% 13
+ (
+ <:[:89.3]O% 1
+ >:[:149.3]% 19
+ -[:209.3]O% 2
+ -[:149.3]% 23
+ (
+ <[:209.3]% 29
+ )
+ -[:89.3]% 22
+ (
+ -[:29.3]% 21
+ (
+ -[:329.3]% 20
+ -[:269.3]% -> 19
+ )
+ <[:89.3,,,1]NH_2% 12
+ )
+ <[:149.3,,,2]HO% 4
+ )
+ -[:329.1,1.042]% 17
+ -[:270]% 18
+ (
+ -[:210.9,1.042]% 16
+ -[:150.4,1.042]% -> 14
+ )
+ =^[:330]% 26
+ (
+ -[:270,,,1]OH% 6
+ )
+ -[:30]% 28
+ =^[:90]% 27
+ (
+ -[:150]% 24
+ (
+ =^[:210]% -> 17
+ )
+ -[:90,,,1]OH% 5
+ )
+ -[:30.9,1.042]% 31
+ (
+ =[:90.7]O% 9
+ )
+ -[:330.4,1.042]% 33
+ =^[:270,1.042]% 34
+ (
+ -[:209.6,1.042]% 32
+ (
+ -[:149.1,1.042]% -> 28
+ )
+ =[:269.3]O% 10
+ )
+ -[:329.1,1.085]% 36
+ =^[:29.6,1.085]% 38
+ -[:90,1.085]% 37
+ =^[:150.4,1.085]% 35
+ (
+ -[:210.9,1.085]% -> 33
+ )
+ -[:90.7]O% 11
+ -[:30.7]% 39
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/fmnh.mol b/graphics/mol2chemfig/doc/doc-source/examples/fmnh.mol
new file mode 100644
index 0000000000..048bc84d05
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/fmnh.mol
@@ -0,0 +1,71 @@
+
+ Marvin 09131216222D
+
+ 31 33 0 0 0 0 999 V2000
+ -0.8545 -2.2393 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.5689 -2.6518 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.5689 -3.4768 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.8545 -3.8893 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.1400 -3.4768 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.1400 -2.6518 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.5745 -2.2393 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.5745 -3.8893 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 1.2889 -3.4768 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1.2889 -2.6518 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.0034 -2.2393 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.0034 -3.8893 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.7179 -3.4768 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.7179 -2.6518 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.5745 -1.4143 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.1620 -0.6998 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.5745 0.0147 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.1620 0.7291 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.5745 1.4436 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.6630 -0.6998 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 1.3995 0.0147 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.6630 0.7291 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 1.3995 1.4436 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.2245 1.4436 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.0495 1.4436 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.2245 0.6186 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0
+ 2.2245 2.2686 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0
+ -2.2834 -2.2393 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.2834 -3.8893 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 2.0034 -4.7143 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 3.4323 -2.2393 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 1 2 1 0 0 0 0
+ 1 6 2 0 0 0 0
+ 2 3 2 0 0 0 0
+ 3 4 1 0 0 0 0
+ 4 5 2 0 0 0 0
+ 7 6 1 0 0 0 0
+ 6 5 1 0 0 0 0
+ 5 8 1 0 0 0 0
+ 7 10 1 0 0 0 0
+ 8 9 1 0 0 0 0
+ 11 10 2 0 0 0 0
+ 10 9 1 0 0 0 0
+ 9 12 1 0 0 0 0
+ 11 14 1 0 0 0 0
+ 12 13 1 0 0 0 0
+ 13 14 1 0 0 0 0
+ 7 15 1 0 0 0 0
+ 15 16 1 0 0 0 0
+ 16 17 1 0 0 0 0
+ 17 18 1 0 0 0 0
+ 18 19 1 0 0 0 0
+ 16 20 1 0 0 0 0
+ 17 21 1 0 0 0 0
+ 18 22 1 0 0 0 0
+ 19 23 1 0 0 0 0
+ 23 24 1 0 0 0 0
+ 24 25 2 0 0 0 0
+ 24 26 1 0 0 0 0
+ 24 27 1 0 0 0 0
+ 2 28 1 0 0 0 0
+ 3 29 1 0 0 0 0
+ 12 30 2 0 0 0 0
+ 14 31 2 0 0 0 0
+M CHG 2 26 -1 27 -1
+M RAD 1 9 2
+M END
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/aspirin.tex b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/aspirin.tex
new file mode 100644
index 0000000000..576c9d8a43
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/aspirin.tex
@@ -0,0 +1,8 @@
+\definesubmol{acetyl}{(=[::60]O)-[::-60]H_3C}
+\definesubmol{benzoate}{*6(-=-=-(-(=[::60]O)-[::-60]OH)=)}%
+
+\chemfig{
+ {\color{red}O} % the oxygen in the middle
+ (-[:210]!{acetyl}) % treat one submol as a branch,
+ -[:-30]!{benzoate} % the other one as the main chain
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/caffeine.tex b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/caffeine.tex
new file mode 100644
index 0000000000..8b49661938
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/caffeine.tex
@@ -0,0 +1 @@
+\chemfig{H_3C-[:30]N**6(-(=O)-(**5(-N(-CH_3)--N-))--N(-CH_3)-(=O)-)}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/chemfig-settings.tex b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/chemfig-settings.tex
new file mode 100644
index 0000000000..cffe37c1df
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/chemfig-settings.tex
@@ -0,0 +1,10 @@
+% reduce font size and use sans-serif
+\renewcommand{\printatom}[1]{%
+\fontsize{8pt}{10pt}\selectfont{\ensuremath{\mathsf{#1}}}}
+
+% reduce bond dimensions to match smaller fonts
+\setcrambond{2.5pt}{0.4pt}{1.0pt}
+\setbondoffset{1pt}
+\setdoublesep{2pt}
+\setatomsep{16pt}
+
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green.png b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green.png
new file mode 100644
index 0000000000..0d8b8c9275
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green.png
Binary files differ
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green1.tex b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green1.tex
new file mode 100644
index 0000000000..84da34dd2c
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green1.tex
@@ -0,0 +1,9 @@
+\input{dcf-submol1} % load generated submolecules ...
+\input{ce-submol1}
+
+\chemfig{ % and stitch them together
+ {\color{red}C}
+ (=[:45]O)
+ (-[:180,6]!{dcf1})
+ -[:-90]!{ce1}
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green2.tex b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green2.tex
new file mode 100644
index 0000000000..7cea9f0df7
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green2.tex
@@ -0,0 +1,14 @@
+\input{dcf-submol2}
+\input{ce-submol2}
+\begin{center}
+\begin{tikzpicture}
+\node at(0,0){\chemfig{!{dcf2}}};
+\node at(3.0in,0){\chemfig{!{ce2}}};
+\end{tikzpicture}
+\end{center}
+%\chemfig{
+% {\color{red}C}
+% (=[:45]O)
+% (-[:180,6]!{dcf2})
+% -[:-90]!{ce2}
+%}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green3.tex b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green3.tex
new file mode 100644
index 0000000000..501995ab65
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/hand-coded-tex/sodium-green3.tex
@@ -0,0 +1,12 @@
+\input{dcf-submol3}
+\input{ce-submol3}
+
+\chemfig{
+ {\color{red}C}
+ (=[:225]O)
+ (-[:90]!{dcf3})
+ -!{ce3}
+ -{\color{blue}C}
+ (=[:-45]O)
+ -[:90]!{dcf3}
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/morphine-f.sh b/graphics/mol2chemfig/doc/doc-source/examples/morphine-f.sh
new file mode 100755
index 0000000000..bd4b560de5
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/morphine-f.sh
@@ -0,0 +1 @@
+mol2chemfig -f -w morphine.mol > morphine-f.tex
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/morphine-f.tex b/graphics/mol2chemfig/doc/doc-source/examples/morphine-f.tex
new file mode 100644
index 0000000000..3557709128
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/morphine-f.tex
@@ -0,0 +1,40 @@
+\chemfig{
+ HO% 16
+ -[:60,,2]% 13
+ -[:120,,,,drh]% 12
+ -[:60]% 11
+ -[,,,,drh]% 8
+ -[:60]% 7
+ -% 10
+ -[:300]% 1
+ -% 6
+ -[:300,,,,drh]% 5
+ -[:240]% 4
+ (
+ -[:300,,,1]OH% 17
+ )
+ -[:180]% 3
+ -[:120]% 2
+ (
+ -[:60]% -> 1
+ )
+ (
+ -[:180]% 9
+ (
+ -[:120]% -> 8
+ )
+ -[:240,,,,drh]% 14
+ (
+ -[:327.1,1.233]O% 15
+ -[:34.8,1.174]% -> 3
+ )
+ -[:180]% -> 13
+ )
+ -[:123.3,0.928]% 19
+ -[:89.9,1.239]% 20
+ -[:30.1,1.163]N% 18
+ (
+ -[:240]% -> 10
+ )
+ -[:37.5]% 21
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/morphine-k.sh b/graphics/mol2chemfig/doc/doc-source/examples/morphine-k.sh
new file mode 100755
index 0000000000..a280f43747
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/morphine-k.sh
@@ -0,0 +1 @@
+mol2chemfig -k 19-20 -wf morphine.mol > morphine-k.tex
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/morphine-k.tex b/graphics/mol2chemfig/doc/doc-source/examples/morphine-k.tex
new file mode 100644
index 0000000000..bb75634e18
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/morphine-k.tex
@@ -0,0 +1,44 @@
+\chemfig{
+ HO% 16
+ -[:60,,2]% 13
+ -[:120,,,,drh]% 12
+ -[:60]% 11
+ -[,,,,drh]% 8
+ -[:60]% 7
+ -% 10
+ -[:300]% 1
+ -% 6
+ -[:300,,,,drh]% 5
+ -[:240]% 4
+ (
+ -[:300,,,1]OH% 17
+ )
+ -[:180]% 3
+ -[:120]% 2
+ (
+ -[:60]% -> 1
+ )
+ (
+ -[:180]% 9
+ (
+ -[:120]% -> 8
+ )
+ -[:240,,,,drh]% 14
+ (
+ -[:327.1,1.233]O% 15
+ -[:34.8,1.174]% -> 3
+ )
+ -[:180]% -> 13
+ )
+ -[:123.3,0.928]% 19
+ -[:89.9,1.239,,,draw=none]% 20
+ -[:30.1,1.163]N% 18
+ (
+ -[:240]% -> 10
+ )
+ -[:37.5]% 21
+ (
+ -[:233.4,3.026,,,draw=none]% -> 19
+ -[:89.9,1.239,,,mcfx={10}{10}]% -> 20
+ )
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/morphine-n.sh b/graphics/mol2chemfig/doc/doc-source/examples/morphine-n.sh
new file mode 100755
index 0000000000..d2c76db071
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/morphine-n.sh
@@ -0,0 +1 @@
+mol2chemfig -n -w morphine.mol > morphine-n.tex
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/morphine-n.tex b/graphics/mol2chemfig/doc/doc-source/examples/morphine-n.tex
new file mode 100644
index 0000000000..3ad8cc6d48
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/morphine-n.tex
@@ -0,0 +1,40 @@
+\chemfig{
+ \mcfleft{\mcfatomno{16}}{O}% 16
+ -[:60]\mcfatomno{13}% 13
+ =_[:120]\mcfatomno{12}% 12
+ -[:60]\mcfatomno{11}% 11
+ =_\mcfatomno{8}% 8
+ -[:60]\mcfatomno{7}% 7
+ -\mcfatomno{10}% 10
+ -[:300]\mcfatomno{1}% 1
+ -\mcfatomno{6}% 6
+ =_[:300]\mcfatomno{5}% 5
+ -[:240]\mcfatomno{4}% 4
+ (
+ -[:300]\mcfright{O}{\mcfatomno{17}}% 17
+ )
+ -[:180]\mcfatomno{3}% 3
+ -[:120]\mcfatomno{2}% 2
+ (
+ -[:60]\phantom{1}% -> 1
+ )
+ (
+ -[:180]\mcfatomno{9}% 9
+ (
+ -[:120]\phantom{8}% -> 8
+ )
+ =_[:240]\mcfatomno{14}% 14
+ (
+ -[:327.1,1.233]\mcfbelow{O}{\mcfatomno{15}}% 15
+ -[:34.8,1.174]\phantom{3}% -> 3
+ )
+ -[:180]\phantom{13}% -> 13
+ )
+ -[:123.3,0.928]\mcfatomno{19}% 19
+ -[:89.9,1.239]\mcfatomno{20}% 20
+ -[:30.1,1.163]\mcfabove{N}{\mcfatomno{18}}% 18
+ (
+ -[:240]\phantom{10}% -> 10
+ )
+ -[:37.5]\mcfatomno{21}% 21
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/morphine.mol b/graphics/mol2chemfig/doc/doc-source/examples/morphine.mol
new file mode 100644
index 0000000000..4d17710747
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/morphine.mol
@@ -0,0 +1,51 @@
+5288826
+ Marvin 05021316212D
+
+ 21 25 0 0 1 0 999 V2000
+ 11.4469 1.8931 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 11.0344 1.1786 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 11.4469 0.4641 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.2719 0.4641 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.6844 1.1786 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.2719 1.8930 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.2094 2.6076 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 9.7969 1.8931 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.2094 1.1786 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 11.0344 2.6075 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 8.9719 1.8930 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 8.5594 1.1786 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 8.9719 0.4641 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 9.7969 0.4641 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.6513 -0.0886 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 8.5594 -0.2504 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.6844 -0.2504 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ 11.4469 3.3220 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.6145 1.8189 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 10.6166 2.8411 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 12.1014 3.8242 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 2 3 1 0 0 0 0
+ 3 4 1 0 0 0 0
+ 4 5 1 0 0 0 0
+ 5 6 2 0 0 0 0
+ 1 6 1 0 0 0 0
+ 1 10 1 0 0 0 0
+ 2 1 1 0 0 0 0
+ 9 2 1 0 0 0 0
+ 7 8 1 0 0 0 0
+ 7 10 1 0 0 0 0
+ 14 9 2 0 0 0 0
+ 8 9 1 0 0 0 0
+ 8 11 2 0 0 0 0
+ 11 12 1 0 0 0 0
+ 12 13 2 0 0 0 0
+ 13 14 1 0 0 0 0
+ 14 15 1 0 0 0 0
+ 3 15 1 0 0 0 0
+ 13 16 1 0 0 0 0
+ 4 17 1 0 0 0 0
+ 10 18 1 0 0 0 0
+ 2 19 1 0 0 0 0
+ 18 20 1 0 0 0 0
+ 20 19 1 0 0 0 0
+ 18 21 1 0 0 0 0
+M END
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/morphine.sh b/graphics/mol2chemfig/doc/doc-source/examples/morphine.sh
new file mode 100755
index 0000000000..e0b0319867
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/morphine.sh
@@ -0,0 +1 @@
+mol2chemfig -w morphine.mol > morphine.tex
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/morphine.tex b/graphics/mol2chemfig/doc/doc-source/examples/morphine.tex
new file mode 100644
index 0000000000..ba80f885ba
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/morphine.tex
@@ -0,0 +1,40 @@
+\chemfig{
+ HO% 16
+ -[:60,,2]% 13
+ =_[:120]% 12
+ -[:60]% 11
+ =_% 8
+ -[:60]% 7
+ -% 10
+ -[:300]% 1
+ -% 6
+ =_[:300]% 5
+ -[:240]% 4
+ (
+ -[:300,,,1]OH% 17
+ )
+ -[:180]% 3
+ -[:120]% 2
+ (
+ -[:60]% -> 1
+ )
+ (
+ -[:180]% 9
+ (
+ -[:120]% -> 8
+ )
+ =_[:240]% 14
+ (
+ -[:327.1,1.233]O% 15
+ -[:34.8,1.174]% -> 3
+ )
+ -[:180]% -> 13
+ )
+ -[:123.3,0.928]% 19
+ -[:89.9,1.239]% 20
+ -[:30.1,1.163]N% 18
+ (
+ -[:240]% -> 10
+ )
+ -[:37.5]% 21
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/mp.mol b/graphics/mol2chemfig/doc/doc-source/examples/mp.mol
new file mode 100644
index 0000000000..5dcb270ade
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/mp.mol
@@ -0,0 +1,42 @@
+
+ Marvin 10271217122D
+
+ 17 20 0 0 0 0 999 V2000
+ -1.2670 -1.7089 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.9814 -2.1214 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.9814 -2.9464 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.2670 -3.3589 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.5525 -2.9464 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.5525 -2.1214 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.5525 -0.4714 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.2670 -0.8839 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.1620 -1.7089 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 0.1620 -0.8839 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.9814 -0.4714 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.6959 -0.8839 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.6959 -1.7089 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.2670 0.7661 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.9814 0.3536 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.5525 0.3536 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.2670 1.5911 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 2 3 2 0 0 0 0
+ 3 4 1 0 0 0 0
+ 4 5 2 0 0 0 0
+ 5 6 1 0 0 0 0
+ 6 9 1 0 0 0 0
+ 1 6 2 0 0 0 0
+ 7 10 1 0 0 0 0
+ 9 10 2 0 0 0 0
+ 8 1 1 0 0 0 0
+ 1 2 1 0 0 0 0
+ 13 2 1 0 0 0 0
+ 11 12 1 0 0 0 0
+ 12 13 2 0 0 0 0
+ 15 11 1 0 0 0 0
+ 11 8 2 0 0 0 0
+ 8 7 1 0 0 0 0
+ 7 16 2 0 0 0 0
+ 14 15 2 0 0 0 0
+ 14 16 1 0 0 0 0
+ 14 17 1 0 0 0 0
+M END
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/mp.sh b/graphics/mol2chemfig/doc/doc-source/examples/mp.sh
new file mode 100755
index 0000000000..4e9ab919ec
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/mp.sh
@@ -0,0 +1 @@
+mol2chemfig -f -l mp -g mp -a 270 mp.mol > mp.tex
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/mp.tex b/graphics/mol2chemfig/doc/doc-source/examples/mp.tex
new file mode 100644
index 0000000000..9b94d693ef
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/mp.tex
@@ -0,0 +1,31 @@
+\definesubmol{mp}{
+ @{mp17}%
+ -[@{mp14-17}:180]@{mp14}%
+ -[@{mp14-15}:120,,,,dlh]@{mp15}%
+ -[@{mp11-15}:180]@{mp11}%
+ -[@{mp11-12}:120]@{mp12}%
+ -[@{mp12-13}:180,,,,dlh]@{mp13}%
+ -[@{mp2-13}:240]@{mp2}%
+ -[@{mp2-3}:180,,,,dlh]@{mp3}%
+ -[@{mp3-4}:240]@{mp4}%
+ -[@{mp4-5}:300,,,,dlh]@{mp5}%
+ -[@{mp5-6}]@{mp6}%
+ -[@{mp6-9}:300]@{mp9}%
+ -[@{mp9-10},,,,dlh]@{mp10}%
+ -[@{mp7-10}:60]@{mp7}%
+ (
+ -[@{mp7-16},,,,dlh]@{mp16}%
+ -[@{mp14-16}:60]% -> 14
+ )
+ -[@{mp7-8}:120]@{mp8}%
+ (
+ -[@{mp8-11}:60,,,,dlh]% -> 11
+ )
+ -[@{mp1-8}:180]@{mp1}%
+ (
+ -[@{mp1-6}:240,,,,dlh]% -> 6
+ )
+ (
+ -[@{mp1-2}:120]% -> 2
+ )
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/optionlist.tex b/graphics/mol2chemfig/doc/doc-source/examples/optionlist.tex
new file mode 100644
index 0000000000..44a957117e
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/optionlist.tex
@@ -0,0 +1,115 @@
+mol2chemfig v. 1.4, by Eric Brefo-Mensah and Michael Palmer
+mol2chemfig generates chemfig code from molfiles. Usage example:
+
+mol2chemfig --angle=45 --aromatic-circles somefile.mol
+
+Options:
+-h, --help Print help message and exit (Default:
+ False)
+
+-b, --version Print program version and exit (Default:
+ False)
+
+-i, --input How to interpret the argument. With 'file',
+ mol2chemfig expects a filename. With
+ 'direct', the argument is intrepreted
+ directly; don't forget to put quotes around
+ it. With 'pubchem', the argument is treated
+ as an identifier for the PubChem database.
+ (Default: file)
+
+-z, --terse Remove all whitespace and comments from the
+ output. If you can still read it
+ afterwards, Bill Gates wants your resume
+ (Default: False)
+
+-r, --strict Abide by Indigo's chemical structure
+ validation. If true, mol2chemfig will fail
+ if Indigo reports that something is wrong
+ with the molecule, like a carbon with five
+ bonds. If false, mol2chemfig will ignore
+ such errors (Default: True)
+
+-d, --indent Number of spaces to use for indenting
+ molecule branches in generated code.
+ Without effect when 'terse' option is
+ passed. Affects only the generated tex
+ code, not the rendered molecule (Default:
+ 4)
+
+-u, --recalculate-coordinates Discard existing coordinate and calculate
+ new ones from covalent structure. For
+ smiles input, this is performed implicitly
+ (Default: False)
+
+-a, --angle Rotate molecule counterclockwise by this
+ angle (Default: 0.0)
+
+-v, --relative-angles Use relative bond angles (Default: False)
+
+-p, --flip Flip the structure horizontally (Default:
+ False)
+
+-q, --flop Flip the structure vertically (Default:
+ False)
+
+-c, --show-carbons Show element symbol for carbon atoms
+ (Default: False)
+
+-m, --show-methyls Show element symbols for methyl groups
+ (implied if show-carbons is True) (Default:
+ False)
+
+-y, --hydrogens How to deal with explicit hydrogen atoms.
+ One of 'keep', 'add' or 'delete'. Note that
+ 'add' will also trigger calculation of new
+ coordinates for the entire molecule. Option
+ 'keep' does nothing (Default: keep)
+
+-o, --aromatic-circles Draw circles instead of double bonds inside
+ aromatic rings (Default: False)
+
+-f, --fancy-bonds Draw fancier double and triple bonds
+ (Default: False)
+
+-g, --markers Give each atom and each bond a unique
+ marker that can be used for attaching
+ electron movement arrows. With value 'a',
+ atom 2 will be labeled @{a2}, and its bond
+ to atom 5 @{a2-5}. (Default: None)
+
+-n, --atom-numbers Show the molfile number of each atom next
+ to it. When this option is set, charges and
+ implicit hydrogens will not be shown
+ (Default: False)
+
+-s, --bond-scale How to scale the lengths of bonds (one of
+ 'keep', 'scale', or 'normalize') (Default:
+ normalize)
+
+-t, --bond-stretch Used as scaling factor (with --bond-
+ scale=scale) or average (with --bond-
+ scale=normalize) for bond lengths (Default:
+ 1.0)
+
+-w, --wrap-chemfig Wrap generated code into \chemfig{...}
+ command (Default: False)
+
+-l, --submol-name If a name is given, wrap generated code
+ into chemfig \definesubmol{name}{...}
+ command (Default: None)
+
+-e, --entry-atom Number of first atom to be rendered.
+ Relevant only if generated code is to be
+ used as sub-molecule (Default: None)
+
+-x, --exit-atom Number of last atom to be rendered.
+ Relevant only if generated code is to be
+ used as sub-molecule (Default: None)
+
+-k, --cross-bond Specify bonds that should be drawn on top
+ of others they cross over. Give the start
+ and the end atoms. Example for one bond:
+ --cross-bond=5-6 Example for two bonds:
+ --crossbond=4-8,12-13 (Default: None)
+
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/phenol-add-h.sh b/graphics/mol2chemfig/doc/doc-source/examples/phenol-add-h.sh
new file mode 100755
index 0000000000..5701daf90e
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/phenol-add-h.sh
@@ -0,0 +1 @@
+mol2chemfig -y add -w -i direct 'C1=CC=C(C=C1)O' > phenol-with-hydrogens.tex \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/phenol-as-submol.sh b/graphics/mol2chemfig/doc/doc-source/examples/phenol-as-submol.sh
new file mode 100755
index 0000000000..59f11e2cf2
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/phenol-as-submol.sh
@@ -0,0 +1 @@
+mol2chemfig -l phenol -i direct 'C1=CC=C(C=C1)O' > phenol-as-submol.tex \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/phenol-as-submol.tex b/graphics/mol2chemfig/doc/doc-source/examples/phenol-as-submol.tex
new file mode 100644
index 0000000000..b51ef95581
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/phenol-as-submol.tex
@@ -0,0 +1,12 @@
+\definesubmol{phenol}{
+ HO% 7
+ -[,,2]% 4
+ =^[:300]% 3
+ -% 2
+ =^[:60]% 1
+ -[:120]% 6
+ =^[:180]% 5
+ (
+ -[:240]% -> 4
+ )
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/phenol-from-smiles-w.sh b/graphics/mol2chemfig/doc/doc-source/examples/phenol-from-smiles-w.sh
new file mode 100755
index 0000000000..6f25cbdde4
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/phenol-from-smiles-w.sh
@@ -0,0 +1 @@
+mol2chemfig -w -i direct 'C1=CC=C(C=C1)O' > phenol-smi-wrapped.tex \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/phenol-from-smiles-wz.sh b/graphics/mol2chemfig/doc/doc-source/examples/phenol-from-smiles-wz.sh
new file mode 100755
index 0000000000..97c218a62f
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/phenol-from-smiles-wz.sh
@@ -0,0 +1 @@
+mol2chemfig -zw -i direct 'C1=CC=C(C=C1)O' > phenol-smi-terse.tex \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/phenol-from-smiles.sh b/graphics/mol2chemfig/doc/doc-source/examples/phenol-from-smiles.sh
new file mode 100755
index 0000000000..5e1df1db25
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/phenol-from-smiles.sh
@@ -0,0 +1 @@
+mol2chemfig -i direct 'C1=CC=C(C=C1)O' > phenol-smi.tex \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/phenol-smi-terse.tex b/graphics/mol2chemfig/doc/doc-source/examples/phenol-smi-terse.tex
new file mode 100644
index 0000000000..3793a018c5
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/phenol-smi-terse.tex
@@ -0,0 +1 @@
+\chemfig{HO-[,,2]=^[:300]-=^[:60]-[:120]=^[:180](-[:240])}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/phenol-smi-wrapped.tex b/graphics/mol2chemfig/doc/doc-source/examples/phenol-smi-wrapped.tex
new file mode 100644
index 0000000000..c6f70ef10e
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/phenol-smi-wrapped.tex
@@ -0,0 +1,12 @@
+\chemfig{
+ HO% 7
+ -[,,2]% 4
+ =^[:300]% 3
+ -% 2
+ =^[:60]% 1
+ -[:120]% 6
+ =^[:180]% 5
+ (
+ -[:240]% -> 4
+ )
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/phenol-smi.tex b/graphics/mol2chemfig/doc/doc-source/examples/phenol-smi.tex
new file mode 100644
index 0000000000..0bc164867d
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/phenol-smi.tex
@@ -0,0 +1,10 @@
+ HO% 7
+ -[,,2]% 4
+ =^[:300]% 3
+ -% 2
+ =^[:60]% 1
+ -[:120]% 6
+ =^[:180]% 5
+ (
+ -[:240]% -> 4
+ )
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/phenol-with-hydrogens.tex b/graphics/mol2chemfig/doc/doc-source/examples/phenol-with-hydrogens.tex
new file mode 100644
index 0000000000..c831a20d4b
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/phenol-with-hydrogens.tex
@@ -0,0 +1,26 @@
+\chemfig{
+ H% 8
+ -[:180]% 1
+ =_[:240]% 2
+ (
+ -[:300]H% 9
+ )
+ -[:180]% 3
+ (
+ -[:240]H% 10
+ )
+ =_[:120]% 4
+ (
+ -[:180]O% 7
+ -[:120]H% 13
+ )
+ -[:60]% 5
+ (
+ -[:120]H% 11
+ )
+ =_% 6
+ (
+ -[:300]% -> 1
+ )
+ -[:60]H% 12
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/plp.mol b/graphics/mol2chemfig/doc/doc-source/examples/plp.mol
new file mode 100644
index 0000000000..09f686e869
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/plp.mol
@@ -0,0 +1,48 @@
+
+ Marvin 09131213202D
+
+ 21 21 0 0 0 0 999 V2000
+ -3.2411 0.2063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -3.9555 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -3.9555 -1.0313 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -3.2411 -1.4438 0.0000 N 0 3 0 0 0 0 0 0 0 0 0 0
+ -2.5266 -1.0313 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.5266 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.8121 -1.4438 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.8121 0.2063 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0
+ -4.6700 0.2063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -5.3845 -0.2062 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ -6.2095 -0.2062 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0
+ -7.0345 -0.2062 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ -6.2095 -1.0312 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0
+ -6.2095 0.6188 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0
+ -3.2411 1.0313 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.5266 1.4438 0.0000 N 0 3 0 0 0 0 0 0 0 0 0 0
+ -2.5266 2.2688 0.0000 C 0 5 0 0 0 0 0 0 0 0 0 0
+ -1.8121 2.6813 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -3.2411 2.6813 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.8121 3.5063 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.0977 2.2688 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0
+ 1 2 1 0 0 0 0
+ 1 6 2 0 0 0 0
+ 2 3 2 0 0 0 0
+ 3 4 1 0 0 0 0
+ 4 5 2 0 0 0 0
+ 5 6 1 0 0 0 0
+ 5 7 1 0 0 0 0
+ 6 8 1 0 0 0 0
+ 2 9 1 0 0 0 0
+ 9 10 1 0 0 0 0
+ 10 11 1 0 0 0 0
+ 11 12 2 0 0 0 0
+ 11 13 1 0 0 0 0
+ 11 14 1 0 0 0 0
+ 1 15 1 0 0 0 0
+ 15 16 2 0 0 0 0
+ 16 17 1 0 0 0 0
+ 17 18 1 0 0 0 0
+ 17 19 1 0 0 0 0
+ 18 20 2 0 0 0 0
+ 18 21 1 0 0 0 0
+M CHG 7 4 1 8 -1 13 -1 14 -1 16 1 17 -1 21 -1
+M END
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/plp.sh b/graphics/mol2chemfig/doc/doc-source/examples/plp.sh
new file mode 100755
index 0000000000..a351f09bc3
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/plp.sh
@@ -0,0 +1,2 @@
+mol2chemfig -f --submol-name plp plp.mol > plp.tex
+mol2chemfig -f --submol-name plp2 plp2.mol > plp2.tex \ No newline at end of file
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/plp.tex b/graphics/mol2chemfig/doc/doc-source/examples/plp.tex
new file mode 100644
index 0000000000..6dd82a1146
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/plp.tex
@@ -0,0 +1,38 @@
+\definesubmol{plp}{
+ % 7
+ -[:150]% 5
+ -[:210,,,,drhs]\mcfbelowright{N}{H}{^{\mcfplus}}% 4
+ -[:150]% 3
+ -[:90,,,,drh]% 2
+ (
+ -[:150]% 9
+ -[:210]O% 10
+ -[:180]P% 11
+ (
+ -[:270]\mcfright{O}{^{\mcfminus}}% 13
+ )
+ (
+ -[:90]\mcfright{O}{^{\mcfminus}}% 14
+ )
+ =[:180]O% 12
+ )
+ -[:30]% 1
+ (
+ -[:330,,,,drh]% 6
+ (
+ -[:30]\mcfright{O}{^{\mcfminus}}% 8
+ )
+ -[:270]% -> 5
+ )
+ -[:90]% 15
+ -[:30,,,1,dlhs]NH^{\mcfplus}% 16
+ -[:90,,1]\mcfabove{C}{_{\mcfminus}}% 17
+ (
+ -[:150]% 19
+ )
+ -[:30]% 18
+ (
+ =[:90]O% 20
+ )
+ -[:330]\mcfright{O}{^{\mcfminus}}% 21
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/plp2.mol b/graphics/mol2chemfig/doc/doc-source/examples/plp2.mol
new file mode 100644
index 0000000000..8d1459f4fd
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/plp2.mol
@@ -0,0 +1,48 @@
+
+ Marvin 09131213192D
+
+ 21 21 0 0 0 0 999 V2000
+ -3.2411 0.2063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -3.9555 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -3.9555 -1.0313 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -3.2411 -1.4438 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.5266 -1.0313 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.5266 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.8121 -1.4438 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.8121 0.2063 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0
+ -4.6700 0.2063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -5.3845 -0.2062 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ -6.2095 -0.2062 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0
+ -7.0345 -0.2062 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ -6.2095 -1.0312 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0
+ -6.2095 0.6188 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0
+ -3.2411 1.0313 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -2.5266 1.4438 0.0000 N 0 3 0 0 0 0 0 0 0 0 0 0
+ -2.5266 2.2688 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.8121 2.6813 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -3.2411 2.6813 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.8121 3.5063 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.0977 2.2688 0.0000 O 0 5 0 0 0 0 0 0 0 0 0 0
+ 1 2 1 0 0 0 0
+ 1 6 1 0 0 0 0
+ 2 3 2 0 0 0 0
+ 3 4 1 0 0 0 0
+ 4 5 1 0 0 0 0
+ 5 6 2 0 0 0 0
+ 5 7 1 0 0 0 0
+ 6 8 1 0 0 0 0
+ 2 9 1 0 0 0 0
+ 9 10 1 0 0 0 0
+ 10 11 1 0 0 0 0
+ 11 12 2 0 0 0 0
+ 11 13 1 0 0 0 0
+ 11 14 1 0 0 0 0
+ 1 15 2 0 0 0 0
+ 15 16 1 0 0 0 0
+ 16 17 2 0 0 0 0
+ 17 18 1 0 0 0 0
+ 17 19 1 0 0 0 0
+ 18 20 2 0 0 0 0
+ 18 21 1 0 0 0 0
+M CHG 5 8 -1 13 -1 14 -1 16 1 21 -1
+M END
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/plp2.tex b/graphics/mol2chemfig/doc/doc-source/examples/plp2.tex
new file mode 100644
index 0000000000..c0d352a655
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/plp2.tex
@@ -0,0 +1,38 @@
+\definesubmol{plp2}{
+ % 7
+ -[:150]% 5
+ -[:210]\mcfbelow{N}{H}% 4
+ -[:150]% 3
+ -[:90,,,,drh]% 2
+ (
+ -[:150]% 9
+ -[:210]O% 10
+ -[:180]P% 11
+ (
+ -[:270]\mcfright{O}{^{\mcfminus}}% 13
+ )
+ (
+ -[:90]\mcfright{O}{^{\mcfminus}}% 14
+ )
+ =[:180]O% 12
+ )
+ -[:30]% 1
+ (
+ -[:330]% 6
+ (
+ -[:30]\mcfright{O}{^{\mcfminus}}% 8
+ )
+ -[:270,,,,drh]% -> 5
+ )
+ -[:90,,,,drh]% 15
+ -[:30,,,1]NH^{\mcfplus}% 16
+ =[:90,,1]% 17
+ (
+ -[:150]% 19
+ )
+ -[:30]% 18
+ (
+ =[:90]O% 20
+ )
+ -[:330]\mcfright{O}{^{\mcfminus}}% 21
+}
diff --git a/graphics/mol2chemfig/doc/doc-source/examples/twisted.mol b/graphics/mol2chemfig/doc/doc-source/examples/twisted.mol
new file mode 100644
index 0000000000..0dca2407ae
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/examples/twisted.mol
@@ -0,0 +1,13 @@
+
+ Marvin 01131309442D
+
+ 4 4 0 0 0 0 999 V2000
+ -1.6058 0.4862 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.7808 0.4862 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -0.7808 -0.3388 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ -1.6058 -0.3388 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
+ 1 2 1 0 0 0 0
+ 3 4 1 0 0 0 0
+ 3 1 1 0 0 0 0
+ 2 4 1 0 0 0 0
+M END
diff --git a/graphics/mol2chemfig/doc/doc-source/mol2chemfig-doc.tex b/graphics/mol2chemfig/doc/doc-source/mol2chemfig-doc.tex
new file mode 100644
index 0000000000..fe6b0c971d
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/mol2chemfig-doc.tex
@@ -0,0 +1,33 @@
+\documentclass[letterpaper,11pt]{article}
+
+\input{preamble}
+
+\title{\mcf Documentation}
+\author{Version 1.4}
+
+\begin{document}
+
+\maketitle
+
+\input{chapters/abstract}
+
+\tableofcontents
+
+%\clearpage
+
+\input{chapters/introduction}
+\input{chapters/installation}
+\input{chapters/context}
+\input{chapters/help}
+\input{chapters/tutorial}
+\input{chapters/input-modes}
+\input{chapters/output}
+\input{chapters/hydrogens}
+\input{chapters/bond-lengths}
+\input{chapters/polishing}
+\input{chapters/recalculating}
+\input{chapters/submolecules}
+\input{chapters/composite}
+\input{chapters/conclusion}
+
+\end{document}
diff --git a/graphics/mol2chemfig/doc/doc-source/mol2chemfig.sty b/graphics/mol2chemfig/doc/doc-source/mol2chemfig.sty
new file mode 100644
index 0000000000..2de1613f91
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/mol2chemfig.sty
@@ -0,0 +1,236 @@
+% auxiliary package for mol2chemfig
+\ProvidesPackage{mol2chemfig}[2014/03/24 v1.4]
+
+\RequirePackage{xcolor, chemfig, twoopt, ifmtarg}
+\usetikzlibrary{decorations}
+
+% \setbondstyle is defined by chemfig. Here, we wrap it
+% in order to also save the bond style in a tikz key.
+\let\mcf@setbondstyle\setbondstyle
+\renewcommand{\setbondstyle}[1]{%
+ \mcf@setbondstyle{#1}%
+ \tikzset{mcfbond/.style={#1}}%
+}
+
+% this macro (by Christian Tellechea) draws circles in aromatic rings.
+\def\mcfcringle#1{%
+\tikz\draw[mcfbond](0,0)circle(\CF@atom@sep*#1*0.66667*\CF@cycle@inraduiscoeff);}
+
+% auxiliary macros for rendering double and triple bonds
+
+% tikz decoration to render parallel bond strokes
+\pgfdeclaredecoration{mcfsecondstroke}{initial}{
+ \state{initial}[width=\pgfdecoratedpathlength-1sp]{
+ \pgfmoveto{\pgfpointorigin}
+ }
+ \state{final}{
+ \pgflineto{\pgfpointorigin}
+ }
+}
+
+% the complete sines definition is taken from http://tex.stackexchange.com/questions/25678/
+\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}{}
+}
+
+% color definitions
+\colorlet{mcfbgcolor}{white} % adjust when drawing on a non-white canvas
+\colorlet{mcfpusharrowcolor}{black}
+\colorlet{mcfatomnocolor}{blue}
+
+\tikzset{ % set styles
+ % wavy bonds. Slightly modified from http://www.texdev.net/tag/chemfig/
+ mcfwavy/.style =
+ {
+ decorate,
+ decoration =
+ {
+ complete sines,
+ post length = 0 pt,
+ pre length = 0 pt,
+ % Use chemfig's atom spacing
+ segment length = \the\dimexpr\csname CF@atom@sep\endcsname/6\relax,
+ amplitude = \the\dimexpr\csname CF@atom@sep\endcsname/10\relax
+ }
+ },
+ % this style is used by the \mcfelmove macro
+ mcfpusharrow/.style = {
+ ->,
+ mcfpusharrowcolor,
+ >=stealth,
+ shorten <=3pt,
+ shorten >=2pt,
+ preaction={draw=mcfbgcolor, -,line width=1.5pt}
+ },
+ %
+ mcfbond/.style = {}, % the chemfig default bond style is empty, too.
+ %
+ % one bond crossing before another - gets a white backdrop
+ % as wide as doublesep
+ mcfbgcolor/.style={white},
+ %
+ mcfx/.style 2 args={%
+ preaction={
+ draw,
+ mcfbgcolor,
+ line width=\CF@double@sep,
+ shorten <= {#1*\CF@double@sep/100},
+ shorten >= {#2*\CF@double@sep/100}
+ },
+ mcfbond
+ },
+ %
+ mcfcrossbond/.style={% for backwards compatibility only
+ mcfx={100}{100}
+ },
+ %
+ secondbond/.style 2 args={
+ shorten <= {#1*\CF@double@sep/100},
+ shorten >= {#2*\CF@double@sep/100},
+ mcfbond
+ },
+ %
+ secondfgbond/.style 2 args={
+ preaction={draw,-,mcfbgcolor,line width=\CF@double@sep},
+ secondbond={#1}{#2}
+ },
+ %
+ secondleft/.style 2 args={
+ secondbond={#1}{#2},
+ decoration={mcfsecondstroke,raise=\CF@double@sep},
+ decorate
+ },
+ %
+ secondright/.style 2 args={
+ secondbond={#1}{#2},
+ decoration={mcfsecondstroke,raise=-\CF@double@sep},
+ decorate
+ },
+ %
+ secondfgleft/.style 2 args={
+ secondfgbond={#1}{#2},
+ decoration={mcfsecondstroke,raise=\CF@double@sep},
+ decorate
+ },
+ %
+ secondfgright/.style 2 args={
+ secondfgbond={#1}{#2},
+ decoration={mcfsecondstroke,raise=-\CF@double@sep},
+ decorate
+ },
+ %
+ dbl/.style 2 args={
+ preaction={draw,secondleft={#1}{#2}}
+ },
+ %
+ dbr/.style 2 args={
+ preaction={draw,secondright={#1}{#2}}
+ },
+ %
+ trpl/.style 2 args={
+ preaction={draw,secondleft={#1}{#2}},
+ preaction={draw,secondright={#1}{#2}}
+ },
+ %
+ dblx/.style n args={4}{
+ preaction={draw,secondfgleft={#1}{#2}},
+ mcfx={#3}{#4}
+ },
+ %
+ dbrx/.style n args={4}{
+ preaction={draw,secondfgright={#1}{#2}},
+ mcfx={#3}{#4}
+ },
+ %
+ trplx/.style n args={4}{
+ preaction={draw,secondfgleft={#1}{#2}},
+ preaction={draw,secondfgright={#1}{#2}},
+ mcfx={#3}{#4}
+ },
+ %
+ drh/.style={dbr={58}{58}},
+ dlh/.style={dbl={58}{58}},
+ drhs/.style={dbr={58}{0}},
+ dlhs/.style={dbl={58}{0}},
+ drhe/.style={dbr={0}{58}},
+ dlhe/.style={dbl={0}{58}},
+ drn/.style={dbr={0}{0}},
+ dln/.style={dbl={0}{0}}
+}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Conveniences for drawing push arrows
+% the \mcfelmove command is adapted from the
+% myChemistry package by Clemens Niederberger
+
+\newcommand{\mcfelmove}[5][]{%
+\node at (0,0) {% dummy wrapper node
+\chemmove{\draw[mcfpusharrow,#1](#2).. controls +(#3) and +(#5)..(#4);%
+}};}
+
+% and, since the most common use for tikz code
+% is arrow shortening and lengthening: a command streamlined for that.
+
+\newcommandtwoopt{\mcfpush}[6][][]{% we use empties to keep same defaults
+\@ifmtarg{#2}{
+ \@ifmtarg{#1}{\mcfelmove{#3}{#4}{#5}{#6}}
+ {\mcfelmove[shorten <=#1]{#3}{#4}{#5}{#6}}
+}{% #2 not empty
+ \@ifmtarg{#1}{\mcfelmove[shorten >=#2]{#3}{#4}{#5}{#6}}
+ {\mcfelmove[shorten <=#1, shorten >=#2]{#3}{#4}{#5}{#6}}
+}}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Stacking atoms horizontally and vertically
+\newlength{\mcfvspace}
+\setlength{\mcfvspace}{1.5pt}
+
+\newcommand{\mcfabove}[2]{\chemabove[\mcfvspace]{#1}{#2}}
+\newcommand{\mcfbelow}[2]{\chembelow[\mcfvspace]{#1}{#2}}
+
+\newlength{\mcf@boxwidth}
+\newlength{\mcf@boxheight}
+
+\newcommand{\mcf@box}[3][l]{
+\settowidth{\mcf@boxwidth}{\printatom{#2}}
+\settoheight{\mcf@boxheight}{\printatom{#2}}
+\makebox[\mcf@boxwidth][#1]{\raisebox{0pt}[\mcf@boxheight][0pt]{\printatom{#3}}}}
+
+\newcommand{\mcfleft}[2]{\mcf@box[r]{#2}{#1#2}}
+\newcommand{\mcfright}[2]{\mcf@box{#1}{#1#2}}
+
+\newcommand{\mcfaboveright}[3]{\mcfabove{#1}{\mcf@box{#2}{#2#3}}}
+\newcommand{\mcfbelowright}[3]{\mcfbelow{#1}{\mcf@box{#2}{#2#3}}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Formatting of charges and atom numbers
+
+% Charges - could for example be defined as \oplus and \ominus
+\newcommand{\mcfplus}{+}
+\newcommand{\mcfminus}{-}
+
+% atom numbers (used when option atom-numbers is selected)
+\newcommand{\mcfatomno}[1]%
+{\raisebox{2pt}{\color{mcfatomnocolor}{\ensuremath{\mathsf{_{#1}}}}}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% a little help with direct processing of mol2chemfig commands
+\newcommand{\mcfinput}[1]{\@@input|"mol2chemfig #1"}
+
+
diff --git a/graphics/mol2chemfig/doc/doc-source/preamble.tex b/graphics/mol2chemfig/doc/doc-source/preamble.tex
new file mode 100644
index 0000000000..a4a0fee312
--- /dev/null
+++ b/graphics/mol2chemfig/doc/doc-source/preamble.tex
@@ -0,0 +1,60 @@
+\usepackage{
+ graphicx,
+ listings,
+ paralist,
+ textcomp,
+ xspace
+}
+
+% use postscript fonts
+\usepackage{courier,times}
+\usepackage[scaled=0.92]{helvet}
+\usepackage{sansmath}
+
+\usepackage[x11names]{xcolor}
+\usepackage[margin=1.0in]{geometry}
+
+% load mol2chemfig custom macros
+\usepackage{mol2chemfig}
+
+% set default input path
+\makeatletter
+\def\input@path{{examples/}}
+\makeatother
+
+% import live settings
+\input{hand-coded-tex/chemfig-settings}
+
+\newlength{\fspc}
+\setlength{\fspc}{5pt}
+
+% customize code listings
+\lstset{backgroundcolor=\color{LightSteelBlue1},
+ basicstyle=\ttfamily\small,
+ xleftmargin=\fspc,
+ framexleftmargin=\fspc,
+ framextopmargin=\fspc,
+ frame=single,
+ framerule=0pt,
+ linewidth=\linewidth,
+ breaklines=true,
+ breakatwhitespace=true,
+ showstringspaces=false,
+}
+
+\newcommand{\mcf}{\texttt{mol2chemfig}\xspace}
+\newcommand{\chf}{\texttt{chemfig}\xspace}
+\newcommand{\mf}{\texttt{molfile}\xspace}
+\newcommand{\smiles}{\texttt{SMILES}\xspace}
+\newcommand{\tkz}{\texttt{TiKZ}\xspace}
+\newcommand{\rdkit}{\texttt{rdkit}\xspace}
+\newcommand{\mcfplain}{\texttt{mol2chemfig.tex}\xspace}
+
+\setlength{\parskip}{0.25\baselineskip}
+\setlength{\parindent}{0pt}
+
+% structures need a little space
+\newcommand{\cfpic}[1]{\bigskip \par \input{#1} \par \bigskip}
+
+% use hyperlinks
+\usepackage[colorlinks,linkcolor=Blue3,urlcolor=Blue3]{hyperref}
diff --git a/graphics/mol2chemfig/doc/mol2chemfig-doc.pdf b/graphics/mol2chemfig/doc/mol2chemfig-doc.pdf
new file mode 100644
index 0000000000..f11c215602
--- /dev/null
+++ b/graphics/mol2chemfig/doc/mol2chemfig-doc.pdf
Binary files differ