Guest User

Untitled

a guest
Sep 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. \documentclass{article}
  2.  
  3. % -- Add this section to your LaTeX doc
  4. % Remember to use "pdflatex -shell-escape myfile.tex"
  5. % or it won't allow LaTeX to call any command-line
  6. % programs!
  7. \usepackage{graphicx}
  8. \newcounter{smilescounter}
  9. \setcounter{smilescounter}{1}
  10. \newcommand{\smiles}[1]{
  11. \immediate\write18{obabel -:"#1" -O smilesimg\arabic{smilescounter}.png}
  12. \includegraphics{smilesimg\arabic{smilescounter}.png}
  13. \addtocounter{smilescounter}{1}
  14. }
  15. % -- End of section
  16.  
  17. \title{This is an example of use}
  18. \author{Noel O'Boyle}
  19. \date{26 March 2012}
  20. \begin{document}
  21. \maketitle
  22. The following images were created using the smiles command.
  23.  
  24. \begin{figure}[h!]
  25. \smiles{CCO}
  26. \caption{Ethanol.}
  27. \centering
  28. \end{figure}
  29.  
  30. \begin{figure}[h!]
  31. \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}
  32. \caption{Not ethanol.}
  33. \centering
  34. \end{figure}
  35. \end{document}
Add Comment
Please, Sign In to add comment