summaryrefslogtreecommitdiff
path: root/graphics/mol2chemfig/doc/doc-source/chapters/input-modes.tex
blob: 75e60f79cd64657256e5817a6ebc4d096c73d926 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
\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.