texlive[64444] Master: chemobabel (19sep22)

commits+karl at tug.org commits+karl at tug.org
Mon Sep 19 22:27:58 CEST 2022


Revision: 64444
          http://tug.org/svn/texlive?view=revision&revision=64444
Author:   karl
Date:     2022-09-19 22:27:58 +0200 (Mon, 19 Sep 2022)
Log Message:
-----------
chemobabel (19sep22)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/chemobabel/
    trunk/Master/texmf-dist/doc/latex/chemobabel/LICENSE
    trunk/Master/texmf-dist/doc/latex/chemobabel/README.md
    trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.pdf
    trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.tex
    trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.pdf
    trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.tex
    trunk/Master/texmf-dist/doc/latex/chemobabel/example-en.pdf
    trunk/Master/texmf-dist/doc/latex/chemobabel/example-en.tex
    trunk/Master/texmf-dist/doc/latex/chemobabel/example-ja.pdf
    trunk/Master/texmf-dist/doc/latex/chemobabel/example-ja.tex
    trunk/Master/texmf-dist/doc/latex/chemobabel/images-for-doc.tar.gz
    trunk/Master/texmf-dist/source/latex/chemobabel/
    trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.dtx
    trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.ins
    trunk/Master/texmf-dist/tex/latex/chemobabel/
    trunk/Master/texmf-dist/tex/latex/chemobabel/chemobabel.sty
    trunk/Master/tlpkg/tlpsrc/chemobabel.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/chemobabel/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/LICENSE	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/LICENSE	2022-09-19 20:27:58 UTC (rev 64444)
@@ -0,0 +1,25 @@
+(The BSD 2-Clause License)
+
+Copyright (c) 2014-2022 Hironobu Yamashita
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Added: trunk/Master/texmf-dist/doc/latex/chemobabel/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/README.md	2022-09-19 20:27:58 UTC (rev 64444)
@@ -0,0 +1,50 @@
+chemobabel
+==========
+
+LaTeX package for generating chemical structural formula from
+ChemDraw files or SMILES notations using Open Babel.
+
+This package offers a new choice for chemists who need
+chemical structures in LaTeX documents.
+With this package you can insert chemical structural formulas
+into your PDF files easily with the help of Open Babel and Inkscape.
+
+Various chemical formats are allowed for input,
+for example, `.cdx`, `.mol` and `.smi`.
+
+## Package Contents
+
+ - chemobabel.sty: Package itself
+ - chemobabel-{en,ja}.pdf: Basic usage (source: chemobabel.dtx)
+ - example-en.{tex,pdf}: Examples in English
+ - example-ja.{tex,pdf}: Examples in Japanese
+
+Sample ChemDraw files and MDL Molfiles are also included.
+
+## License
+
+This package is distributed under the BSD 2-Clause License.
+See [LICENSE](./LICENSE).
+
+## Repository
+
+The bundle is maintained on GitHub:
+  https://github.com/aminophen/chemobabel
+
+## References
+
+See http://acetaminophen.hatenablog.com/entry/2014/12/08/053519
+for detail. (Sorry in Japanese)
+
+This work is based on a lot of resources published online:
+  - Noel O'Boyle http://baoilleach.blogspot.jp/
+  - Jakob Lykke Andersen http://imada.sdu.dk/~jlandersen/
+  - TeX Forum http://oku.edu.mie-u.ac.jp/tex/
+
+## Release Date
+
+2022-09-19
+
+--------------------
+Hironobu YAMASHITA (aka. "Acetaminophen" or "@aminophen")
+http://acetaminophen.hatenablog.com/


Property changes on: trunk/Master/texmf-dist/doc/latex/chemobabel/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.pdf	2022-09-19 20:26:49 UTC (rev 64443)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.pdf	2022-09-19 20:27:58 UTC (rev 64444)

Property changes on: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.tex	2022-09-19 20:27:58 UTC (rev 64444)
@@ -0,0 +1,761 @@
+%%
+%% This is file `chemobabel-en.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% chemobabel.dtx  (with options: `en')
+%% 
+%% IMPORTANT NOTICE:
+%% 
+%% For the copyright see the source file.
+%% 
+%% Any modified versions of this file must be renamed
+%% with new filenames distinct from chemobabel-en.tex.
+%% 
+%% For distribution of the original source see the terms
+%% for copying and modification in the file chemobabel.dtx.
+%% 
+%% This generated file may be distributed as long as the
+%% original source files, as listed above, are part of the
+%% same distribution. (The sources need not necessarily be
+%% in the same archive or directory.)
+%%
+%% This document describes the usage of `chemobabel.sty',
+%% a LaTeX package for generating chemical structural formulas
+%% using Open Babel and Inkscape.
+%%
+%% Copyright 2014-2022 Acetaminophen (Hironobu YAMASHITA)
+%%   Email   :  h.y.acetaminophen[a t]gmail.com
+%%   GitHub  :  https://github.com/aminophen
+%%   Blog    :  http://acetaminophen.hatenablog.com/
+%%   Twitter :  @aminophen
+%%
+\documentclass[12pt]{ltjsarticle}
+\usepackage[margin=20mm]{geometry}
+\usepackage[english]{babel}
+\usepackage[nofontspec,defaultsups]{newpxtext}
+\usepackage[zerostyle=c,straightquotes]{newtxtt}
+\usepackage{newpxmath}
+\usepackage[librsvg]{chemobabel}
+\usepackage[bookmarksnumbered=true,hidelinks,%
+ pdftitle={User Manual for chemobabel.sty},%
+ pdfauthor={Hironobu Yamashita (Acetaminophen)},%
+ pdfsubject={TeX \& LaTeX Advent Calendar 2014},%
+ pdfkeywords={chemistry,open babel,chemdraw,smiles}]{hyperref}
+\usepackage{footnotebackref}
+\makeatletter
+\long\def\@makecaption#1#2{%
+\vskip\abovecaptionskip
+\sbox\@tempboxa{#1: #2}
+\global\@minipagefalse
+\hbox to\hsize{\hfil\box\@tempboxa\hfil}
+\vskip\belowcaptionskip}
+\makeatother
+\newcount\TestCount
+\def\XyM{\ifnum\fam=-1\relax\fam=0\relax\fi\TestCount=\fam%
+X\kern-.30em\smash{\raise.50ex\hbox{$\fam\TestCount\Upsilon$}}%
+\kern-.30em{M}}
+\def\XyMTeX{\XyM\kern-.1em\TeX}
+\title{\textsf{chemobabel} \\[1ex]
+  \normalsize --- Chemical Structures from MDL Molfiles,
+  ChemDraw Files or SMILES Notations --- \\
+  }
+\author{Hironobu Yamashita (@aminophen)}
+\begin{document}
+\renewcommand{\figurename}{Fig.\,}
+\pagenumbering{roman}
+\maketitle
+
+This document (\jobname.pdf) describes the usage of \textsf{chemobabel.sty},
+a \LaTeX\ package for \textbf{generating chemical structural formulas}
+to be inserted in your documents.
+The formulas can be generated \textbf{from many kinds of chemical data
+formats}, including MDL Molfiles, ChemDraw files and even from
+SMILES notations, with the help of Open Babel and Inkscape.
+The formulas below are generated using this method.
+
+日本語版ドキュメントはchemobabel-ja.pdfを参照してください。
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[width=65mm]{draw/Firefly luciferin.mol}{} \quad
+  \chemobabel[width=90mm]{draw/Brevetoxin A.mol}{}
+  \caption{Firefly luciferin \& Brevetoxin A (from MDL Molfiles)}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[width=90mm]{draw/ATP.cdx}{} \hspace{1cm}
+  \chemobabel[width=35mm]{draw/Glucose.cdx}{}
+  \caption{ATP (Adenosine triphosphate) \& Glucose (from ChemDraw files)}
+\end{figure}
+\begin{center}\small
+Note: with Open Babel 3.1.1 the chemical structure of ATP from the .cdx file
+becomes wrong.\\ See \url{https://github.com/openbabel/openbabel/issues/338}
+\end{center}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=36mm]{CCO}{} \hspace{1cm}
+  \smilesobabel[width=40mm]{CC(C(=O)O)N}{} \hspace{1cm}
+  \smilesobabel[width=30mm]{C1[C at H](C)C[C@@H](O)C1}{}
+  \caption{Ethanol, Alanine \& (1\textit{S},3\textit{S})-3-Methylcyclopentanol (from SMILES notations)}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=30mm]{CC(=O)Nc1ccc(cc1)O}{} \hspace{1cm}
+  \smilesobabel[width=40mm]{C([C@@H]1[C at H]([C@@H]([C at H]([C at H](O1)O)O)O)O)O}{}
+  \caption{Acetaminophen (Paracetamol) \& $\alpha$-\textsc{d}-Glucose (from SMILES notations)}
+\end{figure}
+
+\begin{figure}[ht]
+\centering
+This package is maintained on GitHub:\par
+\url{https://github.com/aminophen/chemobabel}\par
+If you have questions, please let me know.
+\end{figure}
+
+\clearpage
+\setcounter{tocdepth}{3}
+\tableofcontents
+
+\clearpage
+\pagenumbering{arabic}
+
+\section{Introduction}
+
+\subsection{Motivation for Development}
+
+As you already know, \LaTeX\ is being used all over the world.
+However, when it comes to drawing chemical strucutral formulas,
+ways of inserting formulas into \LaTeX\ documents are very limited.
+I think it is mainly due to lack of both reliable and simple methods
+of doing this that many of the researchers in chemistry are reluctant
+to use \LaTeX\ system.
+
+Some \TeX/\LaTeX\ macros and packages are already available from
+\href{http://www.ctan.org/}{CTAN}:
+\begin{itemize}
+  \item \href{http://www.ctan.org/pkg/xymtex}{\XyMTeX}:
+    a set of packages for drawing chemical structural formulas
+\item \href{http://www.ctan.org/pkg/chemfig}{\textsf{chemfig}}:
+    a package which draws molecules using Ti\textit{k}Z
+\end{itemize}
+These packages are reliable and almost all kinds of structural formulas
+can be drawn in a consistent way. However, a lot of practice will be
+required before one can come to make full use of them.
+
+You can also insert structural formulas with \verb|\includegraphics| of
+PDF or EPS files exported from special softwares for chemists, such as
+\href{http://www.cambridgesoft.com/Ensemble_for_Chemistry/ChemDraw/}{ChemDraw}
+and other similar programs.
+In this case, you have to save files in both chemical formats
+(such as \verb|.cdx| or \verb|.mol|) and graphical formats
+(\verb|.pdf| or \verb|.eps|) manually.
+
+This new package, \textsf{chemobabel.sty}, will offer a new choice for
+chemists who need chemical structures inserted in their \LaTeX\ documents.
+In this method, we use \href{http://openbabel.org/}{Open Babel} for
+generating chemical structural formulas in SVG format,
+and \href{https://inkscape.org/en/}{Inkscape} for converting SVG to PDF.
+Both programs are open source and cross-platform, and being actively maintained.
+
+\paragraph{About Open Babel}
+
+Open Babel is a toolbox specially designed to handle many kinds of
+chemical data. It is an open, collaborative project allowing anyone to search,
+convert, analyze, or store data from molecular modeling, chemistry,
+solid-state materials, biochemistry, or related areas.
+See \href{http://openbabel.org/}{Official Website} for detail.
+
+\clearpage
+
+\subsection{Idea and Approach}
+
+First I found a post on Noel O'Blog \cite{NOB1}, \cite{NOB2} and
+the comment \cite{JLA} about generating chemical structural formulas
+from SMILES notations using Open Babel.
+I thought the method described in these posts were very interesting,
+but I didn't like all the programs could be executed by
+\verb|-shell-escape| option.
+At the same time, I encountered a macro for copying all
+\verb|\includegraphics| from one source file to another \cite{OKU},
+which made me conceive of an idea of extracting minimal source code
+which needs \verb|-shell-escape| option.
+
+I thought this method would be applicable to converting ChemDraw files into
+graphics, but I could not find any project attempting to realize this idea.
+I found a project named
+\href{http://chemdrawinlatex.sourceforge.net/}{Chemdraw in \LaTeX}
+on Sourceforge, but now it was closed.
+This drove me to develop a new package to simplify the process for
+inserting chemical structural formulas into \LaTeX\ documents.
+
+
+\clearpage
+
+\section{Before you begin}
+
+\subsection{Installing dependent softwares}
+
+First, you have to install \href{http://openbabel.org/}{Open Babel} and
+\href{https://inkscape.org/en/}{Inkscape}
+(or \href{http://librsvg.sourceforge.net/download/}{librsvg}) on your
+computer, and export PATH to the command-line binary of both programs,
+\verb+obabel+ and \verb+inkscape+ (or \verb+rsvg-convert+).
+You can confirm by executing following commands:
+In UNIX operating system:
+\begin{verbatim}
+$ which obabel
+$ which inkscape        (if you choose inkscape)
+$ which rsvg-convert    (if you choose librsvg)
+\end{verbatim}
+
+In Windows operating system:
+\begin{verbatim}
+> where obabel
+> where inkscape        (if you choose inkscape)
+> where rsvg-convert    (if you choose librsvg)
+\end{verbatim}
+
+And when you get some command echo, installation should be successful.
+
+\subsection{Loading the package}
+
+In the preamble of your document, declare
+\begin{verbatim}
+\usepackage{chemobabel}
+\end{verbatim}
+to load \textsf{chemobabel} package.
+The package depends on \textsf{graphicx}.
+
+\clearpage
+
+\section{Basic Usage}
+\label{basic}
+
+\subsection{Conversion from Chemical Structure Data Files}
+
+Suppose you have \verb|ATP.cdx|, a file with chemical structural formula
+of ATP (Adenosine triphosphate) drawn in ChemDraw, and
+\verb|Brevetoxin A.mol|, a MDL Molfile which can be obtained from
+\href{http://www.chemspider.com/}{ChemSpider} (originally \verb|9041092.mol|).
+
+Use \verb|\chemobabel| command as follows. I put original files in a
+subdirectory \texttt{draw}, so added \texttt{draw/} before the actual filename.
+Of course you can put in the same directory with your \LaTeX\ file.
+
+\begin{verbatim}
+\chemobabel[width=90mm]{draw/ATP.cdx}{}
+\chemobabel[width=120mm]{draw/Brevetoxin A.mol}{}
+\end{verbatim}
+
+Then, typeset with \verb|-shell-escape| option.
+Remember to use this option, otherwise it won't allow \LaTeX\ to
+call any external command-line programs, such as obabel and inkscape!
+\begin{verbatim}
+$ pdflatex -shell-escape test.tex
+\end{verbatim}
+You will see in \verb|chemobabelimgdir| subdirectory ``chemobabelimg[NUM].pdf'',
+and output file test.pdf will be Figure~\ref{fig:chem1}:
+
+\begin{figure}[h]
+  \centering
+  \chemobabel[width=90mm]{draw/ATP.cdx}{} \\ \vspace{1cm}
+  \chemobabel[width=120mm]{draw/Brevetoxin A.mol}{}
+  \caption{Conversion from ATP.cdx and Brevetoxin A.mol}\label{fig:chem1}
+\end{figure}
+
+The syntax is:
+\begin{center}
+\verb|\chemobabel[|\textit{options}\verb|]{|\textit{filename}\verb|}{|\textit{obabel options}\verb|}|
+\end{center}
+As parameters, \textit{filename} should be placed in the first braces, and
+\textit{obabel options} (see Section \ref{depict} for some examples)
+can be added in the second braces.
+You can leave the second parameter empty.
+
+You can give \textit{options} to be passed to \verb|\includegraphics|
+command as optional parameters in the box brackets.
+This option is not necessary, so can be omitted. In this case the default
+option ``scale=1" is passed to \verb|\includegraphics| command.
+
+\subsection{Conversion from SMILES Notations}
+
+You can also write SMILES notations directly in your \LaTeX\ file to be
+converted into structural formulas.
+For example, \verb|CCO| is the SMILES notation of ethanol, and
+\verb|CC(=O)Nc1ccc(cc1)O| is that of acetaminophen (paracetamol).
+Use \verb|\smilesobabel| command as follows:
+
+\begin{verbatim}
+\smilesobabel{CCO}{}
+\smilesobabel[width=35mm]{CC(=O)Nc1ccc(cc1)O}{}
+\end{verbatim}
+
+Again typeset with \verb|-shell-escape| option:
+\begin{verbatim}
+$ pdflatex -shell-escape test.tex
+\end{verbatim}
+This time you will get ``smilesobabelimg[NUM].pdf'' and ``test.pdf''
+as Figure~\ref{fig:smi1}.
+\begin{figure}[h]
+  \centering
+  \smilesobabel{CCO}{} \quad
+  \smilesobabel[width=25mm]{CC(=O)Nc1ccc(cc1)O}{}
+  \caption{Conversion from SMILES notation}\label{fig:smi1}
+\end{figure}
+
+The syntax is:
+\begin{center}
+\verb|\smilesobabel[|\textit{options}\verb|]{|\textit{SMILES notation}\verb|}{|\textit{obabel options}\verb|}|
+\end{center}
+The only difference from \verb|\chemobabel| is that
+\textit{SMILES notation} should be placed in the first braces.
+You can put any kinds of SMILES notations in parameters of
+\verb|\smilesobabel|, even when they contain some special characters
+such as a backslash (\verb|\|) and a percent symbol (\verb|%|).
+Similarly, parameters of \verb|\chemobabel| can also contain
+these special characters.
+\begin{verbatim}
+\smilesobabel[width=28mm]{Cl/C=C/Br}{}
+\smilesobabel[width=28mm]{Cl/C=C\Br}{}
+\end{verbatim}
+\begin{figure}[h]
+  \centering
+  \smilesobabel[width=28mm]{Cl/C=C/Br}{} \quad
+  \smilesobabel[width=28mm]{Cl/C=C\Br}{}
+\end{figure}
+
+\noindent \textbf{Notes for users of earlier versions} ($\le$ \textsf{chemobabel} v0.6 [2015/06/29])
+
+In earlier versions of \textsf{chemobabel}, it was necessary for users
+to pay another attention when using these \LaTeX\ special characters.
+However, the workaround I had suggested before was far from desirable
+because ``casual \LaTeX\ users'' were forced to change category codes
+of these characters manually.
+
+To solve this problem, I prepared supporting macros inside the package
+itself ($\ge$ \textsf{chemobabel} v0.7 [2015/08/26]).
+Now you can put any kinds of SMILES notations directly without worrying
+about special characters (\verb|\|, \verb|%|, etc).
+Note that the undesirable workaround (like changing \verb|\catcode| inside
+\verb|\begingroup| ... \verb|\endgroup|) has now become rather harmful.
+
+
+\clearpage
+
+\subsection{Package options}
+
+By default, \textsf{chemobabel} converts chemical structures into
+PDF images using Inkscape. However, you can switch the image format
+and the conversion program if you like.
+
+When you are using drivers which do not support PDF figures (such as dvips),
+it will be helpful if \textsf{chemobabel} converts them into EPS images.
+For this purpose, you can use:
+\begin{verbatim}
+\usepackage[eps]{chemobabel}
+\end{verbatim}
+The option \verb|eps| switches the image format (that is, output format
+from Inkscape) into EPS ($\ge$ \textsf{chemobabel} v0.9d [2016/02/28]).
+
+You can also change the image conversion program from ``Inkscape'' to
+``rsvg-convert'' ($\ge$ \textsf{chemobabel} v0.9e [2016/03/07]).
+The program rsvg-convert is faster than inkscape, so it will be useful.
+For this purpose, use \verb|librsvg| option:
+\begin{verbatim}
+\usepackage[librsvg]{chemobabel}
+\end{verbatim}
+The default behavior is equivalent to the \verb|pdf| and \verb|inkscape| options:
+\begin{verbatim}
+\usepackage[pdf,inkscape]{chemobabel}
+\end{verbatim}
+
+Moreover, Open Babel v2.4.0 or later versions generate images with
+a rather large margin. To avoid this, the images are cropped
+using \verb|pdfcrop| for PDF or \verb|ps2eps| for EPS
+($\ge$ \textsf{chemobabel} v0.9i [2022/09/12]).
+If you want to disable this cropping, please add \verb|nocrop| option:
+\begin{verbatim}
+\usepackage[nocrop]{chemobabel}
+\end{verbatim}
+
+\clearpage
+
+\subsection{For Safer Typesetting...}
+\label{extract}
+
+With the basic method described in Section \ref{basic},
+you will get desired output in almost any situation.
+However, it is sometimes NOT desirable to use \verb|-shell-escape| option,
+because with that option \LaTeX\ can call \emph{any} external command-line
+programs whether you like it or not.
+This means that there is a chance for unknown programs to be executed,
+and this can be dangerous especially in case that you don't write your
+own \LaTeX\ code. To avoid this problem, I provide a workaround for
+extracting all \verb|\chemobabel| and \verb|\smilesobabel| commands
+to another \LaTeX\ file (Reference: \TeX\ Forum \cite{OKU}).
+
+All you have to do is to add \verb|extract| option when loading the package:
+\begin{verbatim}
+\usepackage[extract]{chemobabel}
+\end{verbatim}
+When typesetting, usual command
+\begin{verbatim}
+$ pdflatex test.tex
+\end{verbatim}
+can be used.
+With \verb|extract| option, all \textsf{chemobabel} does is extracting
+all \verb|\chemobabel| and \verb|\smilesobabel| commands from the
+original \LaTeX\ file.
+You will get ``ChemFigFile.tex'' in the same directory, a minimal
+\LaTeX\ source file which includes all \verb|\chemobabel| and
+\verb|\smilesobabel| commands.
+You can simply typeset it by
+\begin{verbatim}
+$ pdflatex -shell-escape ChemFigFile.tex
+\end{verbatim}
+and you will get PDF figures in the same way
+as described in Section \ref{basic}.
+After this, typeset your own document again
+(this time you should remove \verb|extract| option):
+\begin{verbatim}
+$ pdflatex test.tex
+\end{verbatim}
+This time you will get desired output ``test.pdf''
+which includes figures properly.
+This method will also save you a lot of time for typesetting.
+
+\clearpage
+
+\section{Advanced Usage}
+
+\subsection{Options for Depiction}
+\label{depict}
+
+As I have already mentioned, in both \verb|\chemobabel| and \verb|\smilesobabel|,
+you can give some \textit{obabel options} in the second braces.
+Here I will introduce some examples.
+\begin{itemize}
+\item
+\begin{verbatim}
+\smilesobabel{CC(=O)Nc1ccc(cc1)O}{-xa}
+\end{verbatim}
+executes a command which gives a formula with all carbon atoms shown:
+\begin{verbatim}
+$ obabel -:"CC(=O)Nc1ccc(cc1)O" -O smilesobabelimg[NUM].svg -xa
+\end{verbatim}
+\item
+\begin{verbatim}
+\smilesobabel{CC(=O)Nc1ccc(cc1)O}{-xu -xC}
+\end{verbatim}
+gives one without element-specific atom coloring or terminal carbon atoms:
+\begin{verbatim}
+$ obabel -:"CC(=O)Nc1ccc(cc1)O" -O smilesobabelimg[NUM].svg -xu -xC
+\end{verbatim}
+\item
+\begin{verbatim}
+\chemobabel{ATP.cdx}{-xd}
+\end{verbatim}
+You can add \texttt{-xd} option to remove filenames from ChemDraw figures with Open Babel 2.x.
+\begin{verbatim}
+$ obabel -:"ATP.cdx" -O chemobabelimg[NUM].svg -xd
+\end{verbatim}
+\end{itemize}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=21mm]{CC(=O)Nc1ccc(cc1)O}{} \hspace{1cm}
+  \smilesobabel[width=25mm]{CC(=O)Nc1ccc(cc1)O}{-xa} \hspace{1cm}
+  \smilesobabel[width=21mm]{CC(=O)Nc1ccc(cc1)O}{-xu}
+  \caption{Acetaminophen (Paracetamol): Nothing, \texttt{-xa}, \texttt{-xu}}
+  SMILES: \verb|CC(=O)Nc1ccc(cc1)O|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=25mm]{C1[C at H](C)C[C@@H](O)C1}{} \hspace{1cm}
+  \smilesobabel[width=25mm]{C1[C at H](C)C[C@@H](O)C1}{-xC} \hspace{1cm}
+  \smilesobabel[width=25mm]{C1[C at H](C)C[C@@H](O)C1}{-xt}
+  \caption{(1\textit{S},3\textit{S})-3-Methylcyclopentanol: Nothing, \texttt{-xC}, \texttt{-xt}}
+  SMILES: \verb|C1[C at H](C)C[C@@H](O)C1|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{} \hspace{1cm}
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{-xa -xu} \hspace{1cm}
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{-xu -xC}
+  \caption{3-Ethylbenzoyl chloride: Nothing, \texttt{-xa -xu}, \texttt{-xu -xC}}
+  SMILES: \verb|CCc1cccc(c1)C(=O)Cl|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{--highlight "cC=O blue"} \hspace{1cm}
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{-xA --genalias}
+  \caption{3-Ethylbenzoyl chloride: \texttt{--highlight "cC=O blue"}, \texttt{-xA --genalias}}
+  SMILES: \verb|CCc1cccc(c1)C(=O)Cl|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[width=65mm]{draw/Firefly luciferin.mol}{} \hspace{1cm}
+  \chemobabel[width=65mm]{draw/Firefly luciferin.mol}{-xa}
+  \caption{Firefly luciferin (from MDL Molfiles): Nothing, \texttt{-xa}}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[width=70mm]{draw/ATP.cdx}{} \hspace{1cm}
+  \chemobabel[width=70mm]{draw/ATP.cdx}{-xd}
+  \caption{ATP (from ChemDraw files): Nothing, \texttt{-xd}}
+\end{figure}
+
+\begin{figure}[ht]
+For more details, see
+\href{http://openbabel.org/docs/dev/Command-line_tools/babel.html}{obabel and babel}
+and
+\href{http://openbabel.org/docs/dev/FileFormats/SVG_2D_depiction.html}{SVG depiction (svg)}
+in Open Babel documentation.
+\end{figure}
+
+\clearpage
+
+\subsection{More complex structural formulas}
+
+Open Babel can generate more complex structural formulas from SMILES notations.
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=55mm]{CN1CC[C@]23c4c5ccc(c4O[C at H]2[C at H](C=C[C at H]3[C at H]1C5)O)O}{}
+  \caption{($-$)-Morphine}
+  SMILES: \verb|CN1CC[C@]23c4c5ccc(c4O[C at H]2[C at H](C=C[C at H]3[C at H]1C5)O)O|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=150mm]{C[C@@H]1C[C at H]2[C@@H](CC(=O)O2)O[C at H]3C[C@@H]4[C at H](C[C@@H]([C@@H]5[C@@H](O4)C/C=C\C[C@@H]6[C@@H](O5)C/C=C\[C@@H]7[C@@H](O6)CCC[C@@H]8[C@@](O7)(C[C@@H]9[C@@H](O8)C[C@@H]2[C@@H](O9)[C at H](C[C at H](O2)CC(=C)C=O)O)C)C)O[C@@]3(C1)C}{}
+  \caption{Brevetoxin A}
+  SMILES (Sorry but too long): \verb|C[C@@H]1C[C at H]2[C@@H](CC(=O)O2)O[C at H]3C[C@@H]4[C at H](C[C@@H]([C@@H]5[C@@H](O4)C/C=C\C[C@@H]6[C@@H](O5)C/C=C\[C@@H]7[C@@H](O6)CCC[C@@H]8[C@@](O7)(C[C@@H]9[C@@H](O8)C[C@@H]2[C@@H](O9)[C at H](C[C at H](O2)CC(=C)C=O)O)C)C)O[C@@]3(C1)C|
+\end{figure}
+
+However, the results are sometimes undesirable and may also be
+different depending on version numbers.
+Here are some examples:
+
+\clearpage
+
+\begin{figure}[p]
+Cephalostatin-1 (Example from \href{http://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system}{Wikipedia}): \\
+\verb|C[C@@](C)(O1)C[C@@H](O)[C@@]1(O2)[C@@H](C)[C@@H]3CC=C4[C@]3(C2)C(=O)C[C at H]5[C at H]4CC[C@@H](C6)[C@]5(C)Cc(n7)c6nc(C[C@@]89(C))c7C[C@@H]8CC[C@@H]%10[C@@H]9C[C@@H](O)[C@@]%11(C)C%10=C[C at H](O%12)[C@]%11(O)[C at H](C)[C@]%12(O%13)[C at H](O)C[C@@]%13(C)CO|
+\begin{center}
+  \includegraphics[scale=0.85]{figures/Mac231-Cephalostatin-1.pdf}
+  \caption{Cephalostatin-1 (figure from Open Babel for Mac 2.3.1)}
+  \includegraphics[scale=0.5]{figures/Win232-Cephalostatin-1.pdf}
+  \caption{Cephalostatin-1 (figure from Open Babel for Win 2.3.2)}
+\end{center}
+\end{figure}
+
+\begin{figure}[p]
+Sesamin: \verb|c1cc2c(cc1C3C4COC(C4CO3)c5ccc6c(c5)OCO6)OCO2|
+\begin{center}
+  \centering
+  \includegraphics[scale=0.5]{figures/Mac231-sesamin-normal.pdf}
+  \includegraphics[scale=0.5]{figures/Mac231-sesamin-gen2d.pdf}
+  \caption{Sesamin (figures from Open Babel for Mac 2.3.1; Normal and \texttt{--gen2d})}
+  \includegraphics[scale=0.5]{figures/Win232-sesamin-normal.pdf}
+  \includegraphics[scale=0.5]{figures/Win232-sesamin-gen2d.pdf}
+  \caption{Sesamin (figures from Open Babel for Win 2.3.2; Normal and \texttt{--gen2d})}
+\end{center}
+\end{figure}
+
+\clearpage
+
+Also, Open Babel may generate wrong structures from SMILES notations.
+Here we can see the formula generated from a SMILES notation lacks one double bond.
+\begin{figure}[ht]
+  \centering
+  \includegraphics[scale=0.6]{figures/Exact-FireflyLuciferin.pdf}
+  \caption{Firefly luciferin: exact structure from ChemSpider ID 4588411}
+  \includegraphics[scale=0.6]{figures/Win232-FireflyLuciferin.pdf}
+  \caption{Firefly luciferin?: output from Open Babel for Win 2.3.2}
+  \smilesobabel[width=66mm]{C1[C@@H](N/C(=c\2/nc3c(=CC(=O)C=C3)s2)/S1)C(=O)O}{}
+  \caption{Firefly luciferin?: output from current Open Babel}
+  SMILES: \verb|C1[C@@H](N/C(=c\2/nc3c(=CC(=O)C=C3)s2)/S1)C(=O)O|
+\end{figure}
+
+We can avoid all these problems by using \verb|\chemobabel| with \verb|.mol| or
+\verb|.cdx| files, instead of \verb|\smilesobabel|.
+However, the fact that many complex structures can be generated from
+only one character string is very interesting, isn't it?
+
+\clearpage
+
+\section{Note for Compatibility}
+
+\subsection{Advantages of \textsf{chemobabel}}
+
+The macros \verb|\smiles| (written by Noel O'Boyle \cite{NOB1}) and
+\verb|\obabel| (depends on \textsf{graphvizObabel.sty} by
+Jakob Lykke Andersen's \cite{JLA}) can be used as follows:
+\begin{verbatim}
+\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}
+}
+\usepackage{graphvizObabel}
+\smiles{CCO}
+\obabel[scale=0.6]{CCO}
+\end{verbatim}
+However, \verb|\smiles| command creates raster graphics (.png) and
+has no options to pass to \verb|\includegraphics|, and \verb|\obabel| command
+sometimes does not work because of lack of file extension (.pdf) and
+possibility of giving errors with empty optional parameters.
+These problems are solved in \verb|\smilesobabel|.
+
+\clearpage
+
+\section{Limitations and Alternatives}
+
+This method relies on Open Babel for generating structural formulas,
+even without drawing anything by yourself.
+Of course you can modify and customize these structures to some extent,
+but this method will not be suitable for fine control of the output.
+Also, computer-generated formulas may sometimes be unnatural and undesirable.
+Therefore this method will be useful only when you need a simple method
+for inserting structural formulas with minimal modification.
+If you are not satisfied with the output, consider using {\XyMTeX} or
+\textsf{chemfig} packages instead.
+
+I also found following packages which can be used for similar purpose:
+\begin{itemize}
+  \item \href{http://www.ctan.org/pkg/mol2chemfig}{\textsf{mol2chemfig}}:
+    convert chemical structures from MDL molfile format
+    to \textsf{chemfig} source code
+\end{itemize}
+
+\clearpage
+
+\section{Technical information}
+\label{detail}
+
+According to
+\href{http://www.daylight.com/meetings/summerschool98/course/dave/smiles-intro.html}{SMILES Tutorial},
+special characters are used in SMILES syntax are the followings:
+\begin{itemize}
+\item Roman alphabets: \verb|A-Z|, \verb|a-z|
+\item Numbers: \verb|1-10|
+\item Brackets: \verb|[ ] ( )|
+\item Others:
+\begin{itemize}
+\item \verb|*| (unspecified atomic number)
+\item \verb|.| (disconnection)
+\item \verb|+| (charge sign)
+\item \verb|-| (single bond or charge sign)
+\item \verb|=| (double bond)
+\item \verb|#| (triple bond)
+\item \verb|$| (quadruple bond)
+\item \verb|:| (aromatic bond)
+\item \verb|%| (used when more than 10 ring closures)
+\item \verb|/|, \verb|\| (configuration around double bonds)
+\item \verb|@| (tetrahedral chirality)
+\item \verb|>| (reaction)
+\end{itemize}
+\end{itemize}
+
+It is important to prevent these characters from being translated as
+\LaTeX\ special characters.
+However, a backslash (\verb|\|) is a default escape character in \LaTeX,
+and a percent symbol (\verb|%|) also has a special meaning as a comment character.
+In \textsf{chemobabel} (higher than v0.7), all these characters are
+handled properly by changing category codes temporarily (like \verb+\verb+). \\
+
+\clearpage
+
+To do (if possible):
+\begin{itemize}
+\item Check whether \texttt{obabel} and \texttt{inkscape} are successfully
+installed or not, before running programs.
+\end{itemize}
+
+\section{Version History}
+
+\begin{table}[h]
+\centering
+\begin{tabular}{ll}
+2014/12/01 v0.1  & Made public as \textsf{smilesobabel.sty} \\
+2014/12/02 v0.2  & Add options which can be passed to obabel. \\
+2014/12/07 v0.3  & Change name of package: \textsf{chemobabel.sty} \\
+                 & Images are stored in \texttt{chemobabelimgdir}. \\
+                 & Add \verb|\chemobabel| command. \\
+2014/12/09 v0.4  & Fix a bug: (Thanks: Yusuke Terada) \\
+                 & Extra spaces at the end of lines are removed. \\
+2014/12/20 v0.5  & Add \verb|extract| option. \\
+2015/06/29 v0.6  & Improve warning messages. \\
+2015/08/26 v0.7  & Solve \verb|\catcode|-related problems in \verb|\smilesobabel|. \\
+2015/08/27 v0.8  & Improve \verb|\smilesobabel| a little. \\
+2015/08/28 v0.9  & Improve \verb|\smilesobabel|: (Thanks: ZR) \\
+                 & Exclude $\varepsilon$-\TeX\ dependency. \\
+2015/08/29 v0.9a & Improve \verb|\chemobabel| a little. \\
+2016/01/06 v0.9b & Support Lua\TeX-0.85.0 and later versions. \\
+2016/02/09 v0.9c & Fix a bug; forgotten in v0.9b. \\
+2016/02/28 v0.9d & Add \verb|eps| and \verb|pdf| options. \\
+2016/03/07 v0.9e & Add \verb|librsvg| and \verb|inkscape| options. \\
+2016/10/23 v0.9f & Incorporate \verb|extract| option into main package. \\
+2018/01/23 v0.9g & Minor refactor of code. \\
+2022/09/11 v0.9h & Support Inkscape version 1.0 command line syntax. \\
+2022/09/12 v0.9i & Crop images before inclusion, add \verb|nocrop| option. \\
+2022/09/19 v0.9j & Check shell-escape status to show better error message. \\
+\end{tabular}
+\end{table}
+
+\textbf{Important!}
+\begin{itemize}
+\item In Version 0.2, the number of parameters set in \verb|\smilesobabel| is changed!
+\item From Version 0.3, the package name is changed to \textsf{chemobabel.sty}.
+\item From Version 0.7, the \verb|\catcode|-related workaround is rather harmful.
+\end{itemize}
+
+\clearpage
+
+\begin{thebibliography}{9}
+\bibitem{NOB1}
+\href{http://baoilleach.blogspot.jp/2012/03/cheer-up-your-latex-with-smiles-support.html}{Cheer up your \LaTeX\ with SMILES support} -- Noel O'Blog
+\bibitem{NOB2}
+\href{http://baoilleach.blogspot.jp/2012/04/cheer-up-your-latex-with-smiles-support.html}{Cheer up your \LaTeX\ with SMILES support II} -- Noel O'Blog
+\bibitem{JLA}
+\href{http://imada.sdu.dk/~jlandersen/}{\LaTeX: Graphviz and OpenBabel} -- Jakob Lykke Andersen
+\bibitem{OKU}
+\href{http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1411}{文章内の画像のみを表示する方法} -- \TeX\ Forum \\
+(How to extract only figures in \LaTeX\ source)
+\bibitem{ACE1}
+\href{http://acetaminophen.hatenablog.com/entry/2014/11/02/130624}{化学構造式を\TeX で(1):自動化による簡単生成} -- Acetaminophen's diary \\
+(Chemical Structural Formula in \LaTeX\ (1): An Easy Method by Auto-generation)
+\bibitem{ACE2}
+\href{http://acetaminophen.hatenablog.com/entry/2014/11/02/130624}{化学構造式を\TeX で(2):自動化の注意点と解消法} -- Acetaminophen's diary \\
+(Chemical Structural Formula in \LaTeX\ (2): Important Notes for Auto-generation and Solution)
+\bibitem{ACE3}
+\href{http://acetaminophen.hatenablog.com/entry/2014/11/05/135927}{化学構造式を\TeX で(3):補足事項} -- Acetaminophen's diary \\
+(Chemical Structural Formula in \LaTeX\ (3): Supplement)
+\end{thebibliography}
+
+\noindent
+\textbf{Note}: \href{http://acetaminophen.hatenablog.com/}{Acetaminophen's diary} is my own blog! (Sorry, but only in Japanese)
+
+I added a post about this package on the 8th day of \href{http://www.adventar.org/calendars/553}{\TeX\ \& \LaTeX\ Advent Calendar 2014} (in Japanese):
+\begin{itemize}
+\item \href{http://acetaminophen.hatenablog.com/entry/2014/12/08/053519}{誰でも簡単! 化学構造式を\LaTeX に取り込むパッケージ} -- Acetaminophen's diary \\
+(An easy way to insert chemical structural formulas into \LaTeX\ documents)
+\end{itemize}
+
+\end{document}
+\endinput
+%%
+%% End of file `chemobabel-en.tex'.


Property changes on: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.pdf	2022-09-19 20:26:49 UTC (rev 64443)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.pdf	2022-09-19 20:27:58 UTC (rev 64444)

Property changes on: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.tex	2022-09-19 20:27:58 UTC (rev 64444)
@@ -0,0 +1,760 @@
+%%
+%% This is file `chemobabel-ja.tex',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% chemobabel.dtx  (with options: `ja')
+%% 
+%% IMPORTANT NOTICE:
+%% 
+%% For the copyright see the source file.
+%% 
+%% Any modified versions of this file must be renamed
+%% with new filenames distinct from chemobabel-ja.tex.
+%% 
+%% For distribution of the original source see the terms
+%% for copying and modification in the file chemobabel.dtx.
+%% 
+%% This generated file may be distributed as long as the
+%% original source files, as listed above, are part of the
+%% same distribution. (The sources need not necessarily be
+%% in the same archive or directory.)
+%%
+%% This document describes the usage of `chemobabel.sty',
+%% a LaTeX package for generating chemical structural formulas
+%% using Open Babel and Inkscape.
+%%
+%% Copyright 2014-2022 Acetaminophen (Hironobu YAMASHITA)
+%%   Email   :  h.y.acetaminophen[a t]gmail.com
+%%   GitHub  :  https://github.com/aminophen
+%%   Blog    :  http://acetaminophen.hatenablog.com/
+%%   Twitter :  @aminophen
+%%
+\documentclass[12pt]{ltjsarticle}
+\usepackage[margin=20mm]{geometry}
+\usepackage[english]{babel}
+\usepackage[nofontspec,defaultsups]{newpxtext}
+\usepackage[zerostyle=c,straightquotes]{newtxtt}
+\usepackage{newpxmath}
+\usepackage[librsvg]{chemobabel}
+\usepackage[bookmarksnumbered=true,hidelinks,%
+ pdftitle={User Manual for chemobabel.sty},%
+ pdfauthor={Hironobu Yamashita (Acetaminophen)},%
+ pdfsubject={TeX \& LaTeX Advent Calendar 2014},%
+ pdfkeywords={chemistry,open babel,chemdraw,smiles}]{hyperref}
+\usepackage{footnotebackref}
+\makeatletter
+\long\def\@makecaption#1#2{%
+\vskip\abovecaptionskip
+\sbox\@tempboxa{#1: #2}
+\global\@minipagefalse
+\hbox to\hsize{\hfil\box\@tempboxa\hfil}
+\vskip\belowcaptionskip}
+\makeatother
+\newcount\TestCount
+\def\XyM{\ifnum\fam=-1\relax\fam=0\relax\fi\TestCount=\fam%
+X\kern-.30em\smash{\raise.50ex\hbox{$\fam\TestCount\Upsilon$}}%
+\kern-.30em{M}}
+\def\XyMTeX{\XyM\kern-.1em\TeX}
+\title{\textsf{chemobabel} \\[1ex]
+  \normalsize --- Chemical Structures from MDL Molfiles,
+  ChemDraw Files or SMILES Notations --- \\
+  化学構造式をMOLファイルやChemDrawファイル,SMILES表記法から自動生成
+  }
+\author{Hironobu Yamashita (@aminophen)}
+\begin{document}
+\renewcommand{\figurename}{Fig.\,}
+\pagenumbering{roman}
+\maketitle
+
+この文書では,\textbf{化学構造式を生成}して\LaTeX の文書中に挿入するための
+パッケージである\textsf{chemobabel.sty}と同梱リソースの使い方を説明します。
+構造式はOpen Babelの機能を利用することにより,MDL Molfile, ChemDrawファイル,
+さらにはSMILES表記法を含む\textbf{さまざまな化学データ形式から生成}できます。
+以下の構造式はこの方法によって出力されたものです。
+
+For English documentation, please refer to chemobabel-en.pdf.
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[width=65mm]{draw/Firefly luciferin.mol}{} \quad
+  \chemobabel[width=90mm]{draw/Brevetoxin A.mol}{}
+  \caption{Firefly luciferin \& Brevetoxin A (from MDL Molfiles)}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[width=90mm]{draw/ATP.cdx}{} \hspace{1cm}
+  \chemobabel[width=35mm]{draw/Glucose.cdx}{}
+  \caption{ATP (Adenosine triphosphate) \& Glucose (from ChemDraw files)}
+\end{figure}
+\begin{center}\small
+Note: with Open Babel 3.1.1 the chemical structure of ATP from the .cdx file
+becomes wrong.\\ See \url{https://github.com/openbabel/openbabel/issues/338}
+\end{center}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=36mm]{CCO}{} \hspace{1cm}
+  \smilesobabel[width=40mm]{CC(C(=O)O)N}{} \hspace{1cm}
+  \smilesobabel[width=30mm]{C1[C at H](C)C[C@@H](O)C1}{}
+  \caption{Ethanol, Alanine \& (1\textit{S},3\textit{S})-3-Methylcyclopentanol (from SMILES notations)}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=30mm]{CC(=O)Nc1ccc(cc1)O}{} \hspace{1cm}
+  \smilesobabel[width=40mm]{C([C@@H]1[C at H]([C@@H]([C at H]([C at H](O1)O)O)O)O)O}{}
+  \caption{Acetaminophen (Paracetamol) \& $\alpha$-\textsc{d}-Glucose (from SMILES notations)}
+\end{figure}
+
+\begin{figure}[ht]
+\centering
+このパッケージはGitHubで管理しています。\par
+\url{https://github.com/aminophen/chemobabel}\par
+問い合わせや改善案などはGitHubのIssuesへお願いします。
+\end{figure}
+
+\clearpage
+\setcounter{tocdepth}{3}
+\tableofcontents
+
+\clearpage
+\pagenumbering{arabic}
+
+\section{はじめに}
+
+\subsection{開発の動機}
+
+ご存じのとおり,\LaTeX は世界中で使われています。
+しかし,化学構造式を描くという点で考えると,
+\LaTeX 文書中に構造式を挿入する手段は非常に限られています。
+この目的を達成する確実かつ容易な方法が存在しないことは,化学分野における
+多くの研究者が\LaTeX システムを使わない要因になっていると考えられます。
+
+すでに\href{http://www.ctan.org/}{CTAN}からいくつかのパッケージが利用可能です:
+\begin{itemize}
+  \item \href{http://www.ctan.org/pkg/xymtex}{\XyMTeX}:
+    化学構造式を描くためのパッケージ集
+  \item \href{http://www.ctan.org/pkg/chemfig}{\textsf{chemfig}}:
+    Ti\textit{k}Zを利用して構造式を描画するパッケージ
+\end{itemize}
+これらのパッケージは確実で,あらゆる構造式を一貫性をもって描画することができます。
+しかし,十分にその機能を活用できるようになるには相当の熟練を要します。
+
+化学者向けの専用ツール
+(\href{http://www.cambridgesoft.com/Ensemble_for_Chemistry/ChemDraw/}{ChemDraw}など)
+でPDFやEPS形式で出力し,\verb|\includegraphics|によって
+構造式を取り込むという手段もあります。
+この場合,化学用のフォーマット(\verb|.cdx| や \verb|.mol| など)と
+画像フォーマット(\verb|.pdf| や \verb|.eps| など)の両方で保存する必要があります。
+
+新しいパッケージ \textsf{chemobabel.sty} は,\LaTeX 文書中に化学構造式を
+挿入する必要がある化学者に新たな選択肢を提供することでしょう。
+この方法では,\href{http://openbabel.org/}{Open Babel}によって
+SVG形式の構造式画像を生成し,
+さらに\href{https://inkscape.org/ja/}{Inkscape}によってSVGからPDFに変換します。
+どちらのプログラムもオープンソースかつクロスプラットフォームであり,
+盛んに開発が行われています。
+
+\paragraph{Open Babelについて}
+
+Open Babelはさまざまな化学データを扱うために特別に設計されたツールです。
+オープンな共同プロジェクトで,分子モデリング・化学・固体物性・生化学や
+関連分野のデータを誰もが検索・変換・分析・保存できることを目指しています。
+詳細は\href{http://openbabel.org/}{公式サイト}を参照してください。
+
+\clearpage
+
+\subsection{着想とアプローチ}
+
+
+最初にOpen Babelを用いてSMILES表記から化学構造式を生成するという
+Noel O'Blog の記事\cite{NOB1}, \cite{NOB2}とコメント\cite{JLA}を見つけました。
+これらの投稿に示された手法は非常におもしろいと思いましたが,
+すべてのプログラムが \verb|-shell-escape| オプションによって実行されて
+しまうことがあまり好きではありませんでした。
+それと同じころ,あるソース中の \verb|\includegraphics| を
+別のソースに書き出すというマクロ\cite{OKU}を偶然みつけ,
+このとき私は \verb|-shell-escape| が必要な最小のコードだけを抽出する
+という着想を得ました。
+
+この方法はChemDrawファイルを画像に変換する目的にも応用できると考えたのですが,
+この発想を実現したプロジェクトが見当たらず,ただ一つ見つけたSourceforgeの
+\href{http://chemdrawinlatex.sourceforge.net/}{Chemdraw in \LaTeX}は
+すでに終了していました。そこで,化学構造式を\LaTeX 文書中に挿入する手順を
+簡略化するパッケージを開発しようと考えました。
+
+\clearpage
+
+\section{パッケージを使う前に}
+
+\subsection{依存ソフトウェアのインストール}
+
+初めにコンピュータに\href{http://openbabel.org/}{Open Babel}と
+\href{https://inkscape.org/ja/}{Inkscape}(または
+\href{http://librsvg.sourceforge.net/download/}{librsvg})をインストールし,
+コマンドライン実行ファイルである\verb+obabel+と\verb+inkscape+
+(または\verb+rsvg-convert+)にPATHを通します。
+正しくPATHが通っているかどうかは以下のコマンドによって確認できます:
+UNIX系の場合:
+\begin{verbatim}
+$ which obabel
+$ which inkscape        (if you choose inkscape)
+$ which rsvg-convert    (if you choose librsvg)
+\end{verbatim}
+
+Windowsの場合:
+\begin{verbatim}
+> where obabel
+> where inkscape        (if you choose inkscape)
+> where rsvg-convert    (if you choose librsvg)
+\end{verbatim}
+
+何らかのディレクトリ名が返ってきた場合は,正しくインストールできているはずです。
+
+\subsection{パッケージの読み込み}
+
+プリアンブルに
+\begin{verbatim}
+\usepackage{chemobabel}
+\end{verbatim}
+と宣言して\textsf{chemobabel}パッケージを読み込みます。
+これは\textsf{graphicx}パッケージに依存しますので,
+もし(u)p\LaTeX を使っていてDVIドライバに\texttt{dvipdfmx}を使用する場合は
+ドライバオプション \verb+[dvipdfmx]+ をクラスオプション(グローバル)に
+付けるのを忘れないようにしてください。
+
+\clearpage
+
+\section{基本的な使い方}
+\label{basic}
+
+\subsection{化学構造式ファイルからの変換}
+
+\verb|ATP.cdx| はATP(アデノシン三リン酸)の構造式を
+ChemDrawで描画したファイル,\verb|Brevetoxin A.mol| は
+\href{http://www.chemspider.com/}{ChemSpider}から入手できるファイルです
+(もとのファイル名は \verb|9041092.mol| となっています)。
+
+\verb|\chemobabel| コマンドは本文中で以下のようにして使います。
+ここでは元のファイルを\texttt{draw}というサブディレクトリに置いたので,
+ファイル名の前に \texttt{draw/} を付けました。
+もちろん \LaTeX ソースと同一ディレクトリに置くこともできます。
+
+\begin{verbatim}
+\chemobabel[width=90mm]{draw/ATP.cdx}{}
+\chemobabel[width=120mm]{draw/Brevetoxin A.mol}{}
+\end{verbatim}
+
+\LaTeX ファイル名がtest.texだとすると,以下のように
+\verb|-shell-escape| オプションを与えてタイプセットします。
+このオプションを与えることで,\LaTeX が外部プログラムである
+obabelやinkscapeを呼んで実行できるようになります。
+\begin{verbatim}
+$ platex -shell-escape test.tex
+\end{verbatim}
+すると \verb|chemobabelimgdir| 以下に「chemobabelimg[NUM].pdf」という
+ファイルが生成します。得られたtest.dviに対して
+\begin{verbatim}
+$ dvipdfmx test.dvi
+\end{verbatim}
+と実行すると,出力される「test.pdf」は図\ref{fig:chem1}のようになります。
+
+\begin{figure}[h]
+  \centering
+  \chemobabel[width=90mm]{draw/ATP.cdx}{} \\ \vspace{1cm}
+  \chemobabel[width=120mm]{draw/Brevetoxin A.mol}{}
+  \caption{Conversion from ATP.cdx and Brevetoxin A.mol}\label{fig:chem1}
+\end{figure}
+
+構文は以下のとおりです。
+\begin{center}
+\verb|\chemobabel[|\textit{options}\verb|]{|\textit{filename}\verb|}{|\textit{obabel options}\verb|}|
+\end{center}
+引数として,中括弧の1つめにファイル名を与え,2つめにobabelに送る
+オプション(例は第\ref{depict}節を参照)を指定してください。
+2つめの引数は空にすることもできます。
+
+また,オプションとして角括弧に \verb|\includegraphics| に渡すオプションを
+指定することができます。
+このオプションは省略可能で,何も指定しない場合は scale=1 が適用されます。
+
+\subsection{SMILES表記法からの変換}
+
+\LaTeX ソースファイル中に直接SMILES表記を書き込んで,
+構造式に変換することもできます。
+例えば,\verb|CCO| はエタノールのSMILES表記,
+\verb|CC(=O)Nc1ccc(cc1)O| はアセトアミノフェンのSMILES表記です。
+\verb|\smilesobabel| コマンドを以下のようにして使います:
+
+\begin{verbatim}
+\smilesobabel{CCO}{}
+\smilesobabel[width=35mm]{CC(=O)Nc1ccc(cc1)O}{}
+\end{verbatim}
+
+やはり \verb|-shell-escape| オプションを付けてタイプセットします。
+\begin{verbatim}
+$ platex -shell-escape test.tex
+$ dvipdfmx test.dvi
+\end{verbatim}
+すると今度は「smilesobabelimg[NUM].pdf」のようなファイルが生成し,
+出力される「test.pdf」は図\ref{fig:smi1}のようになります。
+\begin{figure}[h]
+  \centering
+  \smilesobabel{CCO}{} \quad
+  \smilesobabel[width=25mm]{CC(=O)Nc1ccc(cc1)O}{}
+  \caption{Conversion from SMILES notation}\label{fig:smi1}
+\end{figure}
+
+構文は以下のとおりです。
+\begin{center}
+\verb|\smilesobabel[|\textit{options}\verb|]{|\textit{SMILES notation}\verb|}{|\textit{obabel options}\verb|}|
+\end{center}
+\verb|\chemobabel| との唯一の違いは,中括弧の1つめにSMILES表記法の
+テキストを与えることだけです。
+\verb|\smilesobabel| の引数としては,任意のSMILES表記を用いることができます
+(バックスラッシュ (\verb|\|) やパーセント記号 (\verb|%|) のような
+特別な文字が入っていてもかまいません)。
+なお,\verb|\chemobabel| の引数についても同様に,
+特別な文字を含むことができる設計になっています。
+\begin{verbatim}
+\smilesobabel[width=28mm]{Cl/C=C/Br}{}
+\smilesobabel[width=28mm]{Cl/C=C\Br}{}
+\end{verbatim}
+\begin{figure}[h]
+  \centering
+  \smilesobabel[width=28mm]{Cl/C=C/Br}{} \quad
+  \smilesobabel[width=28mm]{Cl/C=C\Br}{}
+\end{figure}
+
+
+\noindent \textbf{旧バージョンのユーザに対する注意} ($\le$ \textsf{chemobabel} v0.6 [2015/06/29])
+
+古いバージョンの\textsf{chemobabel}では,
+これらの\LaTeX で特別な意味を持つ文字に注意を払う必要がありました。
+従来私が紹介してきた回避策は“カジュアルな \LaTeX ユーザ”に
+カテゴリーコードを手動で変更させていたため,好ましいものではありませんでした。
+
+この問題を解決するため,パッケージ本体の側でこれらの文字をサポートする
+マクロを組み込みました(\textsf{chemobabel} v0.7 [2015/08/26] 以降)。
+これにより,\verb|\| や \verb|%| といった特別な文字を心配することなく,
+任意のSMILES表記を直接引数に渡すことができるようになっています。
+従来の回避策(\verb|\begingroup| ... \verb|\endgroup| 内で \verb|\catcode| を
+変更する方法)は今ではむしろ有害になっていますので,注意してください。
+
+\clearpage
+
+\subsection{パッケージオプション}
+
+\textsf{chemobabel} パッケージは,デフォルトでは化学構造式をInkscapeによって
+PDF形式の画像ファイルに変換して文書中に取り込みます。
+しかし,オプションで画像形式と変換プログラムを変更することができます。
+
+dvipsなどのPDF非対応のドライバを使用する場合は,EPS形式の画像ファイルに
+変換したほうが便利でしょう。この場合
+\begin{verbatim}
+\usepackage[eps]{chemobabel}
+\end{verbatim}
+というように \verb|eps| オプションを指定すれば,内部でInkscapeから出力される
+画像形式をPDFではなくEPSに変更します(\textsf{chemobabel} v0.9d [2016/02/28] 以降)。
+
+また,画像変換プログラムを Inkscape から rsvg-convert に変更することもできます
+(\textsf{chemobabel} v0.9e [2016/03/07] 以降)。
+rsvg-convertはInkscapeより高速ですから,便利かもしれません。
+この場合は,以下のように \verb|librsvg| オプションを指定します。
+\begin{verbatim}
+\usepackage[librsvg]{chemobabel}
+\end{verbatim}
+デフォルトは \verb|pdf| オプションと \verb|inkscape| オプションを
+指定した場合と等価です。
+\begin{verbatim}
+\usepackage[pdf,inkscape]{chemobabel}
+\end{verbatim}
+
+さらに,Open Babel v2.4.0以降で生成される画像はデフォルトで余白が大きいため,
+\verb|pdfcrop|(PDFの場合)あるいは\verb|ps2eps|(EPSの場合)で
+クロップしています(\textsf{chemobabel} v0.9i [2022/09/12] 以降)。
+これをやめたい場合は \verb|nocrop| オプションを指定してください。
+\begin{verbatim}
+\usepackage[nocrop]{chemobabel}
+\end{verbatim}
+
+\clearpage
+
+\subsection{安全なタイプセットのために}
+\label{extract}
+
+第\ref{basic}節で述べた基本的な使い方で,ほとんどの場合問題ないでしょう。
+しかし,\verb|-shell-escape| オプションを付けてタイプセットするため,
+好むと好まざるとにかかわらず\LaTeX が\emph{どんな外部コマンドでも}実行
+できてしまいます。つまり,知らないうちにプログラムが実行されてしまう可能性を示唆
+しており,これはとりわけ自分で書いた\LaTeX ソースでない場合には危険を伴います。
+この問題を回避するために,\verb|\chemobabel| と \verb|\smilesobabel| コマンド
+だけを別の \LaTeX ファイルに抽出するマクロを用意しています
+(参考:\TeX\ Forum \cite{OKU})。
+
+この場合は,パッケージを読み込む際に \verb|extract| オプションを付与してください。
+\begin{verbatim}
+\usepackage[extract]{chemobabel}
+\end{verbatim}
+タイプセットの際には通常の
+\begin{verbatim}
+$ platex test.tex
+\end{verbatim}
+というコマンドを使います。
+\verb|extract| オプションを付けると,\textsf{chemobabel}パッケージは
+単に元の\LaTeX ソースから \verb|\chemobabel| と \verb|\smilesobabel| コマンド
+だけを抽出するはたらきをします。
+その結果,同じディレクトリに「ChemFigFile.tex」というファイルが生成します。
+これは元のソースに書かれていた \verb|\chemobabel| と \verb|\smilesobabel| コマンド
+をすべて含む最小の \LaTeX ソースで,これは直接pdflatexでタイプセットできます。
+\begin{verbatim}
+$ pdflatex -shell-escape ChemFigFile.tex
+\end{verbatim}
+欧文と同じ仕様に統一したため,抽出される「ChemFigFile.tex」では
+\textsf{graphicx}パッケージに \texttt{[dvipdfmx]} オプション
+を与えずに読み込んでいます。したがって,
+このタイプセットだけは\texttt{pdflatex}を用いてください。
+すると,第\ref{basic}節と同様にPDF形式の図のファイルが生成しますので,
+あとは \verb|extract| オプションを除去して再度
+\begin{verbatim}
+$ platex test.tex
+$ dvipdfmx test.dvi
+\end{verbatim}
+と実行すれば,適切に図を取り込んだ望みどおりの「test.pdf」が得られます。
+この方法を用いれば,タイプセットに要する時間を大幅に短縮することも期待できます。
+
+\clearpage
+
+\section{高度な使い方}
+
+\subsection{描画オプション}
+\label{depict}
+
+既に述べたとおり,\verb|\chemobabel| と \verb|\smilesobabel| の両方について,
+2つめの中括弧に \textit{obabel options} を与えることができます。
+ここで,いくつかの有用な例を挙げておきます。
+\begin{itemize}
+\item
+\begin{verbatim}
+\smilesobabel{CC(=O)Nc1ccc(cc1)O}{-xa}
+\end{verbatim}
+構造式中の全ての炭素原子を省略せずに描画するコマンドを実行します:
+\begin{verbatim}
+$ obabel -:"CC(=O)Nc1ccc(cc1)O" -O smilesobabelimg[NUM].svg -xa
+\end{verbatim}
+\item
+\begin{verbatim}
+\smilesobabel{CC(=O)Nc1ccc(cc1)O}{-xu -xC}
+\end{verbatim}
+元素の着色を行わず,末端の炭素原子を明示しない構造式を出力します:
+\begin{verbatim}
+$ obabel -:"CC(=O)Nc1ccc(cc1)O" -O smilesobabelimg[NUM].svg -xu -xC
+\end{verbatim}
+\item
+\begin{verbatim}
+\chemobabel{ATP.cdx}{-xd}
+\end{verbatim}
+Open Babel 2.x系列でChemDrawの図からファイル名を取り除くには,\texttt{-xd} オプションを付けます:
+\begin{verbatim}
+$ obabel -:"ATP.cdx" -O chemobabelimg[NUM].svg -xd
+\end{verbatim}
+\end{itemize}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=21mm]{CC(=O)Nc1ccc(cc1)O}{} \hspace{1cm}
+  \smilesobabel[width=25mm]{CC(=O)Nc1ccc(cc1)O}{-xa} \hspace{1cm}
+  \smilesobabel[width=21mm]{CC(=O)Nc1ccc(cc1)O}{-xu}
+  \caption{Acetaminophen (Paracetamol): Nothing, \texttt{-xa}, \texttt{-xu}}
+  SMILES: \verb|CC(=O)Nc1ccc(cc1)O|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=25mm]{C1[C at H](C)C[C@@H](O)C1}{} \hspace{1cm}
+  \smilesobabel[width=25mm]{C1[C at H](C)C[C@@H](O)C1}{-xC} \hspace{1cm}
+  \smilesobabel[width=25mm]{C1[C at H](C)C[C@@H](O)C1}{-xt}
+  \caption{(1\textit{S},3\textit{S})-3-Methylcyclopentanol: Nothing, \texttt{-xC}, \texttt{-xt}}
+  SMILES: \verb|C1[C at H](C)C[C@@H](O)C1|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{} \hspace{1cm}
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{-xa -xu} \hspace{1cm}
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{-xu -xC}
+  \caption{3-Ethylbenzoyl chloride: Nothing, \texttt{-xa -xu}, \texttt{-xu -xC}}
+  SMILES: \verb|CCc1cccc(c1)C(=O)Cl|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{--highlight "cC=O blue"} \hspace{1cm}
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{-xA --genalias}
+  \caption{3-Ethylbenzoyl chloride: \texttt{--highlight "cC=O blue"}, \texttt{-xA --genalias}}
+  SMILES: \verb|CCc1cccc(c1)C(=O)Cl|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[width=65mm]{draw/Firefly luciferin.mol}{} \hspace{1cm}
+  \chemobabel[width=65mm]{draw/Firefly luciferin.mol}{-xa}
+  \caption{Firefly luciferin (from MDL Molfiles): Nothing, \texttt{-xa}}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[width=70mm]{draw/ATP.cdx}{} \hspace{1cm}
+  \chemobabel[width=70mm]{draw/ATP.cdx}{-xd}
+  \caption{ATP (from ChemDraw files): Nothing, \texttt{-xd}}
+\end{figure}
+
+\begin{figure}[ht]
+より詳細にはOpen Babel documentationの
+\href{http://openbabel.org/docs/dev/Command-line_tools/babel.html}{obabel and babel}または
+\href{http://openbabel.org/docs/dev/FileFormats/SVG_2D_depiction.html}{SVG depiction (svg)}を
+参照してください。
+\end{figure}
+
+\clearpage
+
+\subsection{より複雑な構造式}
+
+Open BabelはSMILES表記から複雑な構造式を生成することができます。
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=55mm]{CN1CC[C@]23c4c5ccc(c4O[C at H]2[C at H](C=C[C at H]3[C at H]1C5)O)O}{}
+  \caption{($-$)-Morphine}
+  SMILES: \verb|CN1CC[C@]23c4c5ccc(c4O[C at H]2[C at H](C=C[C at H]3[C at H]1C5)O)O|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=150mm]{C[C@@H]1C[C at H]2[C@@H](CC(=O)O2)O[C at H]3C[C@@H]4[C at H](C[C@@H]([C@@H]5[C@@H](O4)C/C=C\C[C@@H]6[C@@H](O5)C/C=C\[C@@H]7[C@@H](O6)CCC[C@@H]8[C@@](O7)(C[C@@H]9[C@@H](O8)C[C@@H]2[C@@H](O9)[C at H](C[C at H](O2)CC(=C)C=O)O)C)C)O[C@@]3(C1)C}{}
+  \caption{Brevetoxin A}
+  SMILES (Sorry but too long): \verb|C[C@@H]1C[C at H]2[C@@H](CC(=O)O2)O[C at H]3C[C@@H]4[C at H](C[C@@H]([C@@H]5[C@@H](O4)C/C=C\C[C@@H]6[C@@H](O5)C/C=C\[C@@H]7[C@@H](O6)CCC[C@@H]8[C@@](O7)(C[C@@H]9[C@@H](O8)C[C@@H]2[C@@H](O9)[C at H](C[C at H](O2)CC(=C)C=O)O)C)C)O[C@@]3(C1)C|
+\end{figure}
+
+しかし,時には結果が望ましくないことがあり,
+また使用するバージョン番号によって出力が異なることがあります。
+いくつかの例を示します:
+
+\clearpage
+
+\begin{figure}[p]
+Cephalostatin-1 (Example from \href{http://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system}{Wikipedia}): \\
+\verb|C[C@@](C)(O1)C[C@@H](O)[C@@]1(O2)[C@@H](C)[C@@H]3CC=C4[C@]3(C2)C(=O)C[C at H]5[C at H]4CC[C@@H](C6)[C@]5(C)Cc(n7)c6nc(C[C@@]89(C))c7C[C@@H]8CC[C@@H]%10[C@@H]9C[C@@H](O)[C@@]%11(C)C%10=C[C at H](O%12)[C@]%11(O)[C at H](C)[C@]%12(O%13)[C at H](O)C[C@@]%13(C)CO|
+\begin{center}
+  \includegraphics[scale=0.85]{figures/Mac231-Cephalostatin-1.pdf}
+  \caption{Cephalostatin-1 (figure from Open Babel for Mac 2.3.1)}
+  \includegraphics[scale=0.5]{figures/Win232-Cephalostatin-1.pdf}
+  \caption{Cephalostatin-1 (figure from Open Babel for Win 2.3.2)}
+\end{center}
+\end{figure}
+
+\begin{figure}[p]
+Sesamin: \verb|c1cc2c(cc1C3C4COC(C4CO3)c5ccc6c(c5)OCO6)OCO2|
+\begin{center}
+  \centering
+  \includegraphics[scale=0.5]{figures/Mac231-sesamin-normal.pdf}
+  \includegraphics[scale=0.5]{figures/Mac231-sesamin-gen2d.pdf}
+  \caption{Sesamin (figures from Open Babel for Mac 2.3.1; Normal and \texttt{--gen2d})}
+  \includegraphics[scale=0.5]{figures/Win232-sesamin-normal.pdf}
+  \includegraphics[scale=0.5]{figures/Win232-sesamin-gen2d.pdf}
+  \caption{Sesamin (figures from Open Babel for Win 2.3.2; Normal and \texttt{--gen2d})}
+\end{center}
+\end{figure}
+
+\clearpage
+
+また,Open BabelはSMILES表記から誤った構造式を生成することもあります。
+ホタルルシフェリンの図で,SMILES表記から生成した構造式には
+二重結合が一つ欠けています。
+\begin{figure}[ht]
+  \centering
+  \includegraphics[scale=0.6]{figures/Exact-FireflyLuciferin.pdf}
+  \caption{Firefly luciferin: exact structure from ChemSpider ID 4588411}
+  \includegraphics[scale=0.6]{figures/Win232-FireflyLuciferin.pdf}
+  \caption{Firefly luciferin?: output from Open Babel for Win 2.3.2}
+  \smilesobabel[width=66mm]{C1[C@@H](N/C(=c\2/nc3c(=CC(=O)C=C3)s2)/S1)C(=O)O}{}
+  \caption{Firefly luciferin?: output from current Open Babel}
+  SMILES: \verb|C1[C@@H](N/C(=c\2/nc3c(=CC(=O)C=C3)s2)/S1)C(=O)O|
+\end{figure}
+
+このような問題点は全て \verb|.mol| または \verb|.cdx| を
+用意して \verb|\chemobabel| を利用することで回避できます。
+とはいえ,ただの文字列から複雑な構造式を生成しうるということ自体,
+おもしろいとは思いませんか?
+
+\clearpage
+
+\section{互換性に関する注意}
+
+\subsection{\textsf{chemobabel}パッケージの有利な点}
+
+Noel O'Boyleさんによる \verb|\smiles| \cite{NOB1} あるいは
+Jakob Lykke Andersenさんによる\textsf{graphvizObabel.sty}が
+提供する \verb+\obabel+ \cite{JLA} は以下のようにして使うことになっています:
+\begin{verbatim}
+\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}
+}
+\usepackage{graphvizObabel}
+\smiles{CCO}
+\obabel[scale=0.6]{CCO}
+\end{verbatim}
+しかし,\verb|\smiles| はラスター画像 (.png) を生成して
+かつ \verb|\includegraphics| に渡すオプションを扱えず,\verb|\obabel| は
+拡張子 (.pdf) が欠落していたりオプション引数が空の場合にエラーが発生したり
+という理由で正しく処理できない可能性があります。
+これらの問題は \verb|\smilesobabel| では解決されています。
+
+\clearpage
+
+\section{この方法の限界と代替案}
+
+この方法はOpen Babelに依存して構造式を生成しており,
+一切自分で構造式を描画することなく済ませることさえ可能です。
+もちろんある程度はそれらの構造を修正したりカスタマイズしたりできますが,
+この方法は出力の緻密な調節には不向きでしょう。
+また,コンピュータによって生成される構造式は時に見た目が不自然で,
+好ましくない場合もあるかもしれません。
+したがって,この方法は構造式の出力を完全に制御したいという意図がなく,
+構造式を簡便に挿入したい場合にのみ役に立つでしょう。
+出力に満足できない場合は,\XyMTeX や\textsf{chemfig}のようなパッケージを
+代わりに使うことをご検討ください。
+
+同様の目的を達成するために使えそうなパッケージとして,
+以下のようなものもあります:
+\begin{itemize}
+  \item \href{http://www.ctan.org/pkg/mol2chemfig}{\textsf{mol2chemfig}}:
+    convert chemical structures from MDL molfile format
+    to \textsf{chemfig} source code
+\end{itemize}
+
+\clearpage
+
+\section{技術情報}
+\label{detail}
+
+SMILES表記法に使われる特殊文字の一覧は,
+\href{http://www.daylight.com/meetings/summerschool98/course/dave/smiles-intro.html}{SMILES Tutorial}%
+によると以下のようです。
+\begin{itemize}
+\item Roman alphabets: \verb|A-Z|, \verb|a-z|
+\item Numbers: \verb|1-10|
+\item Brackets: \verb|[ ] ( )|
+\item Others:
+\begin{itemize}
+\item \verb|*| (unspecified atomic number)
+\item \verb|.| (disconnection)
+\item \verb|+| (charge sign)
+\item \verb|-| (single bond or charge sign)
+\item \verb|=| (double bond)
+\item \verb|#| (triple bond)
+\item \verb|$| (quadruple bond)
+\item \verb|:| (aromatic bond)
+\item \verb|%| (used when more than 10 ring closures)
+\item \verb|/|, \verb|\| (configuration around double bonds)
+\item \verb|@| (tetrahedral chirality)
+\item \verb|>| (reaction)
+\end{itemize}
+\end{itemize}
+
+これらの文字が\LaTeX における特殊文字として解釈されることを防ぐ
+必要がありますが,バックスラッシュ \verb|\| はデフォルトの
+エスケープ文字であり,またパーセント記号 \verb|%| もコメント文字と
+しての特殊な意味を持っています。
+\textsf{chemobabel} v0.7以上では,カテゴリーコードを一時的に変更することで
+これらすべての文字を適切に扱うようになっています(\verb+\verb+と同様の手法)。
+
+\clearpage
+
+To do (if possible):
+\begin{itemize}
+\item Check whether \texttt{obabel} and \texttt{inkscape} are successfully
+installed or not, before running programs.
+\end{itemize}
+
+\section{更新履歴}
+
+\begin{table}[h]
+\centering
+\begin{tabular}{ll}
+2014/12/01 v0.1  & Made public as \textsf{smilesobabel.sty} \\
+2014/12/02 v0.2  & Add options which can be passed to obabel. \\
+2014/12/07 v0.3  & Change name of package: \textsf{chemobabel.sty} \\
+                 & Images are stored in \texttt{chemobabelimgdir}. \\
+                 & Add \verb|\chemobabel| command. \\
+2014/12/09 v0.4  & Fix a bug: (Thanks: Yusuke Terada) \\
+                 & Extra spaces at the end of lines are removed. \\
+2014/12/20 v0.5  & Add \verb|extract| option. \\
+2015/06/29 v0.6  & Improve warning messages. \\
+2015/08/26 v0.7  & Solve \verb|\catcode|-related problems in \verb|\smilesobabel|. \\
+2015/08/27 v0.8  & Improve \verb|\smilesobabel| a little. \\
+2015/08/28 v0.9  & Improve \verb|\smilesobabel|: (Thanks: ZR) \\
+                 & Exclude $\varepsilon$-\TeX\ dependency. \\
+2015/08/29 v0.9a & Improve \verb|\chemobabel| a little. \\
+2016/01/06 v0.9b & Support Lua\TeX-0.85.0 and later versions. \\
+2016/02/09 v0.9c & Fix a bug; forgotten in v0.9b. \\
+2016/02/28 v0.9d & Add \verb|eps| and \verb|pdf| options. \\
+2016/03/07 v0.9e & Add \verb|librsvg| and \verb|inkscape| options. \\
+2016/10/23 v0.9f & Incorporate \verb|extract| option into main package. \\
+2018/01/23 v0.9g & Minor refactor of code. \\
+2022/09/11 v0.9h & Support Inkscape version 1.0 command line syntax. \\
+2022/09/12 v0.9i & Crop images before inclusion, add \verb|nocrop| option. \\
+2022/09/19 v0.9j & Check shell-escape status to show better error message. \\
+\end{tabular}
+\end{table}
+
+\textbf{Important!}
+\begin{itemize}
+\item In Version 0.2, the number of parameters set in \verb|\smilesobabel| is changed!
+\item From Version 0.3, the package name is changed to \textsf{chemobabel.sty}.
+\item From Version 0.7, the \verb|\catcode|-related workaround is rather harmful.
+\end{itemize}
+
+\clearpage
+
+\begin{thebibliography}{9}
+\bibitem{NOB1}
+\href{http://baoilleach.blogspot.jp/2012/03/cheer-up-your-latex-with-smiles-support.html}{Cheer up your \LaTeX\ with SMILES support} -- Noel O'Blog
+\bibitem{NOB2}
+\href{http://baoilleach.blogspot.jp/2012/04/cheer-up-your-latex-with-smiles-support.html}{Cheer up your \LaTeX\ with SMILES support II} -- Noel O'Blog
+\bibitem{JLA}
+\href{http://imada.sdu.dk/~jlandersen/}{\LaTeX: Graphviz and OpenBabel} -- Jakob Lykke Andersen
+\bibitem{OKU}
+\href{http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1411}{文章内の画像のみを表示する方法} -- \TeX\ Forum \\
+(How to extract only figures in \LaTeX\ source)
+\bibitem{ACE1}
+\href{http://acetaminophen.hatenablog.com/entry/2014/11/02/130624}{化学構造式を\TeX で(1):自動化による簡単生成} -- Acetaminophen's diary \\
+(Chemical Structural Formula in \LaTeX\ (1): An Easy Method by Auto-generation)
+\bibitem{ACE2}
+\href{http://acetaminophen.hatenablog.com/entry/2014/11/02/130624}{化学構造式を\TeX で(2):自動化の注意点と解消法} -- Acetaminophen's diary \\
+(Chemical Structural Formula in \LaTeX\ (2): Important Notes for Auto-generation and Solution)
+\bibitem{ACE3}
+\href{http://acetaminophen.hatenablog.com/entry/2014/11/05/135927}{化学構造式を\TeX で(3):補足事項} -- Acetaminophen's diary \\
+(Chemical Structural Formula in \LaTeX\ (3): Supplement)
+\end{thebibliography}
+
+\noindent
+\textbf{Note}: \href{http://acetaminophen.hatenablog.com/}{Acetaminophen's diary} is my own blog! (Sorry, but only in Japanese)
+
+I added a post about this package on the 8th day of \href{http://www.adventar.org/calendars/553}{\TeX\ \& \LaTeX\ Advent Calendar 2014} (in Japanese):
+\begin{itemize}
+\item \href{http://acetaminophen.hatenablog.com/entry/2014/12/08/053519}{誰でも簡単! 化学構造式を\LaTeX に取り込むパッケージ} -- Acetaminophen's diary \\
+(An easy way to insert chemical structural formulas into \LaTeX\ documents)
+\end{itemize}
+
+\end{document}
+\endinput
+%%
+%% End of file `chemobabel-ja.tex'.


Property changes on: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/chemobabel/example-en.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/chemobabel/example-en.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/example-en.pdf	2022-09-19 20:26:49 UTC (rev 64443)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/example-en.pdf	2022-09-19 20:27:58 UTC (rev 64444)

Property changes on: trunk/Master/texmf-dist/doc/latex/chemobabel/example-en.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/chemobabel/example-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/example-en.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/example-en.tex	2022-09-19 20:27:58 UTC (rev 64444)
@@ -0,0 +1,50 @@
+%#! Usage:
+% * To typeset all at once:
+%    $ pdflatex -shell-escape example-en.tex   (without ``extract'' option)
+% * To typeset more safely:
+%    $ pdflatex example-en.tex                 (with ``extract'' option: \usepackage[extract]{chemobabel})
+%    $ pdflatex -shell-escape ChemFigFile.tex  (auto-generated pdfLaTeX source)
+%    $ pdflatex example-en.tex                 (without ``extract'' option)
+
+\documentclass{article}
+\usepackage[librsvg]{chemobabel}
+
+\title{An Example for \textsf{chemobabel} Package}
+\author{Acetaminophen}
+\begin{document}
+\maketitle
+
+The formulas below are generated using \textsf{chemobabel} package with the help of Open Babel and Inkscape.
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel{CCO}{}
+  \caption{Ethanol}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[scale=0.8]{C1[C at H](C)C[C@@H](O)C1}{}
+  \caption{(1\textit{S},3\textit{S})-3-Methylcyclopentanol}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[scale=0.7]{Cl/C=C/Br}{}
+  \smilesobabel[scale=0.7]{Cl/C=C\Br}{}
+  \caption{(\textit{E})-1-bromo-2-chloroethene \& (\textit{Z})-1-bromo-2-chloroethene}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[scale=0.6]{draw/ATP.cdx}{-xd}
+  \caption{ATP (Adenosine triphosphate)}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[scale=0.4]{draw/Brevetoxin A.mol}{}
+  \caption{Brevetoxin A}
+\end{figure}
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/chemobabel/example-en.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/chemobabel/example-ja.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/chemobabel/example-ja.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/example-ja.pdf	2022-09-19 20:26:49 UTC (rev 64443)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/example-ja.pdf	2022-09-19 20:27:58 UTC (rev 64444)

Property changes on: trunk/Master/texmf-dist/doc/latex/chemobabel/example-ja.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/chemobabel/example-ja.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/example-ja.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/example-ja.tex	2022-09-19 20:27:58 UTC (rev 64444)
@@ -0,0 +1,51 @@
+%#! 使い方:
+% * 一度にタイプセットする場合:
+%    $ platex -shell-escape example-ja.tex     ※これは [extract] オプションなし
+%    $ dvipdfmx example-ja.dvi
+% * より安全にタイプセットしたい場合:
+%    $ platex example-ja.tex                   ※このときは [extract] オプション付き \usepackage[extract]{chemobabel}
+%    $ pdflatex -shell-escape ChemFigFile.tex  ※自動生成する ChemFigFile.tex は pdflatex 用ソース
+%    $ platex example-ja.tex                   ※今度は [extract] オプションを付けない
+%    $ dvipdfmx example-ja.dvi
+
+\documentclass[dvipdfmx]{jsarticle}
+\usepackage[librsvg]{chemobabel}
+
+\title{\textsf{chemobabel.sty} の使用例}
+\author{アセトアミノフェン}
+\begin{document}
+\maketitle
+以下の構造式は、\textsf{chemobabel} パッケージを用いて Open Babel と Inkscape を介した自動変換により生成しました。
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel{CCO}{}
+  \caption{エタノール}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[scale=0.8]{C1[C at H](C)C[C@@H](O)C1}{}
+  \caption{(1\textit{S},3\textit{S})-3-メチルシクロペンタノール}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[scale=0.7]{Cl/C=C/Br}{}
+  \smilesobabel[scale=0.7]{Cl/C=C\Br}{}
+  \caption{(\textit{E})-1-ブロモ-2-クロロエテンと(\textit{Z})-1-ブロモ-2-クロロエテン}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[scale=0.6]{draw/ATP.cdx}{-xd}
+  \caption{ATP (アデノシン三リン酸)}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[scale=0.4]{draw/Brevetoxin A.mol}{}
+  \caption{ブレベトキシンA}
+\end{figure}
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/chemobabel/example-ja.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/chemobabel/images-for-doc.tar.gz
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/chemobabel/images-for-doc.tar.gz
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/images-for-doc.tar.gz	2022-09-19 20:26:49 UTC (rev 64443)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/images-for-doc.tar.gz	2022-09-19 20:27:58 UTC (rev 64444)

Property changes on: trunk/Master/texmf-dist/doc/latex/chemobabel/images-for-doc.tar.gz
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.dtx	2022-09-19 20:27:58 UTC (rev 64444)
@@ -0,0 +1,1224 @@
+%#!make chemobabel.pdf
+%%
+%% This document describes the usage of `chemobabel.sty',
+%% a LaTeX package for generating chemical structural formulas
+%% using Open Babel and Inkscape.
+%%
+%% Copyright 2014-2022 Acetaminophen (Hironobu YAMASHITA)
+%%   Email   :  h.y.acetaminophen[a t]gmail.com
+%%   GitHub  :  https://github.com/aminophen
+%%   Blog    :  http://acetaminophen.hatenablog.com/
+%%   Twitter :  @aminophen
+%%
+%
+\documentclass[12pt]{ltjsarticle}
+\usepackage[margin=20mm]{geometry}
+\usepackage[english]{babel}
+\usepackage[nofontspec,defaultsups]{newpxtext}
+\usepackage[zerostyle=c,straightquotes]{newtxtt}
+\usepackage{newpxmath}
+\usepackage[librsvg]{chemobabel}
+\usepackage[bookmarksnumbered=true,hidelinks,%
+ pdftitle={User Manual for chemobabel.sty},%
+ pdfauthor={Hironobu Yamashita (Acetaminophen)},%
+ pdfsubject={TeX \& LaTeX Advent Calendar 2014},%
+ pdfkeywords={chemistry,open babel,chemdraw,smiles}]{hyperref}
+\usepackage{footnotebackref}
+% --- Change the style of captions
+% --- (Japanese jsarticle style => English style)
+\makeatletter
+\long\def\@makecaption#1#2{%
+\vskip\abovecaptionskip
+\sbox\@tempboxa{#1: #2}
+\global\@minipagefalse
+\hbox to\hsize{\hfil\box\@tempboxa\hfil}
+\vskip\belowcaptionskip}
+\makeatother
+% --- XyMTeX logo definition
+\newcount\TestCount
+\def\XyM{\ifnum\fam=-1\relax\fam=0\relax\fi\TestCount=\fam%
+X\kern-.30em\smash{\raise.50ex\hbox{$\fam\TestCount\Upsilon$}}%
+\kern-.30em{M}}
+\def\XyMTeX{\XyM\kern-.1em\TeX}
+% ------
+\title{\textsf{chemobabel} \\[1ex]
+  \normalsize --- Chemical Structures from MDL Molfiles,
+  ChemDraw Files or SMILES Notations --- \\
+%<ja>  化学構造式をMOLファイルやChemDrawファイル,SMILES表記法から自動生成
+  }
+\author{Hironobu Yamashita (@aminophen)}
+\begin{document}
+\renewcommand{\figurename}{Fig.\,}
+\pagenumbering{roman}
+\maketitle
+
+%<*en>
+This document (\jobname.pdf) describes the usage of \textsf{chemobabel.sty},
+a \LaTeX\ package for \textbf{generating chemical structural formulas}
+to be inserted in your documents.
+The formulas can be generated \textbf{from many kinds of chemical data
+formats}, including MDL Molfiles, ChemDraw files and even from
+SMILES notations, with the help of Open Babel and Inkscape.
+The formulas below are generated using this method.
+
+日本語版ドキュメントはchemobabel-ja.pdfを参照してください。
+%</en>
+%<*ja>
+この文書では,\textbf{化学構造式を生成}して\LaTeX の文書中に挿入するための
+パッケージである\textsf{chemobabel.sty}と同梱リソースの使い方を説明します。
+構造式はOpen Babelの機能を利用することにより,MDL Molfile, ChemDrawファイル,
+さらにはSMILES表記法を含む\textbf{さまざまな化学データ形式から生成}できます。
+以下の構造式はこの方法によって出力されたものです。
+
+For English documentation, please refer to chemobabel-en.pdf.
+%</ja>
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[width=65mm]{draw/Firefly luciferin.mol}{} \quad
+  \chemobabel[width=90mm]{draw/Brevetoxin A.mol}{}
+  \caption{Firefly luciferin \& Brevetoxin A (from MDL Molfiles)}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[width=90mm]{draw/ATP.cdx}{} \hspace{1cm}
+  \chemobabel[width=35mm]{draw/Glucose.cdx}{}
+  \caption{ATP (Adenosine triphosphate) \& Glucose (from ChemDraw files)}
+\end{figure}
+\begin{center}\small
+Note: with Open Babel 3.1.1 the chemical structure of ATP from the .cdx file
+becomes wrong.\\ See \url{https://github.com/openbabel/openbabel/issues/338}
+\end{center}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=36mm]{CCO}{} \hspace{1cm}
+  \smilesobabel[width=40mm]{CC(C(=O)O)N}{} \hspace{1cm}
+  \smilesobabel[width=30mm]{C1[C at H](C)C[C@@H](O)C1}{}
+  \caption{Ethanol, Alanine \& (1\textit{S},3\textit{S})-3-Methylcyclopentanol (from SMILES notations)}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=30mm]{CC(=O)Nc1ccc(cc1)O}{} \hspace{1cm}
+  \smilesobabel[width=40mm]{C([C@@H]1[C at H]([C@@H]([C at H]([C at H](O1)O)O)O)O)O}{}
+  \caption{Acetaminophen (Paracetamol) \& $\alpha$-\textsc{d}-Glucose (from SMILES notations)}
+\end{figure}
+
+\begin{figure}[ht]
+\centering
+%<en>This package is maintained on GitHub:\par
+%<ja>このパッケージはGitHubで管理しています。\par
+\url{https://github.com/aminophen/chemobabel}\par
+%<en>If you have questions, please let me know.
+%<ja>問い合わせや改善案などはGitHubのIssuesへお願いします。
+\end{figure}
+
+\clearpage
+\setcounter{tocdepth}{3}
+\tableofcontents
+
+\clearpage
+\pagenumbering{arabic}
+
+%<*en>
+\section{Introduction}
+%</en>
+%<*ja>
+\section{はじめに}
+%</ja>
+
+%<*en>
+\subsection{Motivation for Development}
+%</en>
+%<*ja>
+\subsection{開発の動機}
+%</ja>
+
+%<*en>
+As you already know, \LaTeX\ is being used all over the world.
+However, when it comes to drawing chemical strucutral formulas,
+ways of inserting formulas into \LaTeX\ documents are very limited.
+I think it is mainly due to lack of both reliable and simple methods
+of doing this that many of the researchers in chemistry are reluctant
+to use \LaTeX\ system.
+%</en>
+%<*ja>
+ご存じのとおり,\LaTeX は世界中で使われています。
+しかし,化学構造式を描くという点で考えると,
+\LaTeX 文書中に構造式を挿入する手段は非常に限られています。
+この目的を達成する確実かつ容易な方法が存在しないことは,化学分野における
+多くの研究者が\LaTeX システムを使わない要因になっていると考えられます。
+%</ja>
+
+%<*en>
+Some \TeX/\LaTeX\ macros and packages are already available from
+\href{http://www.ctan.org/}{CTAN}:
+\begin{itemize}
+  \item \href{http://www.ctan.org/pkg/xymtex}{\XyMTeX}:
+    a set of packages for drawing chemical structural formulas
+\item \href{http://www.ctan.org/pkg/chemfig}{\textsf{chemfig}}:
+    a package which draws molecules using Ti\textit{k}Z
+\end{itemize}
+These packages are reliable and almost all kinds of structural formulas
+can be drawn in a consistent way. However, a lot of practice will be
+required before one can come to make full use of them.
+%</en>
+%<*ja>
+すでに\href{http://www.ctan.org/}{CTAN}からいくつかのパッケージが利用可能です:
+\begin{itemize}
+  \item \href{http://www.ctan.org/pkg/xymtex}{\XyMTeX}:
+    化学構造式を描くためのパッケージ集
+  \item \href{http://www.ctan.org/pkg/chemfig}{\textsf{chemfig}}:
+    Ti\textit{k}Zを利用して構造式を描画するパッケージ
+\end{itemize}
+これらのパッケージは確実で,あらゆる構造式を一貫性をもって描画することができます。
+しかし,十分にその機能を活用できるようになるには相当の熟練を要します。
+%</ja>
+
+%<*en>
+You can also insert structural formulas with \verb|\includegraphics| of
+PDF or EPS files exported from special softwares for chemists, such as
+\href{http://www.cambridgesoft.com/Ensemble_for_Chemistry/ChemDraw/}{ChemDraw}
+and other similar programs.
+In this case, you have to save files in both chemical formats
+(such as \verb|.cdx| or \verb|.mol|) and graphical formats
+(\verb|.pdf| or \verb|.eps|) manually.
+%</en>
+%<*ja>
+化学者向けの専用ツール
+(\href{http://www.cambridgesoft.com/Ensemble_for_Chemistry/ChemDraw/}{ChemDraw}など)
+でPDFやEPS形式で出力し,\verb|\includegraphics|によって
+構造式を取り込むという手段もあります。
+この場合,化学用のフォーマット(\verb|.cdx| や \verb|.mol| など)と
+画像フォーマット(\verb|.pdf| や \verb|.eps| など)の両方で保存する必要があります。
+%</ja>
+
+%<*en>
+This new package, \textsf{chemobabel.sty}, will offer a new choice for
+chemists who need chemical structures inserted in their \LaTeX\ documents.
+In this method, we use \href{http://openbabel.org/}{Open Babel} for
+generating chemical structural formulas in SVG format,
+and \href{https://inkscape.org/en/}{Inkscape} for converting SVG to PDF.
+Both programs are open source and cross-platform, and being actively maintained.
+%</en>
+%<*ja>
+新しいパッケージ \textsf{chemobabel.sty} は,\LaTeX 文書中に化学構造式を
+挿入する必要がある化学者に新たな選択肢を提供することでしょう。
+この方法では,\href{http://openbabel.org/}{Open Babel}によって
+SVG形式の構造式画像を生成し,
+さらに\href{https://inkscape.org/ja/}{Inkscape}によってSVGからPDFに変換します。
+どちらのプログラムもオープンソースかつクロスプラットフォームであり,
+盛んに開発が行われています。
+%</ja>
+
+%<*en>
+\paragraph{About Open Babel}
+
+Open Babel is a toolbox specially designed to handle many kinds of
+chemical data. It is an open, collaborative project allowing anyone to search,
+convert, analyze, or store data from molecular modeling, chemistry,
+solid-state materials, biochemistry, or related areas.
+See \href{http://openbabel.org/}{Official Website} for detail.
+%</en>
+%<*ja>
+\paragraph{Open Babelについて}
+
+Open Babelはさまざまな化学データを扱うために特別に設計されたツールです。
+オープンな共同プロジェクトで,分子モデリング・化学・固体物性・生化学や
+関連分野のデータを誰もが検索・変換・分析・保存できることを目指しています。
+詳細は\href{http://openbabel.org/}{公式サイト}を参照してください。
+%</ja>
+
+\clearpage
+
+%<*en>
+\subsection{Idea and Approach}
+%</en>
+%<*ja>
+\subsection{着想とアプローチ}
+%</ja>
+
+%<*en>
+First I found a post on Noel O'Blog \cite{NOB1}, \cite{NOB2} and
+the comment \cite{JLA} about generating chemical structural formulas
+from SMILES notations using Open Babel.
+I thought the method described in these posts were very interesting,
+but I didn't like all the programs could be executed by
+\verb|-shell-escape| option.
+At the same time, I encountered a macro for copying all
+\verb|\includegraphics| from one source file to another \cite{OKU},
+which made me conceive of an idea of extracting minimal source code
+which needs \verb|-shell-escape| option.
+
+I thought this method would be applicable to converting ChemDraw files into
+graphics, but I could not find any project attempting to realize this idea.
+I found a project named
+\href{http://chemdrawinlatex.sourceforge.net/}{Chemdraw in \LaTeX}
+on Sourceforge, but now it was closed.
+This drove me to develop a new package to simplify the process for
+inserting chemical structural formulas into \LaTeX\ documents.
+%</en>
+
+%<*ja>
+最初にOpen Babelを用いてSMILES表記から化学構造式を生成するという
+Noel O'Blog の記事\cite{NOB1}, \cite{NOB2}とコメント\cite{JLA}を見つけました。
+これらの投稿に示された手法は非常におもしろいと思いましたが,
+すべてのプログラムが \verb|-shell-escape| オプションによって実行されて
+しまうことがあまり好きではありませんでした。
+それと同じころ,あるソース中の \verb|\includegraphics| を
+別のソースに書き出すというマクロ\cite{OKU}を偶然みつけ,
+このとき私は \verb|-shell-escape| が必要な最小のコードだけを抽出する
+という着想を得ました。
+
+この方法はChemDrawファイルを画像に変換する目的にも応用できると考えたのですが,
+この発想を実現したプロジェクトが見当たらず,ただ一つ見つけたSourceforgeの
+\href{http://chemdrawinlatex.sourceforge.net/}{Chemdraw in \LaTeX}は
+すでに終了していました。そこで,化学構造式を\LaTeX 文書中に挿入する手順を
+簡略化するパッケージを開発しようと考えました。
+%</ja>
+
+\clearpage
+
+%<*en>
+\section{Before you begin}
+%</en>
+%<*ja>
+\section{パッケージを使う前に}
+%</ja>
+
+%<*en>
+\subsection{Installing dependent softwares}
+%</en>
+%<*ja>
+\subsection{依存ソフトウェアのインストール}
+%</ja>
+
+%<*en>
+First, you have to install \href{http://openbabel.org/}{Open Babel} and
+\href{https://inkscape.org/en/}{Inkscape}
+(or \href{http://librsvg.sourceforge.net/download/}{librsvg}) on your
+computer, and export PATH to the command-line binary of both programs,
+\verb+obabel+ and \verb+inkscape+ (or \verb+rsvg-convert+).
+You can confirm by executing following commands:
+%</en>
+%<*ja>
+初めにコンピュータに\href{http://openbabel.org/}{Open Babel}と
+\href{https://inkscape.org/ja/}{Inkscape}(または
+\href{http://librsvg.sourceforge.net/download/}{librsvg})をインストールし,
+コマンドライン実行ファイルである\verb+obabel+と\verb+inkscape+
+(または\verb+rsvg-convert+)にPATHを通します。
+正しくPATHが通っているかどうかは以下のコマンドによって確認できます:
+%</ja>
+%<en>In UNIX operating system:
+%<ja>UNIX系の場合:
+\begin{verbatim}
+$ which obabel
+$ which inkscape        (if you choose inkscape)
+$ which rsvg-convert    (if you choose librsvg)
+\end{verbatim}
+
+%<en>In Windows operating system:
+%<ja>Windowsの場合:
+\begin{verbatim}
+> where obabel
+> where inkscape        (if you choose inkscape)
+> where rsvg-convert    (if you choose librsvg)
+\end{verbatim}
+
+%<*en>
+And when you get some command echo, installation should be successful.
+%</en>
+%<*ja>
+何らかのディレクトリ名が返ってきた場合は,正しくインストールできているはずです。
+%</ja>
+
+%<*en>
+\subsection{Loading the package}
+%</en>
+%<*ja>
+\subsection{パッケージの読み込み}
+%</ja>
+
+%<*en>
+In the preamble of your document, declare
+\begin{verbatim}
+\usepackage{chemobabel}
+\end{verbatim}
+to load \textsf{chemobabel} package.
+The package depends on \textsf{graphicx}.
+%</en>
+%<*ja>
+プリアンブルに
+\begin{verbatim}
+\usepackage{chemobabel}
+\end{verbatim}
+と宣言して\textsf{chemobabel}パッケージを読み込みます。
+これは\textsf{graphicx}パッケージに依存しますので,
+もし(u)p\LaTeX を使っていてDVIドライバに\texttt{dvipdfmx}を使用する場合は
+ドライバオプション \verb+[dvipdfmx]+ をクラスオプション(グローバル)に
+付けるのを忘れないようにしてください。
+%</ja>
+
+\clearpage
+
+%<*en>
+\section{Basic Usage}
+%</en>
+%<*ja>
+\section{基本的な使い方}
+%</ja>
+\label{basic}
+
+%<*en>
+\subsection{Conversion from Chemical Structure Data Files}
+%</en>
+%<*ja>
+\subsection{化学構造式ファイルからの変換}
+%</ja>
+
+%<*en>
+Suppose you have \verb|ATP.cdx|, a file with chemical structural formula
+of ATP (Adenosine triphosphate) drawn in ChemDraw, and
+\verb|Brevetoxin A.mol|, a MDL Molfile which can be obtained from
+\href{http://www.chemspider.com/}{ChemSpider} (originally \verb|9041092.mol|).
+
+Use \verb|\chemobabel| command as follows. I put original files in a
+subdirectory \texttt{draw}, so added \texttt{draw/} before the actual filename.
+Of course you can put in the same directory with your \LaTeX\ file.
+%</en>
+%<*ja>
+\verb|ATP.cdx| はATP(アデノシン三リン酸)の構造式を
+ChemDrawで描画したファイル,\verb|Brevetoxin A.mol| は
+\href{http://www.chemspider.com/}{ChemSpider}から入手できるファイルです
+(もとのファイル名は \verb|9041092.mol| となっています)。
+
+\verb|\chemobabel| コマンドは本文中で以下のようにして使います。
+ここでは元のファイルを\texttt{draw}というサブディレクトリに置いたので,
+ファイル名の前に \texttt{draw/} を付けました。
+もちろん \LaTeX ソースと同一ディレクトリに置くこともできます。
+%</ja>
+
+\begin{verbatim}
+\chemobabel[width=90mm]{draw/ATP.cdx}{}
+\chemobabel[width=120mm]{draw/Brevetoxin A.mol}{}
+\end{verbatim}
+
+%<*en>
+Then, typeset with \verb|-shell-escape| option.
+Remember to use this option, otherwise it won't allow \LaTeX\ to
+call any external command-line programs, such as obabel and inkscape!
+\begin{verbatim}
+$ pdflatex -shell-escape test.tex
+\end{verbatim}
+You will see in \verb|chemobabelimgdir| subdirectory ``chemobabelimg[NUM].pdf'',
+and output file test.pdf will be Figure~\ref{fig:chem1}:
+%</en>
+%<*ja>
+\LaTeX ファイル名がtest.texだとすると,以下のように
+\verb|-shell-escape| オプションを与えてタイプセットします。
+このオプションを与えることで,\LaTeX が外部プログラムである
+obabelやinkscapeを呼んで実行できるようになります。
+\begin{verbatim}
+$ platex -shell-escape test.tex
+\end{verbatim}
+すると \verb|chemobabelimgdir| 以下に「chemobabelimg[NUM].pdf」という
+ファイルが生成します。得られたtest.dviに対して
+\begin{verbatim}
+$ dvipdfmx test.dvi
+\end{verbatim}
+と実行すると,出力される「test.pdf」は図\ref{fig:chem1}のようになります。
+%</ja>
+
+\begin{figure}[h]
+  \centering
+  \chemobabel[width=90mm]{draw/ATP.cdx}{} \\ \vspace{1cm}
+  \chemobabel[width=120mm]{draw/Brevetoxin A.mol}{}
+  \caption{Conversion from ATP.cdx and Brevetoxin A.mol}\label{fig:chem1}
+\end{figure}
+
+%<en>The syntax is:
+%<ja>構文は以下のとおりです。
+\begin{center}
+\verb|\chemobabel[|\textit{options}\verb|]{|\textit{filename}\verb|}{|\textit{obabel options}\verb|}|
+\end{center}
+%<*en>
+As parameters, \textit{filename} should be placed in the first braces, and
+\textit{obabel options} (see Section \ref{depict} for some examples)
+can be added in the second braces.
+You can leave the second parameter empty.
+
+You can give \textit{options} to be passed to \verb|\includegraphics|
+command as optional parameters in the box brackets.
+This option is not necessary, so can be omitted. In this case the default
+option ``scale=1" is passed to \verb|\includegraphics| command.
+%</en>
+%<*ja>
+引数として,中括弧の1つめにファイル名を与え,2つめにobabelに送る
+オプション(例は第\ref{depict}節を参照)を指定してください。
+2つめの引数は空にすることもできます。
+
+また,オプションとして角括弧に \verb|\includegraphics| に渡すオプションを
+指定することができます。
+このオプションは省略可能で,何も指定しない場合は scale=1 が適用されます。
+%</ja>
+
+%<*en>
+\subsection{Conversion from SMILES Notations}
+%</en>
+%<*ja>
+\subsection{SMILES表記法からの変換}
+%</ja>
+
+%<*en>
+You can also write SMILES notations directly in your \LaTeX\ file to be
+converted into structural formulas.
+For example, \verb|CCO| is the SMILES notation of ethanol, and
+\verb|CC(=O)Nc1ccc(cc1)O| is that of acetaminophen (paracetamol).
+Use \verb|\smilesobabel| command as follows:
+%</en>
+%<*ja>
+\LaTeX ソースファイル中に直接SMILES表記を書き込んで,
+構造式に変換することもできます。
+例えば,\verb|CCO| はエタノールのSMILES表記,
+\verb|CC(=O)Nc1ccc(cc1)O| はアセトアミノフェンのSMILES表記です。
+\verb|\smilesobabel| コマンドを以下のようにして使います:
+%</ja>
+
+\begin{verbatim}
+\smilesobabel{CCO}{}
+\smilesobabel[width=35mm]{CC(=O)Nc1ccc(cc1)O}{}
+\end{verbatim}
+
+%<*en>
+Again typeset with \verb|-shell-escape| option:
+\begin{verbatim}
+$ pdflatex -shell-escape test.tex
+\end{verbatim}
+This time you will get ``smilesobabelimg[NUM].pdf'' and ``test.pdf''
+as Figure~\ref{fig:smi1}.
+%</en>
+%<*ja>
+やはり \verb|-shell-escape| オプションを付けてタイプセットします。
+\begin{verbatim}
+$ platex -shell-escape test.tex
+$ dvipdfmx test.dvi
+\end{verbatim}
+すると今度は「smilesobabelimg[NUM].pdf」のようなファイルが生成し,
+出力される「test.pdf」は図\ref{fig:smi1}のようになります。
+%</ja>
+\begin{figure}[h]
+  \centering
+  \smilesobabel{CCO}{} \quad
+  \smilesobabel[width=25mm]{CC(=O)Nc1ccc(cc1)O}{}
+  \caption{Conversion from SMILES notation}\label{fig:smi1}
+\end{figure}
+
+%<en>The syntax is:
+%<ja>構文は以下のとおりです。
+\begin{center}
+\verb|\smilesobabel[|\textit{options}\verb|]{|\textit{SMILES notation}\verb|}{|\textit{obabel options}\verb|}|
+\end{center}
+%<*en>
+The only difference from \verb|\chemobabel| is that
+\textit{SMILES notation} should be placed in the first braces.
+You can put any kinds of SMILES notations in parameters of
+\verb|\smilesobabel|, even when they contain some special characters
+such as a backslash (\verb|\|) and a percent symbol (\verb|%|).
+Similarly, parameters of \verb|\chemobabel| can also contain
+these special characters.
+%</en>
+%<*ja>
+\verb|\chemobabel| との唯一の違いは,中括弧の1つめにSMILES表記法の
+テキストを与えることだけです。
+\verb|\smilesobabel| の引数としては,任意のSMILES表記を用いることができます
+(バックスラッシュ (\verb|\|) やパーセント記号 (\verb|%|) のような
+特別な文字が入っていてもかまいません)。
+なお,\verb|\chemobabel| の引数についても同様に,
+特別な文字を含むことができる設計になっています。
+%</ja>
+\begin{verbatim}
+\smilesobabel[width=28mm]{Cl/C=C/Br}{}
+\smilesobabel[width=28mm]{Cl/C=C\Br}{}
+\end{verbatim}
+\begin{figure}[h]
+  \centering
+  \smilesobabel[width=28mm]{Cl/C=C/Br}{} \quad
+  \smilesobabel[width=28mm]{Cl/C=C\Br}{}
+\end{figure}
+
+%<*en>
+\noindent \textbf{Notes for users of earlier versions} ($\le$ \textsf{chemobabel} v0.6 [2015/06/29])
+
+In earlier versions of \textsf{chemobabel}, it was necessary for users
+to pay another attention when using these \LaTeX\ special characters.
+However, the workaround I had suggested before was far from desirable
+because ``casual \LaTeX\ users'' were forced to change category codes
+of these characters manually.
+
+To solve this problem, I prepared supporting macros inside the package
+itself ($\ge$ \textsf{chemobabel} v0.7 [2015/08/26]).
+Now you can put any kinds of SMILES notations directly without worrying
+about special characters (\verb|\|, \verb|%|, etc).
+Note that the undesirable workaround (like changing \verb|\catcode| inside
+\verb|\begingroup| ... \verb|\endgroup|) has now become rather harmful.
+%</en>
+
+%<*ja>
+\noindent \textbf{旧バージョンのユーザに対する注意} ($\le$ \textsf{chemobabel} v0.6 [2015/06/29])
+
+古いバージョンの\textsf{chemobabel}では,
+これらの\LaTeX で特別な意味を持つ文字に注意を払う必要がありました。
+従来私が紹介してきた回避策は“カジュアルな \LaTeX ユーザ”に
+カテゴリーコードを手動で変更させていたため,好ましいものではありませんでした。
+
+この問題を解決するため,パッケージ本体の側でこれらの文字をサポートする
+マクロを組み込みました(\textsf{chemobabel} v0.7 [2015/08/26] 以降)。
+これにより,\verb|\| や \verb|%| といった特別な文字を心配することなく,
+任意のSMILES表記を直接引数に渡すことができるようになっています。
+従来の回避策(\verb|\begingroup| ... \verb|\endgroup| 内で \verb|\catcode| を
+変更する方法)は今ではむしろ有害になっていますので,注意してください。
+%</ja>
+
+\clearpage
+
+%<*en>
+\subsection{Package options}
+%</en>
+%<*ja>
+\subsection{パッケージオプション}
+%</ja>
+
+%<*en>
+By default, \textsf{chemobabel} converts chemical structures into
+PDF images using Inkscape. However, you can switch the image format
+and the conversion program if you like.
+
+When you are using drivers which do not support PDF figures (such as dvips),
+it will be helpful if \textsf{chemobabel} converts them into EPS images.
+For this purpose, you can use:
+%</en>
+%<*ja>
+\textsf{chemobabel} パッケージは,デフォルトでは化学構造式をInkscapeによって
+PDF形式の画像ファイルに変換して文書中に取り込みます。
+しかし,オプションで画像形式と変換プログラムを変更することができます。
+
+dvipsなどのPDF非対応のドライバを使用する場合は,EPS形式の画像ファイルに
+変換したほうが便利でしょう。この場合
+%</ja>
+\begin{verbatim}
+\usepackage[eps]{chemobabel}
+\end{verbatim}
+%<*en>
+The option \verb|eps| switches the image format (that is, output format
+from Inkscape) into EPS ($\ge$ \textsf{chemobabel} v0.9d [2016/02/28]).
+
+You can also change the image conversion program from ``Inkscape'' to
+``rsvg-convert'' ($\ge$ \textsf{chemobabel} v0.9e [2016/03/07]).
+The program rsvg-convert is faster than inkscape, so it will be useful.
+For this purpose, use \verb|librsvg| option:
+%</en>
+%<*ja>
+というように \verb|eps| オプションを指定すれば,内部でInkscapeから出力される
+画像形式をPDFではなくEPSに変更します(\textsf{chemobabel} v0.9d [2016/02/28] 以降)。
+
+また,画像変換プログラムを Inkscape から rsvg-convert に変更することもできます
+(\textsf{chemobabel} v0.9e [2016/03/07] 以降)。
+rsvg-convertはInkscapeより高速ですから,便利かもしれません。
+この場合は,以下のように \verb|librsvg| オプションを指定します。
+%</ja>
+\begin{verbatim}
+\usepackage[librsvg]{chemobabel}
+\end{verbatim}
+%<*en>
+The default behavior is equivalent to the \verb|pdf| and \verb|inkscape| options:
+%</en>
+%<*ja>
+デフォルトは \verb|pdf| オプションと \verb|inkscape| オプションを
+指定した場合と等価です。
+%</ja>
+\begin{verbatim}
+\usepackage[pdf,inkscape]{chemobabel}
+\end{verbatim}
+
+%<*en>
+Moreover, Open Babel v2.4.0 or later versions generate images with
+a rather large margin. To avoid this, the images are cropped
+using \verb|pdfcrop| for PDF or \verb|ps2eps| for EPS
+($\ge$ \textsf{chemobabel} v0.9i [2022/09/12]).
+If you want to disable this cropping, please add \verb|nocrop| option:
+%</en>
+%<*ja>
+さらに,Open Babel v2.4.0以降で生成される画像はデフォルトで余白が大きいため,
+\verb|pdfcrop|(PDFの場合)あるいは\verb|ps2eps|(EPSの場合)で
+クロップしています(\textsf{chemobabel} v0.9i [2022/09/12] 以降)。
+これをやめたい場合は \verb|nocrop| オプションを指定してください。
+%</ja>
+\begin{verbatim}
+\usepackage[nocrop]{chemobabel}
+\end{verbatim}
+
+\clearpage
+
+%<*en>
+\subsection{For Safer Typesetting...}
+%</en>
+%<*ja>
+\subsection{安全なタイプセットのために}
+%</ja>
+\label{extract}
+
+%<*en>
+With the basic method described in Section \ref{basic},
+you will get desired output in almost any situation.
+However, it is sometimes NOT desirable to use \verb|-shell-escape| option,
+because with that option \LaTeX\ can call \emph{any} external command-line
+programs whether you like it or not.
+This means that there is a chance for unknown programs to be executed,
+and this can be dangerous especially in case that you don't write your
+own \LaTeX\ code. To avoid this problem, I provide a workaround for
+extracting all \verb|\chemobabel| and \verb|\smilesobabel| commands
+to another \LaTeX\ file (Reference: \TeX\ Forum \cite{OKU}).
+
+All you have to do is to add \verb|extract| option when loading the package:
+%</en>
+%<*ja>
+第\ref{basic}節で述べた基本的な使い方で,ほとんどの場合問題ないでしょう。
+しかし,\verb|-shell-escape| オプションを付けてタイプセットするため,
+好むと好まざるとにかかわらず\LaTeX が\emph{どんな外部コマンドでも}実行
+できてしまいます。つまり,知らないうちにプログラムが実行されてしまう可能性を示唆
+しており,これはとりわけ自分で書いた\LaTeX ソースでない場合には危険を伴います。
+この問題を回避するために,\verb|\chemobabel| と \verb|\smilesobabel| コマンド
+だけを別の \LaTeX ファイルに抽出するマクロを用意しています
+(参考:\TeX\ Forum \cite{OKU})。
+
+この場合は,パッケージを読み込む際に \verb|extract| オプションを付与してください。
+%</ja>
+\begin{verbatim}
+\usepackage[extract]{chemobabel}
+\end{verbatim}
+%<*en>
+When typesetting, usual command
+\begin{verbatim}
+$ pdflatex test.tex
+\end{verbatim}
+can be used. 
+With \verb|extract| option, all \textsf{chemobabel} does is extracting
+all \verb|\chemobabel| and \verb|\smilesobabel| commands from the
+original \LaTeX\ file.
+You will get ``ChemFigFile.tex'' in the same directory, a minimal
+\LaTeX\ source file which includes all \verb|\chemobabel| and
+\verb|\smilesobabel| commands.
+You can simply typeset it by
+%</en>
+%<*ja>
+タイプセットの際には通常の
+\begin{verbatim}
+$ platex test.tex
+\end{verbatim}
+というコマンドを使います。
+\verb|extract| オプションを付けると,\textsf{chemobabel}パッケージは
+単に元の\LaTeX ソースから \verb|\chemobabel| と \verb|\smilesobabel| コマンド
+だけを抽出するはたらきをします。
+その結果,同じディレクトリに「ChemFigFile.tex」というファイルが生成します。
+これは元のソースに書かれていた \verb|\chemobabel| と \verb|\smilesobabel| コマンド
+をすべて含む最小の \LaTeX ソースで,これは直接pdflatexでタイプセットできます。
+%</ja>
+\begin{verbatim}
+$ pdflatex -shell-escape ChemFigFile.tex
+\end{verbatim}
+%<*ja>
+欧文と同じ仕様に統一したため,抽出される「ChemFigFile.tex」では
+\textsf{graphicx}パッケージに \texttt{[dvipdfmx]} オプション
+を与えずに読み込んでいます。したがって,
+このタイプセットだけは\texttt{pdflatex}を用いてください。
+%</ja>
+%<*en>
+and you will get PDF figures in the same way
+as described in Section \ref{basic}.
+After this, typeset your own document again
+(this time you should remove \verb|extract| option):
+\begin{verbatim}
+$ pdflatex test.tex
+\end{verbatim}
+This time you will get desired output ``test.pdf''
+which includes figures properly.
+This method will also save you a lot of time for typesetting.
+%</en>
+%<*ja>
+すると,第\ref{basic}節と同様にPDF形式の図のファイルが生成しますので,
+あとは \verb|extract| オプションを除去して再度
+\begin{verbatim}
+$ platex test.tex
+$ dvipdfmx test.dvi
+\end{verbatim}
+と実行すれば,適切に図を取り込んだ望みどおりの「test.pdf」が得られます。
+この方法を用いれば,タイプセットに要する時間を大幅に短縮することも期待できます。
+%</ja>
+
+\clearpage
+
+%<*en>
+\section{Advanced Usage}
+%</en>
+%<*ja>
+\section{高度な使い方}
+%</ja>
+
+%<*en>
+\subsection{Options for Depiction}
+%</en>
+%<*ja>
+\subsection{描画オプション}
+%</ja>
+\label{depict}
+
+%<*en>
+As I have already mentioned, in both \verb|\chemobabel| and \verb|\smilesobabel|,
+you can give some \textit{obabel options} in the second braces.
+Here I will introduce some examples.
+%</en>
+%<*ja>
+既に述べたとおり,\verb|\chemobabel| と \verb|\smilesobabel| の両方について,
+2つめの中括弧に \textit{obabel options} を与えることができます。
+ここで,いくつかの有用な例を挙げておきます。
+%</ja>
+\begin{itemize}
+\item
+\begin{verbatim}
+\smilesobabel{CC(=O)Nc1ccc(cc1)O}{-xa}
+\end{verbatim}
+%<en>executes a command which gives a formula with all carbon atoms shown:
+%<ja>構造式中の全ての炭素原子を省略せずに描画するコマンドを実行します:
+\begin{verbatim}
+$ obabel -:"CC(=O)Nc1ccc(cc1)O" -O smilesobabelimg[NUM].svg -xa
+\end{verbatim}
+\item
+\begin{verbatim}
+\smilesobabel{CC(=O)Nc1ccc(cc1)O}{-xu -xC}
+\end{verbatim}
+%<en>gives one without element-specific atom coloring or terminal carbon atoms:
+%<ja>元素の着色を行わず,末端の炭素原子を明示しない構造式を出力します:
+\begin{verbatim}
+$ obabel -:"CC(=O)Nc1ccc(cc1)O" -O smilesobabelimg[NUM].svg -xu -xC
+\end{verbatim}
+\item
+\begin{verbatim}
+\chemobabel{ATP.cdx}{-xd}
+\end{verbatim}
+%<en>You can add \texttt{-xd} option to remove filenames from ChemDraw figures with Open Babel 2.x.
+%<ja>Open Babel 2.x系列でChemDrawの図からファイル名を取り除くには,\texttt{-xd} オプションを付けます:
+\begin{verbatim}
+$ obabel -:"ATP.cdx" -O chemobabelimg[NUM].svg -xd
+\end{verbatim}
+\end{itemize}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=21mm]{CC(=O)Nc1ccc(cc1)O}{} \hspace{1cm}
+  \smilesobabel[width=25mm]{CC(=O)Nc1ccc(cc1)O}{-xa} \hspace{1cm}
+  \smilesobabel[width=21mm]{CC(=O)Nc1ccc(cc1)O}{-xu}
+  \caption{Acetaminophen (Paracetamol): Nothing, \texttt{-xa}, \texttt{-xu}}
+  SMILES: \verb|CC(=O)Nc1ccc(cc1)O|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=25mm]{C1[C at H](C)C[C@@H](O)C1}{} \hspace{1cm}
+  \smilesobabel[width=25mm]{C1[C at H](C)C[C@@H](O)C1}{-xC} \hspace{1cm}
+  \smilesobabel[width=25mm]{C1[C at H](C)C[C@@H](O)C1}{-xt}
+  \caption{(1\textit{S},3\textit{S})-3-Methylcyclopentanol: Nothing, \texttt{-xC}, \texttt{-xt}}
+  SMILES: \verb|C1[C at H](C)C[C@@H](O)C1|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{} \hspace{1cm}
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{-xa -xu} \hspace{1cm}
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{-xu -xC}
+  \caption{3-Ethylbenzoyl chloride: Nothing, \texttt{-xa -xu}, \texttt{-xu -xC}}
+  SMILES: \verb|CCc1cccc(c1)C(=O)Cl|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{--highlight "cC=O blue"} \hspace{1cm}
+  \smilesobabel[width=42mm]{CCc1cccc(c1)C(=O)Cl}{-xA --genalias}
+  \caption{3-Ethylbenzoyl chloride: \texttt{--highlight "cC=O blue"}, \texttt{-xA --genalias}}
+  SMILES: \verb|CCc1cccc(c1)C(=O)Cl|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[width=65mm]{draw/Firefly luciferin.mol}{} \hspace{1cm}
+  \chemobabel[width=65mm]{draw/Firefly luciferin.mol}{-xa}
+  \caption{Firefly luciferin (from MDL Molfiles): Nothing, \texttt{-xa}}
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \chemobabel[width=70mm]{draw/ATP.cdx}{} \hspace{1cm}
+  \chemobabel[width=70mm]{draw/ATP.cdx}{-xd}
+  \caption{ATP (from ChemDraw files): Nothing, \texttt{-xd}}
+\end{figure}
+
+\begin{figure}[ht]
+%<*en>
+For more details, see
+\href{http://openbabel.org/docs/dev/Command-line_tools/babel.html}{obabel and babel}
+and
+\href{http://openbabel.org/docs/dev/FileFormats/SVG_2D_depiction.html}{SVG depiction (svg)}
+in Open Babel documentation.
+%</en>
+%<*ja>
+より詳細にはOpen Babel documentationの
+\href{http://openbabel.org/docs/dev/Command-line_tools/babel.html}{obabel and babel}または
+\href{http://openbabel.org/docs/dev/FileFormats/SVG_2D_depiction.html}{SVG depiction (svg)}を
+参照してください。
+%</ja>
+\end{figure}
+
+\clearpage
+
+%<*en>
+\subsection{More complex structural formulas}
+%</en>
+%<*ja>
+\subsection{より複雑な構造式}
+%</ja>
+
+%<*en>
+Open Babel can generate more complex structural formulas from SMILES notations.
+%</en>
+%<*ja>
+Open BabelはSMILES表記から複雑な構造式を生成することができます。
+%</ja>
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=55mm]{CN1CC[C@]23c4c5ccc(c4O[C at H]2[C at H](C=C[C at H]3[C at H]1C5)O)O}{}
+  \caption{($-$)-Morphine}
+  SMILES: \verb|CN1CC[C@]23c4c5ccc(c4O[C at H]2[C at H](C=C[C at H]3[C at H]1C5)O)O|
+\end{figure}
+
+\begin{figure}[ht]
+  \centering
+  \smilesobabel[width=150mm]{C[C@@H]1C[C at H]2[C@@H](CC(=O)O2)O[C at H]3C[C@@H]4[C at H](C[C@@H]([C@@H]5[C@@H](O4)C/C=C\C[C@@H]6[C@@H](O5)C/C=C\[C@@H]7[C@@H](O6)CCC[C@@H]8[C@@](O7)(C[C@@H]9[C@@H](O8)C[C@@H]2[C@@H](O9)[C at H](C[C at H](O2)CC(=C)C=O)O)C)C)O[C@@]3(C1)C}{}
+  \caption{Brevetoxin A}
+  SMILES (Sorry but too long): \verb|C[C@@H]1C[C at H]2[C@@H](CC(=O)O2)O[C at H]3C[C@@H]4[C at H](C[C@@H]([C@@H]5[C@@H](O4)C/C=C\C[C@@H]6[C@@H](O5)C/C=C\[C@@H]7[C@@H](O6)CCC[C@@H]8[C@@](O7)(C[C@@H]9[C@@H](O8)C[C@@H]2[C@@H](O9)[C at H](C[C at H](O2)CC(=C)C=O)O)C)C)O[C@@]3(C1)C|
+\end{figure}
+
+%<*en>
+However, the results are sometimes undesirable and may also be
+different depending on version numbers.
+Here are some examples:
+%</en>
+%<*ja>
+しかし,時には結果が望ましくないことがあり,
+また使用するバージョン番号によって出力が異なることがあります。
+いくつかの例を示します:
+%</ja>
+
+\clearpage
+
+\begin{figure}[p]
+Cephalostatin-1 (Example from \href{http://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system}{Wikipedia}): \\
+\verb|C[C@@](C)(O1)C[C@@H](O)[C@@]1(O2)[C@@H](C)[C@@H]3CC=C4[C@]3(C2)C(=O)C[C at H]5[C at H]4CC[C@@H](C6)[C@]5(C)Cc(n7)c6nc(C[C@@]89(C))c7C[C@@H]8CC[C@@H]%10[C@@H]9C[C@@H](O)[C@@]%11(C)C%10=C[C at H](O%12)[C@]%11(O)[C at H](C)[C@]%12(O%13)[C at H](O)C[C@@]%13(C)CO|
+\begin{center}
+  \includegraphics[scale=0.85]{figures/Mac231-Cephalostatin-1.pdf}
+  \caption{Cephalostatin-1 (figure from Open Babel for Mac 2.3.1)}
+  \includegraphics[scale=0.5]{figures/Win232-Cephalostatin-1.pdf}
+  \caption{Cephalostatin-1 (figure from Open Babel for Win 2.3.2)}
+\end{center}
+\end{figure}
+
+\begin{figure}[p]
+Sesamin: \verb|c1cc2c(cc1C3C4COC(C4CO3)c5ccc6c(c5)OCO6)OCO2|
+\begin{center}
+  \centering
+  \includegraphics[scale=0.5]{figures/Mac231-sesamin-normal.pdf}
+  \includegraphics[scale=0.5]{figures/Mac231-sesamin-gen2d.pdf}
+  \caption{Sesamin (figures from Open Babel for Mac 2.3.1; Normal and \texttt{--gen2d})}
+  \includegraphics[scale=0.5]{figures/Win232-sesamin-normal.pdf}
+  \includegraphics[scale=0.5]{figures/Win232-sesamin-gen2d.pdf}
+  \caption{Sesamin (figures from Open Babel for Win 2.3.2; Normal and \texttt{--gen2d})}
+\end{center}
+\end{figure}
+
+\clearpage
+
+%<*en>
+Also, Open Babel may generate wrong structures from SMILES notations.
+Here we can see the formula generated from a SMILES notation lacks one double bond.
+%</en>
+%<*ja>
+また,Open BabelはSMILES表記から誤った構造式を生成することもあります。
+ホタルルシフェリンの図で,SMILES表記から生成した構造式には
+二重結合が一つ欠けています。
+%</ja>
+\begin{figure}[ht]
+  \centering
+  \includegraphics[scale=0.6]{figures/Exact-FireflyLuciferin.pdf}
+  \caption{Firefly luciferin: exact structure from ChemSpider ID 4588411}
+  \includegraphics[scale=0.6]{figures/Win232-FireflyLuciferin.pdf}
+  \caption{Firefly luciferin?: output from Open Babel for Win 2.3.2}
+  \smilesobabel[width=66mm]{C1[C@@H](N/C(=c\2/nc3c(=CC(=O)C=C3)s2)/S1)C(=O)O}{}
+  \caption{Firefly luciferin?: output from current Open Babel}
+  SMILES: \verb|C1[C@@H](N/C(=c\2/nc3c(=CC(=O)C=C3)s2)/S1)C(=O)O|
+\end{figure}
+
+%<*en>
+We can avoid all these problems by using \verb|\chemobabel| with \verb|.mol| or
+\verb|.cdx| files, instead of \verb|\smilesobabel|.
+However, the fact that many complex structures can be generated from
+only one character string is very interesting, isn't it?
+%</en>
+%<*ja>
+このような問題点は全て \verb|.mol| または \verb|.cdx| を
+用意して \verb|\chemobabel| を利用することで回避できます。
+とはいえ,ただの文字列から複雑な構造式を生成しうるということ自体,
+おもしろいとは思いませんか?
+%</ja>
+
+\clearpage
+
+%<*en>
+\section{Note for Compatibility}
+%</en>
+%<*ja>
+\section{互換性に関する注意}
+%</ja>
+
+%<*en>
+\subsection{Advantages of \textsf{chemobabel}}
+%</en>
+%<*ja>
+\subsection{\textsf{chemobabel}パッケージの有利な点}
+%</ja>
+
+%<*en>
+The macros \verb|\smiles| (written by Noel O'Boyle \cite{NOB1}) and
+\verb|\obabel| (depends on \textsf{graphvizObabel.sty} by
+Jakob Lykke Andersen's \cite{JLA}) can be used as follows:
+%</en>
+%<*ja>
+Noel O'Boyleさんによる \verb|\smiles| \cite{NOB1} あるいは
+Jakob Lykke Andersenさんによる\textsf{graphvizObabel.sty}が
+提供する \verb+\obabel+ \cite{JLA} は以下のようにして使うことになっています:
+%</ja>
+\begin{verbatim}
+% ----- for \smiles command -----
+\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}
+}
+% ----- for \obabel command -----
+\usepackage{graphvizObabel}
+% ============ usage ============
+\smiles{CCO}
+\obabel[scale=0.6]{CCO}
+\end{verbatim}
+%<*en>
+However, \verb|\smiles| command creates raster graphics (.png) and
+has no options to pass to \verb|\includegraphics|, and \verb|\obabel| command
+sometimes does not work because of lack of file extension (.pdf) and
+possibility of giving errors with empty optional parameters.
+These problems are solved in \verb|\smilesobabel|.
+%</en>
+%<*ja>
+しかし,\verb|\smiles| はラスター画像 (.png) を生成して
+かつ \verb|\includegraphics| に渡すオプションを扱えず,\verb|\obabel| は
+拡張子 (.pdf) が欠落していたりオプション引数が空の場合にエラーが発生したり
+という理由で正しく処理できない可能性があります。
+これらの問題は \verb|\smilesobabel| では解決されています。
+%</ja>
+
+\clearpage
+
+%<*en>
+\section{Limitations and Alternatives}
+%</en>
+%<*ja>
+\section{この方法の限界と代替案}
+%</ja>
+
+%<*en>
+This method relies on Open Babel for generating structural formulas,
+even without drawing anything by yourself.
+Of course you can modify and customize these structures to some extent,
+but this method will not be suitable for fine control of the output.
+Also, computer-generated formulas may sometimes be unnatural and undesirable.
+Therefore this method will be useful only when you need a simple method
+for inserting structural formulas with minimal modification.
+If you are not satisfied with the output, consider using {\XyMTeX} or
+\textsf{chemfig} packages instead.
+
+I also found following packages which can be used for similar purpose:
+%</en>
+%<*ja>
+この方法はOpen Babelに依存して構造式を生成しており,
+一切自分で構造式を描画することなく済ませることさえ可能です。
+もちろんある程度はそれらの構造を修正したりカスタマイズしたりできますが,
+この方法は出力の緻密な調節には不向きでしょう。
+また,コンピュータによって生成される構造式は時に見た目が不自然で,
+好ましくない場合もあるかもしれません。
+したがって,この方法は構造式の出力を完全に制御したいという意図がなく,
+構造式を簡便に挿入したい場合にのみ役に立つでしょう。
+出力に満足できない場合は,\XyMTeX や\textsf{chemfig}のようなパッケージを
+代わりに使うことをご検討ください。
+
+同様の目的を達成するために使えそうなパッケージとして,
+以下のようなものもあります:
+%</ja>
+\begin{itemize}
+  \item \href{http://www.ctan.org/pkg/mol2chemfig}{\textsf{mol2chemfig}}:
+    convert chemical structures from MDL molfile format
+    to \textsf{chemfig} source code
+\end{itemize}
+
+\clearpage
+
+%<*en>
+\section{Technical information}
+%</en>
+%<*ja>
+\section{技術情報}
+%</ja>
+\label{detail}
+
+%<*en>
+According to
+\href{http://www.daylight.com/meetings/summerschool98/course/dave/smiles-intro.html}{SMILES Tutorial},
+special characters are used in SMILES syntax are the followings:
+%</en>
+%<*ja>
+SMILES表記法に使われる特殊文字の一覧は,
+\href{http://www.daylight.com/meetings/summerschool98/course/dave/smiles-intro.html}{SMILES Tutorial}%
+によると以下のようです。
+%</ja>
+\begin{itemize}
+\item Roman alphabets: \verb|A-Z|, \verb|a-z|
+\item Numbers: \verb|1-10|
+\item Brackets: \verb|[ ] ( )|
+\item Others:
+\begin{itemize}
+\item \verb|*| (unspecified atomic number)
+\item \verb|.| (disconnection)
+\item \verb|+| (charge sign)
+\item \verb|-| (single bond or charge sign)
+\item \verb|=| (double bond)
+\item \verb|#| (triple bond)
+\item \verb|$| (quadruple bond)
+\item \verb|:| (aromatic bond)
+\item \verb|%| (used when more than 10 ring closures)
+\item \verb|/|, \verb|\| (configuration around double bonds)
+\item \verb|@| (tetrahedral chirality)
+\item \verb|>| (reaction)
+\end{itemize}
+\end{itemize}
+
+%<*en>
+It is important to prevent these characters from being translated as
+\LaTeX\ special characters.
+However, a backslash (\verb|\|) is a default escape character in \LaTeX,
+and a percent symbol (\verb|%|) also has a special meaning as a comment character.
+In \textsf{chemobabel} (higher than v0.7), all these characters are
+handled properly by changing category codes temporarily (like \verb+\verb+). \\
+%</en>
+%<*ja>
+これらの文字が\LaTeX における特殊文字として解釈されることを防ぐ
+必要がありますが,バックスラッシュ \verb|\| はデフォルトの
+エスケープ文字であり,またパーセント記号 \verb|%| もコメント文字と
+しての特殊な意味を持っています。
+\textsf{chemobabel} v0.7以上では,カテゴリーコードを一時的に変更することで
+これらすべての文字を適切に扱うようになっています(\verb+\verb+と同様の手法)。
+%</ja>
+
+\clearpage
+
+To do (if possible):
+\begin{itemize}
+\item Check whether \texttt{obabel} and \texttt{inkscape} are successfully
+installed or not, before running programs.
+\end{itemize}
+
+%<*en>
+\section{Version History}
+%</en>
+%<*ja>
+\section{更新履歴}
+%</ja>
+
+\begin{table}[h]
+\centering
+\begin{tabular}{ll}
+2014/12/01 v0.1  & Made public as \textsf{smilesobabel.sty} \\
+2014/12/02 v0.2  & Add options which can be passed to obabel. \\
+2014/12/07 v0.3  & Change name of package: \textsf{chemobabel.sty} \\
+                 & Images are stored in \texttt{chemobabelimgdir}. \\
+                 & Add \verb|\chemobabel| command. \\
+2014/12/09 v0.4  & Fix a bug: (Thanks: Yusuke Terada) \\
+                 & Extra spaces at the end of lines are removed. \\
+2014/12/20 v0.5  & Add \verb|extract| option. \\
+2015/06/29 v0.6  & Improve warning messages. \\
+2015/08/26 v0.7  & Solve \verb|\catcode|-related problems in \verb|\smilesobabel|. \\
+2015/08/27 v0.8  & Improve \verb|\smilesobabel| a little. \\
+2015/08/28 v0.9  & Improve \verb|\smilesobabel|: (Thanks: ZR) \\
+                 & Exclude $\varepsilon$-\TeX\ dependency. \\
+2015/08/29 v0.9a & Improve \verb|\chemobabel| a little. \\
+2016/01/06 v0.9b & Support Lua\TeX-0.85.0 and later versions. \\
+2016/02/09 v0.9c & Fix a bug; forgotten in v0.9b. \\
+2016/02/28 v0.9d & Add \verb|eps| and \verb|pdf| options. \\
+2016/03/07 v0.9e & Add \verb|librsvg| and \verb|inkscape| options. \\
+2016/10/23 v0.9f & Incorporate \verb|extract| option into main package. \\
+2018/01/23 v0.9g & Minor refactor of code. \\
+2022/09/11 v0.9h & Support Inkscape version 1.0 command line syntax. \\
+2022/09/12 v0.9i & Crop images before inclusion, add \verb|nocrop| option. \\
+2022/09/19 v0.9j & Check shell-escape status to show better error message. \\
+\end{tabular}
+\end{table}
+
+\textbf{Important!}
+\begin{itemize}
+\item In Version 0.2, the number of parameters set in \verb|\smilesobabel| is changed!
+\item From Version 0.3, the package name is changed to \textsf{chemobabel.sty}.
+\item From Version 0.7, the \verb|\catcode|-related workaround is rather harmful.
+\end{itemize}
+
+\clearpage
+
+\begin{thebibliography}{9}
+\bibitem{NOB1}
+\href{http://baoilleach.blogspot.jp/2012/03/cheer-up-your-latex-with-smiles-support.html}{Cheer up your \LaTeX\ with SMILES support} -- Noel O'Blog
+\bibitem{NOB2}
+\href{http://baoilleach.blogspot.jp/2012/04/cheer-up-your-latex-with-smiles-support.html}{Cheer up your \LaTeX\ with SMILES support II} -- Noel O'Blog
+\bibitem{JLA}
+\href{http://imada.sdu.dk/~jlandersen/}{\LaTeX: Graphviz and OpenBabel} -- Jakob Lykke Andersen
+\bibitem{OKU}
+\href{http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1411}{文章内の画像のみを表示する方法} -- \TeX\ Forum \\
+(How to extract only figures in \LaTeX\ source)
+\bibitem{ACE1}
+\href{http://acetaminophen.hatenablog.com/entry/2014/11/02/130624}{化学構造式を\TeX で(1):自動化による簡単生成} -- Acetaminophen's diary \\
+(Chemical Structural Formula in \LaTeX\ (1): An Easy Method by Auto-generation)
+\bibitem{ACE2}
+\href{http://acetaminophen.hatenablog.com/entry/2014/11/02/130624}{化学構造式を\TeX で(2):自動化の注意点と解消法} -- Acetaminophen's diary \\
+(Chemical Structural Formula in \LaTeX\ (2): Important Notes for Auto-generation and Solution)
+\bibitem{ACE3}
+\href{http://acetaminophen.hatenablog.com/entry/2014/11/05/135927}{化学構造式を\TeX で(3):補足事項} -- Acetaminophen's diary \\
+(Chemical Structural Formula in \LaTeX\ (3): Supplement)
+\end{thebibliography}
+
+\noindent
+\textbf{Note}: \href{http://acetaminophen.hatenablog.com/}{Acetaminophen's diary} is my own blog! (Sorry, but only in Japanese)
+
+I added a post about this package on the 8th day of \href{http://www.adventar.org/calendars/553}{\TeX\ \& \LaTeX\ Advent Calendar 2014} (in Japanese):
+\begin{itemize}
+\item \href{http://acetaminophen.hatenablog.com/entry/2014/12/08/053519}{誰でも簡単! 化学構造式を\LaTeX に取り込むパッケージ} -- Acetaminophen's diary \\
+(An easy way to insert chemical structural formulas into \LaTeX\ documents)
+\end{itemize}
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.ins	2022-09-19 20:27:58 UTC (rev 64444)
@@ -0,0 +1,7 @@
+\input docstrip.tex
+\askforoverwritefalse
+\generate{
+    \file{chemobabel-en.tex}{\from{chemobabel.dtx}{en}}
+    \file{chemobabel-ja.tex}{\from{chemobabel.dtx}{ja}}
+}
+\endbatchfile

Added: trunk/Master/texmf-dist/tex/latex/chemobabel/chemobabel.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/chemobabel/chemobabel.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/chemobabel/chemobabel.sty	2022-09-19 20:27:58 UTC (rev 64444)
@@ -0,0 +1,274 @@
+%
+% This is file `chemobabel.sty',
+% for generating chemical structural formulas
+% using Open Babel and Inkscape.
+%
+% Copyright 2014-2022 Acetaminophen (Hironobu YAMASHITA)
+%   Email   :  h.y.acetaminophen[a t]gmail.com
+%   GitHub  :  https://github.com/aminophen
+%   Blog    :  http://acetaminophen.hatenablog.com/
+%   Twitter :  @aminophen
+%
+% This work is based on a lot of resources published online.
+%  - Noel O'Boyle http://baoilleach.blogspot.jp/
+%  - Jakob Lykke Andersen http://imada.sdu.dk/~jlandersen/
+%  - TeX Forum http://oku.edu.mie-u.ac.jp/tex/
+%
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{chemobabel}
+  [2022/09/19 v0.9j Chemical structures with Open Babel]
+
+%% Start of package main code
+%% Thanks: http://imada.sdu.dk/~jlandersen/latex/graphvizObabel.sty
+
+\RequirePackage{verbatim}
+\RequirePackage{graphicx}
+
+%% ----- External command execution -----
+\ifx\directlua\@undefined
+  \def\chemob at bel@exec#1{\immediate\write18{#1}}
+  \ifx\pdfshellescape\@undefined
+    \ifx\shellescape\@undefined
+      \chardef\chemob at bel@shellescape \@ne % fallback no warning
+    \else
+      % xelatex, hilatex
+      \chardef\chemob at bel@shellescape \shellescape
+    \fi
+  \else
+      % (pdf)latex, platex, uplatex
+      \chardef\chemob at bel@shellescape \pdfshellescape
+  \fi
+\else
+  \def\chemob at bel@exec#1{\directlua{os.execute[[#1]]}}
+  \chardef\chemob at bel@shellescape =\directlua{tex.sprint(status.shell_escape)}
+\fi
+
+%% ----- Make a directory for images -----
+\newcommand\chemobabelimgdir{chemobabelimgdir}
+\chemob at bel@exec{mkdir \chemobabelimgdir}
+
+%% ----- Definition of external commands -----
+\def\smilesob at bel@obabelcmd#1#2{obabel -:"#1" -O \smilesob at belGetName.svg #2}
+\def\chemob at bel@obabelcmd#1#2{obabel "#1" -O \chemob at belGetName.svg #2}
+%
+% inkscape 0.92 or earlier
+\def\chemob at bel@inkscapeoldcmd#1#2{inkscape -f #1.svg --export-#2=#1.#2}
+% inkscape major version 1.0
+\def\chemob at bel@inkscapecmd#1#2{inkscape #1.svg --export-type=#2}
+%
+% librsvg
+\def\chemob at bel@librsvgcmd#1#2{rsvg-convert -f #2 -o #1.#2 #1.svg}
+%
+% crop PDF
+\def\chemob at bel@pdfcropcmd#1{pdfcrop #1.pdf}% -> #1-crop.pdf
+% crop EPS
+\def\chemob at bel@epscropcmd#1{ps2eps -f #1.eps}% -> #1.eps.eps
+
+%% ----- Common part of \smilesobabel and \chemobabel -----
+\def\chemob at bel@common at maybeimg#1#2#3{%
+  \def\chemob at belImgName{#2\chemob at bel@maybecrop.\chemob at belimgExt}%
+  \IfFileExists{\chemob at belImgName}{% the image exists: include it
+    #1{\chemob at belImgName}%
+  }{% the image was not created - show a warning and a hint
+    \PackageWarning{chemobabel}{Processing of #3\space failed}%
+    \fbox{\begin{minipage}{0.9\textwidth}
+      Warning in chemobabel: #3\space was not processed.
+    \ifnum\chemob at bel@shellescape=\@ne
+      Please make sure that \texttt{obabel},
+      \ifx\chemob at bel@svgtoimgcmd\chemob at bel@librsvgcmd
+        \texttt{rsvg-convert}
+      \else
+        \texttt{inkscape}
+      \fi
+      \ifx\chemob at bel@cropcmd\chemob at bel@pdfcropcmd
+        and \texttt{pdfcrop}
+      \else\ifx\chemob at bel@cropcmd\chemob at bel@epscropcmd
+        and \texttt{ps2eps}
+      \fi\fi
+      are installed.\\
+    \else
+      Remember to run \texttt{latex} (\texttt{pdflatex}, \texttt{platex}, etc.)
+      with the \texttt{-shell-escape} option.\\
+    \fi
+      \IfFileExists{#2.log}{%
+        obabel log (might be empty):
+        \verbatiminput{#2.log}%
+      }{%
+        No log file.%
+      }%
+    \end{minipage}}%
+  }%
+}
+%% ----- Common part of \smilesobabel and \chemobabel end -----
+
+%% ----- Definition of \smilesobabel -----
+\newcounter{smilesob at belCounter}
+\setcounter{smilesob at belCounter}{1}
+\newcommand\smilesob at belPrefix{\chemobabelimgdir/smilesobabelimg}
+\newcommand\smilesob at belGetName{\smilesob at belPrefix\arabic{smilesob at belCounter}}
+
+% 1: (optional) options for includegraphics
+% 2: SMILES notation
+% 3: options for obabel
+\newcommand\smilesobabel[1][scale=1]{%
+  \def\smilesobabel at next{\includegraphics[#1]}%
+  \begingroup
+    \let\do\@makeother \dospecials \catcode`\{=1 \catcode`\}=2
+    \@smilesobabel
+}
+\newcommand\@smilesobabel[2]{%
+  \endgroup
+  \chemob at bel@exec{%
+    \smilesob at bel@obabelcmd{#1}{#2} 2>\smilesob at belGetName.log
+    && \chemob at bel@svgtoimgcmd{\smilesob at belGetName}{\chemob at belimgExt} 2>>\smilesob at belGetName.log
+    || rm -f \smilesob at belGetName.\chemob at belimgExt}%
+  \chemob at bel@exec{\chemob at bel@cropcmd{\smilesob at belGetName}}%
+  \chemob at bel@common at maybeimg{\smilesobabel at next}{\smilesob at belGetName}{SMILES string}%
+  \addtocounter{smilesob at belCounter}{1}% select next name
+}
+%% ----- Definition of \smilesobabel end -----
+
+%% ----- Definition of \chemobabel -----
+\newcounter{chemob at belCounter}
+\setcounter{chemob at belCounter}{1}
+\newcommand\chemob at belPrefix{\chemobabelimgdir/chemobabelimg}
+\newcommand\chemob at belGetName{\chemob at belPrefix\arabic{chemob at belCounter}}
+
+% 1: (optional) options for includegraphics
+% 2: original files (.mol, .cdx, etc.)
+% 3: options for obabel
+\newcommand\chemobabel[1][scale=1]{%
+  \def\chemobabel at next{\includegraphics[#1]}%
+  \begingroup
+    \let\do\@makeother \dospecials \catcode`\{=1 \catcode`\}=2
+    \@chemobabel
+}
+\newcommand\@chemobabel[2]{%
+  \endgroup
+  \IfFileExists{"#1"}{%
+    % the file exists: start processing
+    % (``#1'' can contain spaces, so ``"'' required)
+    \chemob at bel@exec{%
+      \chemob at bel@obabelcmd{#1}{#2} 2>\chemob at belGetName.log
+      && \chemob at bel@svgtoimgcmd{\chemob at belGetName}{\chemob at belimgExt} 2>>\chemob at belGetName.log
+      || rm -f \chemob at belGetName.\chemob at belimgExt}%
+    \chemob at bel@exec{\chemob at bel@cropcmd{\chemob at belGetName}}%
+    \chemob at bel@common at maybeimg{\chemobabel at next}{\chemob at belGetName}{file ``#1''}%
+  }{%
+    % the file does not exist: show a std error
+    \PackageError{chemobabel}{File ``#1'' not found}{}%
+    \fbox{\begin{minipage}{0.9\textwidth}
+      Error in chemobabel: the file ``#1'' does not exist.
+    \end{minipage}}%
+  }%
+  \addtocounter{chemob at belCounter}{1}% select next name
+}
+%% ----- Definition of \chemobabel end -----
+
+%% ----- Check if no chemical structures -----
+\def\chemob at bel@ifnochem{%
+  \let\chemob at bel@nochem\relax
+  \ifnum\value{smilesob at belCounter}=\@ne
+  \ifnum\value{chemob at belCounter}=\@ne
+    \let\chemob at bel@nochem\@empty
+  \fi\fi
+  \ifx\chemob at bel@nochem\@empty
+    \expandafter\@firstoftwo
+  \else
+    \expandafter\@secondoftwo
+  \fi
+}
+
+%% ----- Declaration of options -----
+% load macros for extracting \chemobabel and \smilesobabel commands
+\let\chemob at bel@extract\relax
+\DeclareOption{extract}{\let\chemob at bel@extract\@empty}
+% define the image extension
+\DeclareOption{pdf}{%
+  \def\chemob at belimgExt{pdf}%
+  \let\chemob at bel@cropcmd\chemob at bel@pdfcropcmd
+  \def\chemob at bel@maybecrop{-crop}}
+\DeclareOption{eps}{%
+  \def\chemob at belimgExt{eps}%
+  \let\chemob at bel@cropcmd\chemob at bel@epscropcmd
+  \def\chemob at bel@maybecrop{.eps}}
+% determine image conversion command
+\DeclareOption{inkscape-old}%
+  {\let\chemob at bel@svgtoimgcmd\chemob at bel@inkscapeoldcmd}
+\DeclareOption{inkscape}%
+  {\let\chemob at bel@svgtoimgcmd\chemob at bel@inkscapecmd}
+\DeclareOption{librsvg}%
+  {\let\chemob at bel@svgtoimgcmd\chemob at bel@librsvgcmd}
+% crop image or not
+\DeclareOption{nocrop}{%
+  \let\chemob at bel@cropcmd\@gobble
+  \let\chemob at bel@maybecrop\@empty}
+% default settings
+\ExecuteOptions{pdf,inkscape}
+\ProcessOptions\relax
+%% ----- Declaration of options end -----
+
+%% ----- Exit this package now, if [extract] is not specified -----
+\ifx\chemob at bel@extract\relax \endinput \fi
+
+%% Extracting all codes of Open Babel figures
+%% Thanks: http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=1411
+
+\PackageWarningNoLine{chemobabel}{%
+  You are using [extract] option.\MessageBreak
+  No chemical structures will be printed}
+
+%% ----- Define intermediate output file and load packages -----
+\newwrite\ChemFigFile
+\immediate\openout\ChemFigFile=ChemFigFile.tex\relax
+\immediate\write\ChemFigFile{\string\documentclass{article}}
+\immediate\write\ChemFigFile{\string\usepackage{graphicx}}
+\immediate\write\ChemFigFile{\string\usepackage{chemobabel}}
+
+%% ----- Read and write -----
+\immediate\write\ChemFigFile{\string\begin{document}}
+\AtEndDocument{%
+  \immediate\write\ChemFigFile{\string\end{document}}%
+  \immediate\closeout\ChemFigFile
+  \chemob at bel@ifnochem{}{%
+    \PackageWarningNoLine{chemobabel}{%
+      Some chemical structures are extracted.\MessageBreak
+      Run 'pdflatex -shell-escape ChemFigFile.tex'}}%
+}
+\renewcommand\smilesobabel{%
+  \begingroup
+  \let\do\@makeother
+  \dospecials
+  \catcode`\{=1
+  \catcode`\}=2
+  \@@smilesobabel
+}
+\newcommand\@@smilesobabel[3][scale=1]{%
+  \endgroup
+  \immediate\write\ChemFigFile{%
+    \string\smilesobabel[#1]{#2}{#3}%
+    \string\newpage}%
+  [\smilesob at belGetName.\chemob at belimgExt]%
+  \addtocounter{smilesob at belCounter}{1}}
+\renewcommand\chemobabel{%
+  \begingroup
+  \let\do\@makeother
+  \dospecials
+  \catcode`\{=1
+  \catcode`\}=2
+  \@@chemobabel
+}
+\newcommand\@@chemobabel[3][scale=1]{%
+  \endgroup
+  \immediate\write\ChemFigFile{%
+    \string\chemobabel[#1]{#2}{#3}%
+    \string\newpage}%
+  [\chemob at belGetName.\chemob at belimgExt]%
+  \addtocounter{chemob at belCounter}{1}}
+%% ----- Read and write end -----
+
+\endinput
+
+%%
+%% End of file `chemobabel.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/chemobabel/chemobabel.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2022-09-19 20:26:49 UTC (rev 64443)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2022-09-19 20:27:58 UTC (rev 64444)
@@ -174,7 +174,7 @@
     chbibref cheatsheet checkcites checkend checklistings chem-journal
     chemarrow chembst chemcompounds chemcono chemexec
     chemfig chemformula chemgreek chemmacros
-    chemnum chemplants chemschemex chemsec chemstyle cherokee
+    chemnum chemobabel chemplants chemschemex chemsec chemstyle cherokee
     chess chess-problem-diagrams chessboard chessfss chet chextras
     chhaya chicago chicagoa chicago-annote chickenize
     chifoot childdoc chinese-jfm chinesechess chivo

Added: trunk/Master/tlpkg/tlpsrc/chemobabel.tlpsrc
===================================================================
Modified: trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2022-09-19 20:26:49 UTC (rev 64443)
+++ trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2022-09-19 20:27:58 UTC (rev 64444)
@@ -48,6 +48,7 @@
 depend chemgreek
 depend chemmacros
 depend chemnum
+depend chemobabel
 depend chemplants
 depend chemschemex
 depend chemsec



More information about the tex-live-commits mailing list.