Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{article}
- % -- Add this section to your LaTeX doc
- % Remember to use "pdflatex -shell-escape myfile.tex"
- % or it won't allow LaTeX to call any command-line
- % programs!
- \usepackage{graphicx}
- \newcounter{smilescounter}
- \setcounter{smilescounter}{1}
- \newcommand{\smiles}[1]{
- \immediate\write18{obabel -:"#1" -O smilesimg\arabic{smilescounter}.png}
- \includegraphics{smilesimg\arabic{smilescounter}.png}
- \addtocounter{smilescounter}{1}
- }
- % -- End of section
- \title{This is an example of use}
- \author{Noel O'Boyle}
- \date{26 March 2012}
- \begin{document}
- \maketitle
- The following images were created using the smiles command.
- \begin{figure}[h!]
- \smiles{CCO}
- \caption{Ethanol.}
- \centering
- \end{figure}
- \begin{figure}[h!]
- \smiles{[C@H]2(OC1O[C@@H]([C@@H](O)[C@H](O)[C@H]1O)CO)[C@H](O)[C@@H](O)C(O[C@@H]2CO)O[C@H]3[C@H](O)[C@@H](O)[C@H](O[C@@H]3CO)O}
- \caption{Not ethanol.}
- \centering
- \end{figure}
- \end{document}
Add Comment
Please, Sign In to add comment