texlive[64778] Master/texmf-dist: chemobabel (22oct22)

commits+karl at tug.org commits+karl at tug.org
Sat Oct 22 22:19:07 CEST 2022


Revision: 64778
          http://tug.org/svn/texlive?view=revision&revision=64778
Author:   karl
Date:     2022-10-22 22:19:07 +0200 (Sat, 22 Oct 2022)
Log Message:
-----------
chemobabel (22oct22)

Modified Paths:
--------------
    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/images-for-doc.tar.gz
    trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.dtx
    trunk/Master/texmf-dist/tex/latex/chemobabel/chemobabel.sty

Modified: trunk/Master/texmf-dist/doc/latex/chemobabel/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/README.md	2022-10-22 00:16:13 UTC (rev 64777)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/README.md	2022-10-22 20:19:07 UTC (rev 64778)
@@ -7,7 +7,7 @@
 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.
+into your documents easily with the help of Open Babel.
 
 Various chemical formats are allowed for input,
 for example, `.cdx`, `.mol` and `.smi`.
@@ -14,7 +14,7 @@
 
 ## Package Contents
 
- - chemobabel.sty: Package itself
+ - chemobabel.sty: Package itself; provides `\chemobabel` and `\smilesobabel`
  - chemobabel-{en,ja}.pdf: Basic usage (source: chemobabel.dtx)
  - example-en.{tex,pdf}: Examples in English
  - example-ja.{tex,pdf}: Examples in Japanese
@@ -21,6 +21,15 @@
 
 Sample ChemDraw files and MDL Molfiles are also included.
 
+## Requirements
+
+To use this LaTeX package, it is necessary to enable execution
+of the following external commands via `latex -shell-escape`.
+
+ - `obabel` (Open Babel)
+ - `inkscape` or `rsvg-convert` (for SVG -> PDF/EPS conversion)
+ - `pdfcrop` or `ps2eps` (optional; for cropping large margins of PDF/EPS)
+
 ## License
 
 This package is distributed under the BSD 2-Clause License.
@@ -43,7 +52,7 @@
 
 ## Release Date
 
-2022-10-09
+2022-10-22
 
 --------------------
 Hironobu YAMASHITA (aka. "Acetaminophen" or "@aminophen")

Modified: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.tex	2022-10-22 00:16:13 UTC (rev 64777)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-en.tex	2022-10-22 20:19:07 UTC (rev 64778)
@@ -37,6 +37,7 @@
 \usepackage[nofontspec,defaultsups]{newpxtext}
 \usepackage[zerostyle=c,straightquotes]{newtxtt}
 \usepackage{newpxmath}
+\usepackage{ascmac}
 \usepackage[librsvg]{chemobabel}
 \usepackage[bookmarksnumbered=true,hidelinks,%
  pdftitle={User Manual for chemobabel.sty},%
@@ -77,8 +78,9 @@
 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.
+SMILES notations, with the help of Open Babel.
+The formulas below are generated using this method.\footnote{Unless
+otherwise noted, this documentation used \Lcode{\input{obversion.txt}}}
 
 日本語版ドキュメントはchemobabel-ja.pdfを参照してください。
 
@@ -91,8 +93,8 @@
 
 \begin{figure}[ht]
   \centering
-  \chemobabel[width=90mm]{draw/ATP.cdx}{} \hspace{1cm}
-  \chemobabel*[width=35mm]{draw/Glucose.cdx}
+  \chemobabel[width=80mm]{draw/ATP.cdx}{} \hspace{1cm}
+  \chemobabel*[width=30mm]{draw/Glucose.cdx}
   \caption{ATP (Adenosine triphosphate) \& Glucose (from ChemDraw files)}
 \end{figure}
 \begin{center}\small
@@ -122,6 +124,29 @@
 If you have questions, please let me know.
 \end{figure}
 
+\begin{figure}[ht]
+\centering
+Also available on CTAN:
+\url{https://www.ctan.org/pkg/chemobabel}\par
+Distributed with \TeX\ Live and MiK\TeX.
+Below is a short description for CTAN:\par
+\begin{screen}
+This package provides a way to convert and include
+chemical structure graphics from various chemical formats,
+such as ChemDraw files, MDL molfile or SMILES notations
+using Open Babel.
+To use this \LaTeX\ package, it is necessary to enable execution
+of the following external commands via \Lcode{latex -shell-escape}.
+\begin{itemize}
+ \item \Lcode{obabel} (Open Babel)
+ \item \Lcode{inkscape} or \Lcode{rsvg-convert}
+   (for SVG -> PDF/EPS conversion)
+ \item \Lcode{pdfcrop} or \Lcode{ps2eps}
+   (optional; for cropping large margins of PDF/EPS)
+\end{itemize}
+\end{screen}
+\end{figure}
+
 \clearpage
 \setcounter{tocdepth}{3}
 \tableofcontents
@@ -164,7 +189,7 @@
 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.
+and \href{https://inkscape.org/en/}{Inkscape} for converting SVG to PDF/EPS.
 Both programs are open source and cross-platform, and being actively maintained.
 
 \paragraph{About Open Babel}
@@ -208,8 +233,10 @@
 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,
+computer, and export PATH to the required command-line programs,
 \Lcode{obabel} and \Lcode{inkscape} (or \Lcode{rsvg-convert}).
+The package also uses \Lcode{pdfcrop} (or \Lcode{ps2eps}) to
+crop large margins, but it is included in \TeX\ Live.
 You can confirm by executing following commands:
 In UNIX operating system:
 \begin{verbatim}
@@ -282,7 +309,7 @@
 \begin{itemize}
  \item The optional parameter \Lmeta{options} in the box brackets
    is passed to \verb|\includegraphics|.
-   If omitted, the default ``scale=1' is assumed.
+   If omitted, the default ``clip,scale=1' is assumed.
  \item The first mandatory parameter \Lmeta{filename} is the file name
    which contains chemical structural formula.
  \item The second mandatory parameter \Lmeta{obabel options}
@@ -370,8 +397,11 @@
 \begin{verbatim}
 \usepackage[eps]{chemobabel}
 \end{verbatim}
-The option \verb|eps| switches the image format (that is, output format
-from Inkscape) into EPS (since \Lver{v0.9d [2016/02/28]}).
+The option \verb|eps| switches the image format
+(that is, output format from Inkscape) into EPS (since
+\Lver{v0.9d [2016/02/28]}).\footnote{Moreover, since
+\Lver{v0.9l [2022/10/22]}, the package automatically switches to
+EPS mode when using dvips.}
 
 You can also change the image conversion program from ``Inkscape'' to
 ``rsvg-convert'' (since \Lver{v0.9e [2016/03/07]}).
@@ -422,7 +452,7 @@
 With \verb|extract| option, all \Lpack{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
+You will get ``ChemFigFile.tex'' in the current directory, a minimal
 \LaTeX\ source file which includes all \verb|\chemobabel| and
 \verb|\smilesobabel| commands.
 You can simply typeset it by
@@ -440,6 +470,15 @@
 which includes figures properly.
 This method will also save you a lot of time for typesetting.
 
+\paragraph{Note on the option \Lcode{-output-directory}}
+
+When using the option \Lcode{-output-directory} of \TeX,
+the extracted code ``ChemFigFile.tex'' goes there
+but the subdirectory \verb|chemobabelimgdir| and
+generated images stay in the current working directory.
+To process the resulting files correctly, it would be
+necessary to move files properly.
+
 \clearpage
 
 \section{Advanced Usage}
@@ -730,6 +769,8 @@
 2022/10/09 v0.9k & Add \verb|\chemobabel*| and \verb|\smilesobabel*|. \\
                  & Warn if a user need to run another \LaTeX. \\
                  & Improve \verb|[extract]| to take over user-given package options. \\
+2022/10/22 v0.9l & Default to EPS mode if PDF inclusion is unsupported by the driver. \\
+                 & Default \verb|clip| for image inclusion. \\
 \end{tabular}
 \end{table}
 

Modified: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.tex	2022-10-22 00:16:13 UTC (rev 64777)
+++ trunk/Master/texmf-dist/doc/latex/chemobabel/chemobabel-ja.tex	2022-10-22 20:19:07 UTC (rev 64778)
@@ -37,6 +37,7 @@
 \usepackage[nofontspec,defaultsups]{newpxtext}
 \usepackage[zerostyle=c,straightquotes]{newtxtt}
 \usepackage{newpxmath}
+\usepackage{ascmac}
 \usepackage[librsvg]{chemobabel}
 \usepackage[bookmarksnumbered=true,hidelinks,%
  pdftitle={User Manual for chemobabel.sty},%
@@ -74,10 +75,11 @@
 \maketitle
 
 この文書では,\textbf{化学構造式を生成}して\LaTeX の文書中に挿入するための
-パッケージである\Lpack{chemobabel.sty}と同梱リソースの使い方を説明します。
+パッケージである\Lpack{chemobabel.sty}の使い方を説明します。
 構造式はOpen Babelの機能を利用することにより,MDL Molfile, ChemDrawファイル,
 さらにはSMILES表記法を含む\textbf{さまざまな化学データ形式から生成}できます。
-以下の構造式はこの方法によって出力されたものです。
+以下の構造式はこの方法によって出力されたものです\footnote{特に断りがない
+限り,この文書で使用した版は\Lcode{\input{obversion.txt}}です。}。
 
 For English documentation, please refer to chemobabel-en.pdf.
 
@@ -90,8 +92,8 @@
 
 \begin{figure}[ht]
   \centering
-  \chemobabel[width=90mm]{draw/ATP.cdx}{} \hspace{1cm}
-  \chemobabel*[width=35mm]{draw/Glucose.cdx}
+  \chemobabel[width=80mm]{draw/ATP.cdx}{} \hspace{1cm}
+  \chemobabel*[width=30mm]{draw/Glucose.cdx}
   \caption{ATP (Adenosine triphosphate) \& Glucose (from ChemDraw files)}
 \end{figure}
 \begin{center}\small
@@ -121,6 +123,29 @@
 問い合わせや改善案などはGitHubのIssuesへお願いします。
 \end{figure}
 
+\begin{figure}[ht]
+\centering
+CTANからも入手可能です →
+\url{https://www.ctan.org/pkg/chemobabel}\par
+\TeX\ LiveやMiK\TeX でも配布されています。
+以下はCTANの短い紹介文です。\par
+\begin{screen}
+This package provides a way to convert and include
+chemical structure graphics from various chemical formats,
+such as ChemDraw files, MDL molfile or SMILES notations
+using Open Babel.
+To use this \LaTeX\ package, it is necessary to enable execution
+of the following external commands via \Lcode{latex -shell-escape}.
+\begin{itemize}
+ \item \Lcode{obabel} (Open Babel)
+ \item \Lcode{inkscape} or \Lcode{rsvg-convert}
+   (for SVG -> PDF/EPS conversion)
+ \item \Lcode{pdfcrop} or \Lcode{ps2eps}
+   (optional; for cropping large margins of PDF/EPS)
+\end{itemize}
+\end{screen}
+\end{figure}
+
 \clearpage
 \setcounter{tocdepth}{3}
 \tableofcontents
@@ -159,7 +184,8 @@
 挿入する必要がある化学者に新たな選択肢を提供することでしょう。
 この方法では,\href{http://openbabel.org/}{Open Babel}によって
 SVG形式の構造式画像を生成し,
-さらに\href{https://inkscape.org/ja/}{Inkscape}によってSVGからPDFに変換します。
+さらに\href{https://inkscape.org/ja/}{Inkscape}によってSVGから
+PDFまたはEPS形式の画像に変換します。
 どちらのプログラムもオープンソースかつクロスプラットフォームであり,
 盛んに開発が行われています。
 
@@ -200,8 +226,11 @@
 初めにコンピュータに\href{http://openbabel.org/}{Open Babel}と
 \href{https://inkscape.org/ja/}{Inkscape}(または
 \href{http://librsvg.sourceforge.net/download/}{librsvg})をインストールし,
-コマンドライン実行ファイルである
-\Lcode{obabel}と\Lcode{inkscape}(または\Lcode{rsvg-convert})にPATHを通します。
+必要なコマンドラインプログラムである
+\Lcode{obabel}と\Lcode{inkscape}(または\Lcode{rsvg-convert})に
+PATHを通します。
+なお,生成画像の大きな余白を切り取るために\Lcode{pdfcrop}(または
+\Lcode{ps2eps})も利用しますが,これは\TeX\ Liveに収録されています。
 正しくPATHが通っているかどうかは以下のコマンドによって確認できます:
 UNIX系の場合:
 \begin{verbatim}
@@ -260,8 +289,9 @@
 \begin{verbatim}
 $ platex -shell-escape test.tex
 \end{verbatim}
-すると \verb|chemobabelimgdir| 以下に「chemobabelimg[NUM].pdf」という
-ファイルが生成します。得られたtest.dviに対して
+するとサブディレクトリ \verb|chemobabelimgdir| 以下に
+「chemobabelimg[NUM].pdf」というファイルが生成します。
+得られたtest.dviに対して
 \begin{verbatim}
 $ dvipdfmx test.dvi
 \end{verbatim}
@@ -282,7 +312,7 @@
 \verb|\chemobabel| は1つのオプション引数と2つの必須引数をとります。
 \begin{itemize}
  \item 角括弧内のオプション引数は \verb|\includegraphics| に渡されます。
-   省略された場合は \verb|scale=1| とみなされます。
+   省略された場合は \verb|clip,scale=1| とみなされます。
  \item 必須引数の1つめには化学構造式が描かれたファイル名を与えます。
  \item 必須引数の2つめには \verb|obabel| に送るオプション
    (例は第\ref{depict}節を参照)を指定します。
@@ -369,7 +399,9 @@
 \usepackage[eps]{chemobabel}
 \end{verbatim}
 というように \verb|eps| オプションを指定すれば,内部でInkscapeから出力される
-画像形式をPDFではなくEPSに変更します(\Lver{v0.9d [2016/02/28]}以降)。
+画像形式をPDFではなくEPSに変更します(\Lver{v0.9d [2016/02/28]}以降)
+\footnote{\Lver{v0.9l [2022/10/22]}以降ではさらに,dvipsの場合に
+自動的にEPSに切り替えるようにしました。}。
 
 また,画像変換プログラムを Inkscape から rsvg-convert に変更することもできます
 (\Lver{v0.9e [2016/03/07]}以降)。
@@ -418,7 +450,7 @@
 \verb|extract| オプションを付けると,\Lpack{chemobabel}パッケージは
 単に元の\LaTeX ソースから \verb|\chemobabel| と \verb|\smilesobabel| コマンド
 だけを抽出するはたらきをします。
-その結果,同じディレクトリに「ChemFigFile.tex」というファイルが生成します。
+その結果,作業ディレクトリに「ChemFigFile.tex」というファイルが生成します。
 これは元のソースに書かれていた \verb|\chemobabel| と \verb|\smilesobabel| コマンド
 をすべて含む最小の \LaTeX ソースで,これは直接pdflatexでタイプセットできます。
 \begin{verbatim}
@@ -437,6 +469,15 @@
 と実行すれば,適切に図を取り込んだ望みどおりの「test.pdf」が得られます。
 この方法を用いれば,タイプセットに要する時間を大幅に短縮することも期待できます。
 
+\paragraph{注意:\Lcode{-output-directory}オプション}
+
+\TeX の\Lcode{-output-directory}オプションを使用すると,
+抽出ファイル「ChemFigFile.tex」はその指定先に書き出されますが,
+サブディレクトリ \verb|chemobabelimgdir| と生成画像は
+現在のディレクトリとなります。
+従って,抽出ファイルと元のファイルを正しく処理するためには
+ファイルを適切に配置する必要があります。
+
 \clearpage
 
 \section{高度な使い方}
@@ -729,6 +770,8 @@
 2022/10/09 v0.9k & Add \verb|\chemobabel*| and \verb|\smilesobabel*|. \\
                  & Warn if a user need to run another \LaTeX. \\
                  & Improve \verb|[extract]| to take over user-given package options. \\
+2022/10/22 v0.9l & Default to EPS mode if PDF inclusion is unsupported by the driver. \\
+                 & Default \verb|clip| for image inclusion. \\
 \end{tabular}
 \end{table}
 

Modified: trunk/Master/texmf-dist/doc/latex/chemobabel/images-for-doc.tar.gz
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.dtx	2022-10-22 00:16:13 UTC (rev 64777)
+++ trunk/Master/texmf-dist/source/latex/chemobabel/chemobabel.dtx	2022-10-22 20:19:07 UTC (rev 64778)
@@ -17,6 +17,7 @@
 \usepackage[nofontspec,defaultsups]{newpxtext}
 \usepackage[zerostyle=c,straightquotes]{newtxtt}
 \usepackage{newpxmath}
+\usepackage{ascmac}
 \usepackage[librsvg]{chemobabel}
 \usepackage[bookmarksnumbered=true,hidelinks,%
  pdftitle={User Manual for chemobabel.sty},%
@@ -64,17 +65,19 @@
 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.
+SMILES notations, with the help of Open Babel.
+The formulas below are generated using this method.\footnote{Unless
+otherwise noted, this documentation used \Lcode{\input{obversion.txt}}}
 
 日本語版ドキュメントはchemobabel-ja.pdfを参照してください。
 %</en>
 %<*ja>
 この文書では,\textbf{化学構造式を生成}して\LaTeX の文書中に挿入するための
-パッケージである\Lpack{chemobabel.sty}と同梱リソースの使い方を説明します。
+パッケージである\Lpack{chemobabel.sty}の使い方を説明します。
 構造式はOpen Babelの機能を利用することにより,MDL Molfile, ChemDrawファイル,
 さらにはSMILES表記法を含む\textbf{さまざまな化学データ形式から生成}できます。
-以下の構造式はこの方法によって出力されたものです。
+以下の構造式はこの方法によって出力されたものです\footnote{特に断りがない
+限り,この文書で使用した版は\Lcode{\input{obversion.txt}}です。}。
 
 For English documentation, please refer to chemobabel-en.pdf.
 %</ja>
@@ -88,8 +91,8 @@
 
 \begin{figure}[ht]
   \centering
-  \chemobabel[width=90mm]{draw/ATP.cdx}{} \hspace{1cm}
-  \chemobabel*[width=35mm]{draw/Glucose.cdx}
+  \chemobabel[width=80mm]{draw/ATP.cdx}{} \hspace{1cm}
+  \chemobabel*[width=30mm]{draw/Glucose.cdx}
   \caption{ATP (Adenosine triphosphate) \& Glucose (from ChemDraw files)}
 \end{figure}
 \begin{center}\small
@@ -121,6 +124,32 @@
 %<ja>問い合わせや改善案などはGitHubのIssuesへお願いします。
 \end{figure}
 
+\begin{figure}[ht]
+\centering
+%<en>Also available on CTAN:
+%<ja>CTANからも入手可能です →
+\url{https://www.ctan.org/pkg/chemobabel}\par
+%<en>Distributed with \TeX\ Live and MiK\TeX.
+%<en>Below is a short description for CTAN:\par
+%<ja>\TeX\ LiveやMiK\TeX でも配布されています。
+%<ja>以下はCTANの短い紹介文です。\par
+\begin{screen}
+This package provides a way to convert and include
+chemical structure graphics from various chemical formats,
+such as ChemDraw files, MDL molfile or SMILES notations
+using Open Babel.
+To use this \LaTeX\ package, it is necessary to enable execution
+of the following external commands via \Lcode{latex -shell-escape}.
+\begin{itemize}
+ \item \Lcode{obabel} (Open Babel)
+ \item \Lcode{inkscape} or \Lcode{rsvg-convert}
+   (for SVG -> PDF/EPS conversion)
+ \item \Lcode{pdfcrop} or \Lcode{ps2eps}
+   (optional; for cropping large margins of PDF/EPS)
+\end{itemize}
+\end{screen}
+\end{figure}
+
 \clearpage
 \setcounter{tocdepth}{3}
 \tableofcontents
@@ -206,7 +235,7 @@
 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.
+and \href{https://inkscape.org/en/}{Inkscape} for converting SVG to PDF/EPS.
 Both programs are open source and cross-platform, and being actively maintained.
 %</en>
 %<*ja>
@@ -214,7 +243,8 @@
 挿入する必要がある化学者に新たな選択肢を提供することでしょう。
 この方法では,\href{http://openbabel.org/}{Open Babel}によって
 SVG形式の構造式画像を生成し,
-さらに\href{https://inkscape.org/ja/}{Inkscape}によってSVGからPDFに変換します。
+さらに\href{https://inkscape.org/ja/}{Inkscape}によってSVGから
+PDFまたはEPS形式の画像に変換します。
 どちらのプログラムもオープンソースかつクロスプラットフォームであり,
 盛んに開発が行われています。
 %</ja>
@@ -305,8 +335,10 @@
 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,
+computer, and export PATH to the required command-line programs,
 \Lcode{obabel} and \Lcode{inkscape} (or \Lcode{rsvg-convert}).
+The package also uses \Lcode{pdfcrop} (or \Lcode{ps2eps}) to
+crop large margins, but it is included in \TeX\ Live.
 You can confirm by executing following commands:
 %</en>
 %<*ja>
@@ -313,8 +345,11 @@
 初めにコンピュータに\href{http://openbabel.org/}{Open Babel}と
 \href{https://inkscape.org/ja/}{Inkscape}(または
 \href{http://librsvg.sourceforge.net/download/}{librsvg})をインストールし,
-コマンドライン実行ファイルである
-\Lcode{obabel}と\Lcode{inkscape}(または\Lcode{rsvg-convert})にPATHを通します。
+必要なコマンドラインプログラムである
+\Lcode{obabel}と\Lcode{inkscape}(または\Lcode{rsvg-convert})に
+PATHを通します。
+なお,生成画像の大きな余白を切り取るために\Lcode{pdfcrop}(または
+\Lcode{ps2eps})も利用しますが,これは\TeX\ Liveに収録されています。
 正しくPATHが通っているかどうかは以下のコマンドによって確認できます:
 %</ja>
 %<en>In UNIX operating system:
@@ -429,8 +464,9 @@
 \begin{verbatim}
 $ platex -shell-escape test.tex
 \end{verbatim}
-すると \verb|chemobabelimgdir| 以下に「chemobabelimg[NUM].pdf」という
-ファイルが生成します。得られたtest.dviに対して
+するとサブディレクトリ \verb|chemobabelimgdir| 以下に
+「chemobabelimg[NUM].pdf」というファイルが生成します。
+得られたtest.dviに対して
 \begin{verbatim}
 $ dvipdfmx test.dvi
 \end{verbatim}
@@ -455,7 +491,7 @@
 \begin{itemize}
  \item The optional parameter \Lmeta{options} in the box brackets
    is passed to \verb|\includegraphics|.
-   If omitted, the default ``scale=1' is assumed.
+   If omitted, the default ``clip,scale=1' is assumed.
  \item The first mandatory parameter \Lmeta{filename} is the file name
    which contains chemical structural formula.
  \item The second mandatory parameter \Lmeta{obabel options}
@@ -470,7 +506,7 @@
 \verb|\chemobabel| は1つのオプション引数と2つの必須引数をとります。
 \begin{itemize}
  \item 角括弧内のオプション引数は \verb|\includegraphics| に渡されます。
-   省略された場合は \verb|scale=1| とみなされます。
+   省略された場合は \verb|clip,scale=1| とみなされます。
  \item 必須引数の1つめには化学構造式が描かれたファイル名を与えます。
  \item 必須引数の2つめには \verb|obabel| に送るオプション
    (例は第\ref{depict}節を参照)を指定します。
@@ -627,8 +663,11 @@
 \usepackage[eps]{chemobabel}
 \end{verbatim}
 %<*en>
-The option \verb|eps| switches the image format (that is, output format
-from Inkscape) into EPS (since \Lver{v0.9d [2016/02/28]}).
+The option \verb|eps| switches the image format
+(that is, output format from Inkscape) into EPS (since
+\Lver{v0.9d [2016/02/28]}).\footnote{Moreover, since
+\Lver{v0.9l [2022/10/22]}, the package automatically switches to
+EPS mode when using dvips.}
 
 You can also change the image conversion program from ``Inkscape'' to
 ``rsvg-convert'' (since \Lver{v0.9e [2016/03/07]}).
@@ -637,7 +676,9 @@
 %</en>
 %<*ja>
 というように \verb|eps| オプションを指定すれば,内部でInkscapeから出力される
-画像形式をPDFではなくEPSに変更します(\Lver{v0.9d [2016/02/28]}以降)。
+画像形式をPDFではなくEPSに変更します(\Lver{v0.9d [2016/02/28]}以降)
+\footnote{\Lver{v0.9l [2022/10/22]}以降ではさらに,dvipsの場合に
+自動的にEPSに切り替えるようにしました。}。
 
 また,画像変換プログラムを Inkscape から rsvg-convert に変更することもできます
 (\Lver{v0.9e [2016/03/07]}以降)。
@@ -723,7 +764,7 @@
 With \verb|extract| option, all \Lpack{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
+You will get ``ChemFigFile.tex'' in the current directory, a minimal
 \LaTeX\ source file which includes all \verb|\chemobabel| and
 \verb|\smilesobabel| commands.
 You can simply typeset it by
@@ -737,7 +778,7 @@
 \verb|extract| オプションを付けると,\Lpack{chemobabel}パッケージは
 単に元の\LaTeX ソースから \verb|\chemobabel| と \verb|\smilesobabel| コマンド
 だけを抽出するはたらきをします。
-その結果,同じディレクトリに「ChemFigFile.tex」というファイルが生成します。
+その結果,作業ディレクトリに「ChemFigFile.tex」というファイルが生成します。
 これは元のソースに書かれていた \verb|\chemobabel| と \verb|\smilesobabel| コマンド
 をすべて含む最小の \LaTeX ソースで,これは直接pdflatexでタイプセットできます。
 %</ja>
@@ -773,6 +814,27 @@
 この方法を用いれば,タイプセットに要する時間を大幅に短縮することも期待できます。
 %</ja>
 
+%<*en>
+\paragraph{Note on the option \Lcode{-output-directory}}
+
+When using the option \Lcode{-output-directory} of \TeX,
+the extracted code ``ChemFigFile.tex'' goes there
+but the subdirectory \verb|chemobabelimgdir| and
+generated images stay in the current working directory.
+To process the resulting files correctly, it would be
+necessary to move files properly.
+%</en>
+%<*ja>
+\paragraph{注意:\Lcode{-output-directory}オプション}
+
+\TeX の\Lcode{-output-directory}オプションを使用すると,
+抽出ファイル「ChemFigFile.tex」はその指定先に書き出されますが,
+サブディレクトリ \verb|chemobabelimgdir| と生成画像は
+現在のディレクトリとなります。
+従って,抽出ファイルと元のファイルを正しく処理するためには
+ファイルを適切に配置する必要があります。
+%</ja>
+
 \clearpage
 
 %<*en>
@@ -1198,6 +1260,8 @@
 2022/10/09 v0.9k & Add \verb|\chemobabel*| and \verb|\smilesobabel*|. \\
                  & Warn if a user need to run another \LaTeX. \\
                  & Improve \verb|[extract]| to take over user-given package options. \\
+2022/10/22 v0.9l & Default to EPS mode if PDF inclusion is unsupported by the driver. \\
+                 & Default \verb|clip| for image inclusion. \\
 \end{tabular}
 \end{table}
 

Modified: trunk/Master/texmf-dist/tex/latex/chemobabel/chemobabel.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/chemobabel/chemobabel.sty	2022-10-22 00:16:13 UTC (rev 64777)
+++ trunk/Master/texmf-dist/tex/latex/chemobabel/chemobabel.sty	2022-10-22 20:19:07 UTC (rev 64778)
@@ -17,8 +17,11 @@
 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{chemobabel}
-  [2022/10/09 v0.9k Chemical structures with Open Babel]
+  [2022/10/22 v0.9l Chemical structures with Open Babel]
 
+\def\chemob at bel@error{\PackageError{chemobabel}}
+\def\chemob at bel@warn{\PackageWarningNoLine{chemobabel}}
+
 %% Start of package main code
 %% Thanks: http://imada.sdu.dk/~jlandersen/latex/graphvizObabel.sty
 
@@ -25,6 +28,18 @@
 \RequirePackage{verbatim}
 \RequirePackage{graphicx}
 
+%% ----- Check graphics/x driver -----
+% prefer .pdf but fallback to .eps if necessary
+% --- currently known drivers all support .eps
+\@ifundefined{Gin at rule@.pdf}{\@ifundefined{Gin at rule@.eps}{%
+  \chemob at bel@warn{Unsupported situation? cannot happen}}{}%
+  % EPS: dvips.def
+  \def\chemob at belimgExt@default{eps}%
+}{%
+  % PDF>EPS: dvipdfmx.def, dvisvgm.def, luatex.def, pdftex.def, xetex.def
+  \def\chemob at belimgExt@default{pdf}%
+}
+
 %% ----- Check status -----
 \chardef\chemob at bel@status\z@
 
@@ -52,7 +67,7 @@
 {\escapechar=-1 \xdef\chemob at bel@outname{\string\ChemFigFile}}
 \ifx\chemob at bel@jobname\chemob at bel@outname
   \ifnum\chemob at bel@shellescape=\@ne\else
-    \PackageError{chemobabel}{%
+    \chemob at bel@error{%
       Processing \chemob at bel@outname.tex needs -shell-escape.\MessageBreak
       Run 'pdflatex -shell-escape \chemob at bel@outname.tex'}\@ehc
   \fi
@@ -85,7 +100,7 @@
   \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}%
+    \chemob at bel@warn{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
@@ -128,13 +143,13 @@
 % 3: options for obabel
 \newcommand\smilesobabel{\@ifstar{\smilesobabel at i}{\smilesobabel at ii}}
 \newcommand\smilesobabel at i[1][scale=1]{%
-  \def\smilesobabel at next{\includegraphics[#1]}%
+  \def\smilesobabel at next{\includegraphics[clip,#1]}%
   \begingroup
     \let\do\@makeother \dospecials \catcode`\{=1 \catcode`\}=2
     \@smilesobabel at i
 }
 \newcommand\smilesobabel at ii[1][scale=1]{%
-  \def\smilesobabel at next{\includegraphics[#1]}%
+  \def\smilesobabel at next{\includegraphics[clip,#1]}%
   \begingroup
     \let\do\@makeother \dospecials \catcode`\{=1 \catcode`\}=2
     \@smilesobabel at ii
@@ -169,13 +184,13 @@
 % 3: options for obabel
 \newcommand\chemobabel{\@ifstar{\chemobabel at i}{\chemobabel at ii}}
 \newcommand\chemobabel at i[1][scale=1]{%
-  \def\chemobabel at next{\includegraphics[#1]}%
+  \def\chemobabel at next{\includegraphics[clip,#1]}%
   \begingroup
     \let\do\@makeother \dospecials \catcode`\{=1 \catcode`\}=2
     \@chemobabel at i
 }
 \newcommand\chemobabel at ii[1][scale=1]{%
-  \def\chemobabel at next{\includegraphics[#1]}%
+  \def\chemobabel at next{\includegraphics[clip,#1]}%
   \begingroup
     \let\do\@makeother \dospecials \catcode`\{=1 \catcode`\}=2
     \@chemobabel at ii
@@ -200,7 +215,7 @@
     \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}\@ehc
+    \chemob at bel@error{File ``#1'' not found}\@ehc
     \fbox{\begin{minipage}{0.9\textwidth}
       Error in chemobabel: the file ``#1'' does not exist.
     \end{minipage}}%
@@ -247,7 +262,7 @@
 \let\chemob at bel@nocrop\relax
 \DeclareOption{nocrop}{\let\chemob at bel@nocrop\@empty}
 % default settings
-\ExecuteOptions{pdf,inkscape}
+\ExecuteOptions{\chemob at belimgExt@default,inkscape}
 % handle user settings - arbitrary order allowed
 \ProcessOptions*\relax
 \ifx\chemob at bel@nocrop\relax \else
@@ -279,7 +294,7 @@
 }
 \def\chemob at bel@atenddocument{%
   \ifnum\chemob at bel@status>\z@ % at least one is not an image
-      \PackageWarningNoLine{chemobabel}{%
+      \chemob at bel@warn{%
         Some processing failed.\MessageBreak
         Please rerun}%
   \else % all images
@@ -303,13 +318,13 @@
       % compare number of images with the previous shell-escape run
       \ifx\smilesob at bel@imgNum\@undefined\def\smilesob at bel@imgNum{0}\fi
       \ifnum\value{smilesob at belCounter}=\smilesob at bel@imgNum\relax\else
-        \PackageWarningNoLine{chemobabel}{%
+        \chemob at bel@warn{%
           Number of \noexpand\smilesobabel changed.\MessageBreak
           Please rerun}%
       \fi
       \ifx\chemob at bel@imgNum\@undefined\def\chemob at bel@imgNum{0}\fi
       \ifnum\value{chemob at belCounter}=\chemob at bel@imgNum\relax\else
-        \PackageWarningNoLine{chemobabel}{%
+        \chemob at bel@warn{%
           Number of \noexpand\chemobabel changed.\MessageBreak
           Please rerun}%
       \fi
@@ -331,13 +346,13 @@
 
 %% ----- Safety check before opening output file -----
 \ifx\chemob at bel@jobname\chemob at bel@outname
-  \PackageWarningNoLine{chemobabel}{%
+  \chemob at bel@warn{%
     Wow! Your file name is `\chemob at bel@outname'!\MessageBreak
     Option [extract] ignored to avoid overwriting}
   \expandafter\endinput
 \fi
 
-\PackageWarningNoLine{chemobabel}{%
+\chemob at bel@warn{%
   You are using [extract] option.\MessageBreak
   No chemical structures will be printed}
 
@@ -368,7 +383,7 @@
   \immediate\write\chemob at bel@outfile{\string\end{document}}%
   \immediate\closeout\chemob at bel@outfile
   \chemob at bel@ifnochem{}{%
-    \PackageWarningNoLine{chemobabel}{%
+    \chemob at bel@warn{%
       Some chemical structures are extracted.\MessageBreak
       Run 'pdflatex -shell-escape ChemFigFile.tex'}}%
 }



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