texlive[45120] Master/texmf-dist: bpchem (24aug17)

commits+karl at tug.org commits+karl at tug.org
Fri Aug 25 00:03:11 CEST 2017


Revision: 45120
          http://tug.org/svn/texlive?view=revision&revision=45120
Author:   karl
Date:     2017-08-25 00:03:11 +0200 (Fri, 25 Aug 2017)
Log Message:
-----------
bpchem (24aug17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/bpchem/bpchem.pdf
    trunk/Master/texmf-dist/source/latex/bpchem/bpchem.dtx
    trunk/Master/texmf-dist/tex/latex/bpchem/bpchem.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/bpchem/README.md

Added: trunk/Master/texmf-dist/doc/latex/bpchem/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/bpchem/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/bpchem/README.md	2017-08-24 22:03:11 UTC (rev 45120)
@@ -0,0 +1,23 @@
+# bpchem
+
+    bpchem -- Sup­port for type­set­ting chem­i­cal for­mu­lae, IUPAC compound names and more
+    Author:  Bjørn Pedersen
+    Email:   Bjoern.Pedersen at frm2.tum.de
+    Version: 1.1
+    License: Released under the LaTeX Project Public License 
+    See:     http://www.latex-project.org/lppl.txt
+
+This package has been written to alleviate the task of writing publications containing
+lots of chemistry. It provides methods for typesetting chemical names,
+sum formulae and isotopes. It provides the possibility to break very long names
+even over several lines.
+
+This package also provides a way to automatically enumerate your chemical
+compounds, allowing for one-level subgrouping.
+
+What this package does not provide: Methods to draw chemical compounds.
+Although there exist some packages,which where designed for this purpose (e.g.
+xymtex, PPChTex) they are quite limited once you get to complex organic, or
+metal organic compounds. I recommend using an external drawing program, possibly
+in conjunction with psfrag, in these cases.
+


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

Modified: trunk/Master/texmf-dist/source/latex/bpchem/bpchem.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/bpchem/bpchem.dtx	2017-08-24 22:02:57 UTC (rev 45119)
+++ trunk/Master/texmf-dist/source/latex/bpchem/bpchem.dtx	2017-08-24 22:03:11 UTC (rev 45120)
@@ -1,16 +1,16 @@
 % \iffalse
-%% File: bpchem.dtx Copyright (C) 2001 
+%% File: bpchem.dtx Copyright (C) 2001-2017 
 %%                 Bjoern Pedersen <Bjoern.Pedersen at ch.tum.de>
 %% This file may be distributed and used freely under 
-%% the Latex Project Public License
+%% the LaTeX Project Public License
 %%
 %% 
 %
 %<*dtx>
-          \ProvidesFile{bpchem.dtx}[2004/11/25 v1.06 Chemical input helper]
+          \ProvidesFile{bpchem.dtx}[2017/08/23 v1.1 Chemical input helper]
 %</dtx>
 %<bpchem>\NeedsTeXFormat{LaTeX2e}
-%<bpchem>\ProvidesPackage{bpchem}[2004/11/25 v1.06 Chemical input helper]
+%<bpchem>\ProvidesPackage{bpchem}[2004/08/21 v1.1 Chemical input helper]
 %<bpchem>\RequirePackage{xspace}
 %<driver>\ProvidesFile{bpchem.drv}
 % \fi
@@ -26,6 +26,11 @@
 \end{document}
 %</driver>
 %\fi
+% \changes{v1.1}{2017/08/23}{
+%  Resolved conflict with recent \LaTeX{} releases (thanks to Ulrike Fischer 
+%  and Martin Sievers)
+% }
+%
 % \changes{v1.05}{2004/11/06}{
 %  changed email
 % }
@@ -40,20 +45,20 @@
 % \date{\filedate}
 % \maketitle
 % \section{Introduction}
-%This package has been written to alleviate the task of writing
-%publications containing lots of chemistry. It provides methods for
-%typesetting chemical names, sum formulae and isotopes. It provides the
-%possibility to break very long names even over several lines.
+% This package has been written to alleviate the task of writing
+% publications containing lots of chemistry. It provides methods for
+% typesetting chemical names, sum formulae and isotopes. It provides the
+% possibility to break very long names even over several lines.
 %
-%This package also provides a way to automatically enumerate your
-%chemical compounds, allowing for one-level subgrouping.
+% This package also provides a way to automatically enumerate your
+% chemical compounds, allowing for one-level subgrouping.
 %
-%What this package does not provide: Methods to draw chemical
-%compounds. Although there exist some packages,which where designed for
-%this purpose (e.g. xymtex, PPChTex) they are quite limited once you
-%get to complex organic, or metal organic compounds. I recommend using
-%an external drawing program, possibly in conjunction with psfrag, in
-%these cases.
+% What this package does not provide: Methods to draw chemical
+% compounds. Although there exist some packages,which where designed for
+% this purpose (e.g. xymtex, PPChTex) they are quite limited once you
+% get to complex organic, or metal organic compounds. I recommend using
+% an external drawing program, possibly in conjunction with psfrag, in
+% these cases.
 %
 %\section{Package options}
 % Currently this package supports only one option:
@@ -120,10 +125,6 @@
 %Alkohol \CNlabel{al} is converted to aldehyd \CNlabel{ad}. \CNref{al}
 %can also be used otherwise, while \CNref{ad} cannot.
 %\end{minipage}
-
-
-
-
 % 
 %
 %\subsection{Using sub-labels for classes of compounds: CNlabelsub\{<label>\}\{<sublabel>\},
@@ -138,7 +139,7 @@
 %To change, use something like \begin{verbatim}
 %\renewcommand{\theBPCnoa}{\textbf{\arabic{BPCno}\alph{BPCnoa}}}
 %\end{verbatim}
-
+%
 %\begin{verbatim}
 %To demonstrate the use of sublabels, methanol \CNlabelsub{alk}{a} and
 %ethanol \CNlabelsub{alk}{b} are both natural products. The acohols \CNref{alk}
@@ -151,7 +152,7 @@
 %can synthezied bio-chemically. \CNrefsub{alk}{a} is toxic, while
 %\CNrefsub{alk}{b} is only mildly toxic.
 %\end{minipage}
-
+%
 %\subsection{Shortcuts for common idioms in chemical literature}
 %
 %
@@ -160,7 +161,6 @@
 %\item[\CNMR] \verb|\CNMR|
 %\item[\cis] \verb|\cis|
 %\item[\trans] \verb|\trans|
-
 %\item[\bpalpha] \verb|\bpalpha|
 %\item[\bpbeta] \verb|\bpbeta|
 %\item[\bpDelta] \verb|\bpdelta|
@@ -232,89 +232,76 @@
 %% two registers needed to get back to correct
 %% working position if one is longer than the other.
 %    \begin{macrocode}
-  \newlength{\BPClensub}
-  \newlength{\BPClensuper}
-  \newlength{\BPCdelta}
-%
+\newlength{\BPClensub}
+\newlength{\BPClensuper}
+\newlength{\BPCdelta}
 %    \end{macrocode}
-
 %% we are in subscript and maybe  the superscript was longer
 %    \begin{macrocode}
-  \DeclareRobustCommand{\BPCadjustsub}{%
-    \setlength\BPCdelta{\BPClensuper}\addtolength\BPCdelta{-\BPClensub}%
-    \ifdim\BPCdelta>0pt{\kern\BPCdelta}\else\relax\fi%
-    \setlength{\BPClensub}{0pt}% reset 
-    \setlength{\BPClensuper}{0pt}% reset 
-    }%
-%
+\DeclareRobustCommand{\BPCadjustsub}{%
+  \setlength\BPCdelta{\BPClensuper}\addtolength\BPCdelta{-\BPClensub}%
+  \ifdim\BPCdelta>0pt{\kern\BPCdelta}\else\relax\fi%
+  \setlength{\BPClensub}{0pt}% reset 
+  \setlength{\BPClensuper}{0pt}% reset 
+}%
 %    \end{macrocode}
 %% we are in superscript and maybe  the subscript was longer
 %    \begin{macrocode}
-  \DeclareRobustCommand{\BPCadjustsuper}{%
-    \setlength\BPCdelta{\BPClensub}\addtolength\BPCdelta{-\BPClensuper}%
-    \ifdim\BPCdelta>0pt{\kern\BPCdelta}\else\relax\fi%
-    \setlength{\BPClensub}{0pt}% reset 
-    \setlength{\BPClensuper}{0pt}% reset 
-    }%
-%
+\DeclareRobustCommand{\BPCadjustsuper}{%
+  \setlength\BPCdelta{\BPClensub}\addtolength\BPCdelta{-\BPClensuper}%
+  \ifdim\BPCdelta>0pt{\kern\BPCdelta}\else\relax\fi%
+  \setlength{\BPClensub}{0pt}% reset 
+  \setlength{\BPClensuper}{0pt}% reset 
+}%
 %    \end{macrocode}
-%
 %% make a subscript and remember length in BPClen
 %    \begin{macrocode}
-  \DeclareRobustCommand{\BPCsub}[1]{%
-    \ifmmode_{#1}\settowidth\BPClensub{_{#1}}%
-    \else\textsubscript{#1}\settowidth\BPClensub{\textsubscript{#1}}\fi%
-    \futurelet\next\lookforsuper%
-    }%
+\DeclareRobustCommand{\BPCsub}[1]{%
+  \ifmmode_{#1}\settowidth\BPClensub{_{#1}}%
+  \else\textsubscript{#1}\settowidth\BPClensub{\textsubscript{#1}}\fi%
+  \futurelet\next\lookforsuper%
+}%
 %    \end{macrocode}
-%
 %% make a superscript and remember length in BPClen
 %% raise by 0.15 em, else e.g. + collides with subscript
 %    \begin{macrocode}
-  \DeclareRobustCommand{\BPCsuper}[1]{%
-    \ifmmode^{#1}\settowidth\BPClensuper{^{#1}}%
-    \else\raisebox{0.15em}{\textsuperscript{#1}}%
-    \settowidth\BPClensuper{\textsuperscript{#1}}\fi%
-    \futurelet\next\lookforsub%
-    }%
+\DeclareRobustCommand{\BPCsuper}[1]{%
+  \ifmmode^{#1}\settowidth\BPClensuper{^{#1}}%
+  \else\raisebox{0.15em}{\textsuperscript{#1}}%
+  \settowidth\BPClensuper{\textsuperscript{#1}}\fi%
+  \futurelet\next\lookforsub%
+}%
 %    \end{macrocode}
-%
-%
 %% see if next token is BPCsuper,
 %    \begin{macrocode}
-  \DeclareRobustCommand\lookforsuper{%
-    \ifx\next\BPCsuper\let\next=\BPCsuperbs%
-    \else\let\next=\BPCadjustsub\fi\next%
-    }%
+\DeclareRobustCommand\lookforsuper{%
+  \ifx\next\BPCsuper\let\next=\BPCsuperbs%
+  \else\let\next=\BPCadjustsub\fi\next%
+}%
 %    \end{macrocode}
-%
 %% see if next token is BPCsub
 %    \begin{macrocode}
-  \DeclareRobustCommand\lookforsub{%
-    \ifx\next\BPCsub\let\next=\BPCsubbs%
-    \else\let\next=\BPCadjustsuper\fi\next%
-    }%
-%
+\DeclareRobustCommand\lookforsub{%
+  \ifx\next\BPCsub\let\next=\BPCsubbs%
+  \else\let\next=\BPCadjustsuper\fi\next%
+}%
 %    \end{macrocode}
 %%  backspace BPClen and make superscript
 %%  eats the old \verb|\^|
 %    \begin{macrocode}
-  \DeclareRobustCommand{\BPCsuperbs}[1]{\kern-\BPClensub\BPCsuper}%
-%
+\DeclareRobustCommand{\BPCsuperbs}[1]{\kern-\BPClensub\BPCsuper}%
 %    \end{macrocode}
 %% backspace and make subscript
-%% eats   the old \_
+%% eats the old \_
 %    \begin{macrocode}
-  \DeclareRobustCommand{\BPCsubbs}[1]{\kern-\BPClensuper\BPCsub}%
-%
+\DeclareRobustCommand{\BPCsubbs}[1]{\kern-\BPClensuper\BPCsub}%
 %    \end{macrocode}
-%
 %% needed to get catcodes right
 %    \begin{macrocode}
-  \DeclareRobustCommand{\DoBPChem}{}%
-  \def\DoBPChem#1{%
-    #1\endgroup%
-    }%
+\DeclareRobustCommand{\DoBPChem}{}%
+\def\DoBPChem#1{%
+  #1\endgroup%
+}%
 \DeclareRobustCommand{\BPCSetupCat}{}
 \def\BPCSetupCat{%
   %\catcode`^=\active%
@@ -321,15 +308,12 @@
   %\catcode`\_=\active%
   \BPCSetup%
 }%
-%
 \DeclareRobustCommand{\BPCSetup}{}
 \def\BPCSetup{%
-%
  \let\_=\BPCsub%
  \let\^=\BPCsuper%
 }%end BPCSetup
 %    \end{macrocode}
-%
 %% setup for chemical formula
 %    \begin{macrocode}
 \DeclareRobustCommand\BPChem{%
@@ -336,58 +320,69 @@
   \begingroup% endgroup in DoBPChem
   \BPCSetupCat%
   \DoBPChem%
-  }
+}
 %    \end{macrocode}
-%
-%
-
 %% these are taken from german.sty and allow more than one break
 %% or breaks and hyphens in a word. Very useful for chemical names, 
 %% as they tend to grow rather long. Two short versions are also defined
 % \changes{v1.05}{2004/11/06}{
-%  fixed whitespace bug in DoIUPAC
+%  fixed whitespace bug in \cs{DoIUPAC}
 % }
 %    \begin{macrocode}
 \DeclareRobustCommand{\allowhyphens}{\penalty\@M \hskip\z at skip}
 \DeclareRobustCommand{\BreakHyph}{\penalty\@M -\allowhyphens}
 \DeclareRobustCommand{\MultiBreak}%
-                {\penalty\@M\discretionary{-}{}{\kern.03em}%
-                \allowhyphens}
+  {\penalty\@M\discretionary{-}{}{\kern.03em}%
+   \allowhyphens}
 \let\MB=\MultiBreak \let\BH=\BreakHyph
 \DeclareRobustCommand{\DoIUPAC}[1]{%
-#1\endgroup}
+  #1\endgroup}
 \def\Prep{%
-\let\-=\BreakHyph%
-\let\|=\MultiBreak%
-\DoIUPAC%
+  \let\-=\BreakHyph%
+  \let\|=\MultiBreak%
+  \DoIUPAC%
 }
 \DeclareRobustCommand*{\IUPAC}{%
   \begingroup\BPCSetup\ignorespaces%
   \Prep}%
 %    \end{macrocode}
-
-% \changes{v1.03}{2002/11/01}{
-%  fixed bug in \textbackslash IUPAC, \textbackslash | is not getting translated 
-% to \textbackslash delimitier during \textbackslash write anymore
+% \changes{v1.03}{2002/11/01}{%
+%  fixed bug in \cs{IUPAC}, \texttt{\textbackslash$\vert$} is not getting 
+%  translated to \cs{delimiter} during \cs{write} anymore
 % }
-% \changes{v1.04}{2002/12/14}{also \textbackslash - was affected, fixed}
-%% Trick by  David Kastrup <David.Kastrup at t-online.de> to make
+%    \begin{macrocode}
+\expandafter\DeclareRobustCommand\expandafter\|\expandafter{\|}
+%    \end{macrocode}
+% \changes{v1.04}{2002/12/14}{also \cs{-} was affected, fixed}
+%% Trick by David Kastrup <David.Kastrup at t-online.de> to make
 %% non-fragile. Otherwise \verb+\|+ would become \verb+\delimiter"026B30D+ in
 %% e.g. the toc
+% \changes{v1.1}{2017/08/23}{%
+%   Recent \LaTeX{} releases make \cs{-} robust as 
+%   well. This results in an infinite loop.
+% }
+%% Recent \LaTeX{} releases (starting with <2017-04-15>) define \cs{-} robust. 
+%% This resulted in a infinite loop with older version of bpchem. We could use 
+%% \cs{IncludeInRelease}, but it might be easier to just use the definition 
+%% from the latest \LaTeX{} releases.
 %    \begin{macrocode}
-\expandafter\DeclareRobustCommand\expandafter\|\expandafter{\|}
-\expandafter\DeclareRobustCommand\expandafter\-\expandafter{\-}
-%    \end{macrocode}
-%%%%%%%%%%%%%%%%
+\DeclareRobustCommand{\-}{%
+  \discretionary{%
+    \char \ifnum\hyphenchar\font<\z@%
+            \defaulthyphenchar%
+          \else%
+            \hyphenchar\font%
+          \fi%
+  }{}{}%
+}%    \end{macrocode}
 %% counters for numbering of chemical substances
 %    \begin{macrocode}
 \newcounter{BPCno}
 \renewcommand{\theBPCno}{\textbf{\arabic{BPCno}}}
-
+%
 \newcounter{BPCnoa}[BPCno]
 \renewcommand{\theBPCnoa}{\textbf{\arabic{BPCno}\alph{BPCnoa}}}
 %    \end{macrocode}
-
 %% helper functions to mark first definition
 %    \begin{macrocode}
 \newcommand{\newchems at b}[2]{
@@ -394,23 +389,19 @@
 \expandafter\gdef\csname cna@#1#2\endcsname{#2}%
 }
 %    \end{macrocode}
-
 %% reference a CNlabel (useful for section titles, captions etc.)
 %    \begin{macrocode}
 \DeclareRobustCommand*{\CNref}[1]{%
-\ref{cn:#1}%
+  \ref{cn:#1}%
 }
 %    \end{macrocode}
-
 %% reference a CNlabel/sublabel
 %    \begin{macrocode}
 \DeclareRobustCommand*{\CNrefsub}[2]{%
-\ref{cn:#1#2}
+  \ref{cn:#1#2}
 %%\textbf{\csname cna@#1#2\endcsname}%
 }
 %    \end{macrocode}
-
-
 %% label a substance and insert the number
 % \changes{v1.06}{2004/11/25}{
 %  fixed whitespace bug in CNlabel
@@ -417,30 +408,28 @@
 % }
 %    \begin{macrocode}
 \DeclareRobustCommand*{\CNlabel}[1]{%
-\CNlabelnoref{#1}%
-\CNref{#1}%
+  \CNlabelnoref{#1}%
+  \CNref{#1}%
 }
 %    \end{macrocode}
-
-%%
 %    \begin{macrocode}
 \DeclareRobustCommand*{\CNlabelnoref}[1]{%
-\expandafter\ifx\csname cnd@#1\endcsname\relax%
-{\refstepcounter{BPCno}\label{cn:#1}}%
-\expandafter\gdef\csname cnd@#1\endcsname{x}%
-\fi%
+  \expandafter\ifx\csname cnd@#1\endcsname\relax%
+  {\refstepcounter{BPCno}\label{cn:#1}}%
+  \expandafter\gdef\csname cnd@#1\endcsname{x}%
+  \fi%
 }
 %    \end{macrocode}
 %    \begin{macrocode}
 \DeclareRobustCommand*{\CNlabelsub}[2]{%
-\CNlabelsubnoref{#1}{#2}%
-\CNrefsub{#1}{#2}%
+  \CNlabelsubnoref{#1}{#2}%
+  \CNrefsub{#1}{#2}%
 }
 \DeclareRobustCommand*{\CNlabelsubnoref}[2]{%
-\CNlabelnoref{#1}%
-\expandafter\ifx\csname cna@#1#2\endcsname\relax%
-{\refstepcounter{BPCnoa}\label{cn:#1#2}}%
-\expandafter\gdef\csname cna@#1#2\endcsname{x}%
+  \CNlabelnoref{#1}%
+  \expandafter\ifx\csname cna@#1#2\endcsname\relax%
+  {\refstepcounter{BPCnoa}\label{cn:#1#2}}%
+  \expandafter\gdef\csname cna@#1#2\endcsname{x}%
 %% \newchems at b{#1}{#2}%
 %%   \write\@auxout{\string\newchems at b{#1}{#2}}%
   \fi%
@@ -458,32 +447,31 @@
 %\DeclareRobustCommand{\R}{\textit{R}}
 %\DeclareRobustCommand{\S}{\textit{S}}
 %%%%%%%%%%%%%%%%%%%%%
-%
 \ifusecbgreek% code with roman greek
-\PackageInfo{bpchem}{using upright greek fonts from cbgreek}
-\input{lgrenc.def}
-\DeclareRobustCommand{\rm at greekletter}[1]{{\fontencoding{LGR}\selectfont%
-     \def\encodingdefault{LGR}#1}}%
+  \PackageInfo{bpchem}{using upright greek fonts from cbgreek}
+  \input{lgrenc.def}
+  \DeclareRobustCommand{\rm at greekletter}[1]{{\fontencoding{LGR}\selectfont%
+    \def\encodingdefault{LGR}#1}}%
 % some examples
-\DeclareRobustCommand{\bpalpha}{\rm at greekletter{a}}
-\DeclareRobustCommand{\bpbeta}{\rm at greekletter{b}}
-\DeclareRobustCommand{\bpDelta}{\rm at greekletter{D}}
-\DeclareRobustCommand{\hapto}[1]{\rm at greekletter{h}\^{#1}}
+  \DeclareRobustCommand{\bpalpha}{\rm at greekletter{a}}
+  \DeclareRobustCommand{\bpbeta}{\rm at greekletter{b}}
+  \DeclareRobustCommand{\bpDelta}{\rm at greekletter{D}}
+  \DeclareRobustCommand{\hapto}[1]{\rm at greekletter{h}\^{#1}}
 \else
 % code with standard math greek
-\PackageInfo{bpchem}{using default math greek fonts}
-\DeclareRobustCommand{\bpalpha}{\ensuremath{\alpha}\xspace}
-\DeclareRobustCommand{\bpbeta}{\ensuremath{\beta}\xspace} 
-\DeclareRobustCommand{\bpDelta}{\ensuremath{\Delta}\xspace}
-\DeclareRobustCommand{\hapto}[1]{\ensuremath{\eta^{#1}}}
-\fi
+  \PackageInfo{bpchem}{using default math greek fonts}
+  \DeclareRobustCommand{\bpalpha}{\ensuremath{\alpha}\xspace}
+  \DeclareRobustCommand{\bpbeta}{\ensuremath{\beta}\xspace} 
+  \DeclareRobustCommand{\bpDelta}{\ensuremath{\Delta}\xspace}
+  \DeclareRobustCommand{\hapto}[1]{\ensuremath{\eta^{#1}}}
+\fi%
 \let\talpha\bpalpha
 \let\tbeta\bpbeta
 %%%%%%
 \DeclareRobustCommand*{\dreh}[1]%
-{$\lbrack \alpha \rbrack _{\mathrm D}^{#1}$}
+  {$\lbrack \alpha \rbrack _{\mathrm D}^{#1}$}
 %    \end{macrocode}
 %</bpchem>
 % \PrintChanges
-% \CheckSum{365}
+% \CheckSum{372}
 % \Finale

Modified: trunk/Master/texmf-dist/tex/latex/bpchem/bpchem.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bpchem/bpchem.sty	2017-08-24 22:02:57 UTC (rev 45119)
+++ trunk/Master/texmf-dist/tex/latex/bpchem/bpchem.sty	2017-08-24 22:03:11 UTC (rev 45120)
@@ -20,21 +20,17 @@
 %% original source files, as listed above, are part of the
 %% same distribution. (The sources need not necessarily be
 %% in the same archive or directory.)
-%% File: bpchem.dtx Copyright (C) 2001
+%% File: bpchem.dtx Copyright (C) 2001-2017
 %%                 Bjoern Pedersen <Bjoern.Pedersen at ch.tum.de>
 %% This file may be distributed and used freely under
-%% the Latex Project Public License
+%% the LaTeX Project Public License
 %%
 %%
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{bpchem}[2004/11/25 v1.06 Chemical input helper]
+\ProvidesPackage{bpchem}[2004/08/21 v1.1 Chemical input helper]
 \RequirePackage{xspace}
  %\IUPAC{Tetra\|cyclo[2.2.2.1\^{1,4}]\-
 
-
-
-
-
 \newif\ifusecbgreek%
 \usecbgreekfalse%
 \DeclareOption{cbgreek}{\PackageInfo{bpchem}{cbgreek selected}\usecbgreektrue}
@@ -51,59 +47,58 @@
 %% a register to save the length to backspace
 %% two registers needed to get back to correct
 %% working position if one is longer than the other.
-  \newlength{\BPClensub}
-  \newlength{\BPClensuper}
-  \newlength{\BPCdelta}
-
+\newlength{\BPClensub}
+\newlength{\BPClensuper}
+\newlength{\BPCdelta}
 %% we are in subscript and maybe  the superscript was longer
-  \DeclareRobustCommand{\BPCadjustsub}{%
-    \setlength\BPCdelta{\BPClensuper}\addtolength\BPCdelta{-\BPClensub}%
-    \ifdim\BPCdelta>0pt{\kern\BPCdelta}\else\relax\fi%
-    \setlength{\BPClensub}{0pt}% reset
-    \setlength{\BPClensuper}{0pt}% reset
-    }%
+\DeclareRobustCommand{\BPCadjustsub}{%
+  \setlength\BPCdelta{\BPClensuper}\addtolength\BPCdelta{-\BPClensub}%
+  \ifdim\BPCdelta>0pt{\kern\BPCdelta}\else\relax\fi%
+  \setlength{\BPClensub}{0pt}% reset
+  \setlength{\BPClensuper}{0pt}% reset
+}%
 %% we are in superscript and maybe  the subscript was longer
-  \DeclareRobustCommand{\BPCadjustsuper}{%
-    \setlength\BPCdelta{\BPClensub}\addtolength\BPCdelta{-\BPClensuper}%
-    \ifdim\BPCdelta>0pt{\kern\BPCdelta}\else\relax\fi%
-    \setlength{\BPClensub}{0pt}% reset
-    \setlength{\BPClensuper}{0pt}% reset
-    }%
+\DeclareRobustCommand{\BPCadjustsuper}{%
+  \setlength\BPCdelta{\BPClensub}\addtolength\BPCdelta{-\BPClensuper}%
+  \ifdim\BPCdelta>0pt{\kern\BPCdelta}\else\relax\fi%
+  \setlength{\BPClensub}{0pt}% reset
+  \setlength{\BPClensuper}{0pt}% reset
+}%
 %% make a subscript and remember length in BPClen
-  \DeclareRobustCommand{\BPCsub}[1]{%
-    \ifmmode_{#1}\settowidth\BPClensub{_{#1}}%
-    \else\textsubscript{#1}\settowidth\BPClensub{\textsubscript{#1}}\fi%
-    \futurelet\next\lookforsuper%
-    }%
+\DeclareRobustCommand{\BPCsub}[1]{%
+  \ifmmode_{#1}\settowidth\BPClensub{_{#1}}%
+  \else\textsubscript{#1}\settowidth\BPClensub{\textsubscript{#1}}\fi%
+  \futurelet\next\lookforsuper%
+}%
 %% make a superscript and remember length in BPClen
 %% raise by 0.15 em, else e.g. + collides with subscript
-  \DeclareRobustCommand{\BPCsuper}[1]{%
-    \ifmmode^{#1}\settowidth\BPClensuper{^{#1}}%
-    \else\raisebox{0.15em}{\textsuperscript{#1}}%
-    \settowidth\BPClensuper{\textsuperscript{#1}}\fi%
-    \futurelet\next\lookforsub%
-    }%
+\DeclareRobustCommand{\BPCsuper}[1]{%
+  \ifmmode^{#1}\settowidth\BPClensuper{^{#1}}%
+  \else\raisebox{0.15em}{\textsuperscript{#1}}%
+  \settowidth\BPClensuper{\textsuperscript{#1}}\fi%
+  \futurelet\next\lookforsub%
+}%
 %% see if next token is BPCsuper,
-  \DeclareRobustCommand\lookforsuper{%
-    \ifx\next\BPCsuper\let\next=\BPCsuperbs%
-    \else\let\next=\BPCadjustsub\fi\next%
-    }%
+\DeclareRobustCommand\lookforsuper{%
+  \ifx\next\BPCsuper\let\next=\BPCsuperbs%
+  \else\let\next=\BPCadjustsub\fi\next%
+}%
 %% see if next token is BPCsub
-  \DeclareRobustCommand\lookforsub{%
-    \ifx\next\BPCsub\let\next=\BPCsubbs%
-    \else\let\next=\BPCadjustsuper\fi\next%
-    }%
+\DeclareRobustCommand\lookforsub{%
+  \ifx\next\BPCsub\let\next=\BPCsubbs%
+  \else\let\next=\BPCadjustsuper\fi\next%
+}%
 %%  backspace BPClen and make superscript
 %%  eats the old \verb|\^|
-  \DeclareRobustCommand{\BPCsuperbs}[1]{\kern-\BPClensub\BPCsuper}%
+\DeclareRobustCommand{\BPCsuperbs}[1]{\kern-\BPClensub\BPCsuper}%
 %% backspace and make subscript
-%% eats   the old \_
-  \DeclareRobustCommand{\BPCsubbs}[1]{\kern-\BPClensuper\BPCsub}%
+%% eats the old \_
+\DeclareRobustCommand{\BPCsubbs}[1]{\kern-\BPClensuper\BPCsub}%
 %% needed to get catcodes right
-  \DeclareRobustCommand{\DoBPChem}{}%
-  \def\DoBPChem#1{%
-    #1\endgroup%
-    }%
+\DeclareRobustCommand{\DoBPChem}{}%
+\def\DoBPChem#1{%
+  #1\endgroup%
+}%
 \DeclareRobustCommand{\BPCSetupCat}{}
 \def\BPCSetupCat{%
   %\catcode`^=\active%
@@ -120,8 +115,7 @@
   \begingroup% endgroup in DoBPChem
   \BPCSetupCat%
   \DoBPChem%
-  }
-
+}
 %% these are taken from german.sty and allow more than one break
 %% or breaks and hyphens in a word. Very useful for chemical names,
 %% as they tend to grow rather long. Two short versions are also defined
@@ -128,71 +122,74 @@
 \DeclareRobustCommand{\allowhyphens}{\penalty\@M \hskip\z at skip}
 \DeclareRobustCommand{\BreakHyph}{\penalty\@M -\allowhyphens}
 \DeclareRobustCommand{\MultiBreak}%
-                {\penalty\@M\discretionary{-}{}{\kern.03em}%
-                \allowhyphens}
+  {\penalty\@M\discretionary{-}{}{\kern.03em}%
+   \allowhyphens}
 \let\MB=\MultiBreak \let\BH=\BreakHyph
 \DeclareRobustCommand{\DoIUPAC}[1]{%
-#1\endgroup}
+  #1\endgroup}
 \def\Prep{%
-\let\-=\BreakHyph%
-\let\|=\MultiBreak%
-\DoIUPAC%
+  \let\-=\BreakHyph%
+  \let\|=\MultiBreak%
+  \DoIUPAC%
 }
 \DeclareRobustCommand*{\IUPAC}{%
   \begingroup\BPCSetup\ignorespaces%
   \Prep}%
-
-%% Trick by  David Kastrup <David.Kastrup at t-online.de> to make
+\expandafter\DeclareRobustCommand\expandafter\|\expandafter{\|}
+%% Trick by David Kastrup <David.Kastrup at t-online.de> to make
 %% non-fragile. Otherwise \verb+\|+ would become \verb+\delimiter"026B30D+ in
 %% e.g. the toc
-\expandafter\DeclareRobustCommand\expandafter\|\expandafter{\|}
-\expandafter\DeclareRobustCommand\expandafter\-\expandafter{\-}
-%%%%%%%%%%%%%%%%
+%% Recent \LaTeX{} releases (starting with <2017-04-15>) define \cs{-} robust.
+%% This resulted in a infinite loop with older version of bpchem. We could use
+%% \cs{IncludeInRelease}, but it might be easier to just use the definition
+%% from the latest \LaTeX{} releases.
+\DeclareRobustCommand{\-}{%
+  \discretionary{%
+    \char \ifnum\hyphenchar\font<\z@%
+            \defaulthyphenchar%
+          \else%
+            \hyphenchar\font%
+          \fi%
+  }{}{}%
+}%    \end{macrocode}
 %% counters for numbering of chemical substances
 \newcounter{BPCno}
 \renewcommand{\theBPCno}{\textbf{\arabic{BPCno}}}
-
 \newcounter{BPCnoa}[BPCno]
 \renewcommand{\theBPCnoa}{\textbf{\arabic{BPCno}\alph{BPCnoa}}}
-
 %% helper functions to mark first definition
 \newcommand{\newchems at b}[2]{
 \expandafter\gdef\csname cna@#1#2\endcsname{#2}%
 }
-
 %% reference a CNlabel (useful for section titles, captions etc.)
 \DeclareRobustCommand*{\CNref}[1]{%
-\ref{cn:#1}%
+  \ref{cn:#1}%
 }
-
 %% reference a CNlabel/sublabel
 \DeclareRobustCommand*{\CNrefsub}[2]{%
-\ref{cn:#1#2}
+  \ref{cn:#1#2}
 %%\textbf{\csname cna@#1#2\endcsname}%
 }
-
 %% label a substance and insert the number
 \DeclareRobustCommand*{\CNlabel}[1]{%
-\CNlabelnoref{#1}%
-\CNref{#1}%
+  \CNlabelnoref{#1}%
+  \CNref{#1}%
 }
-
-%%
 \DeclareRobustCommand*{\CNlabelnoref}[1]{%
-\expandafter\ifx\csname cnd@#1\endcsname\relax%
-{\refstepcounter{BPCno}\label{cn:#1}}%
-\expandafter\gdef\csname cnd@#1\endcsname{x}%
-\fi%
+  \expandafter\ifx\csname cnd@#1\endcsname\relax%
+  {\refstepcounter{BPCno}\label{cn:#1}}%
+  \expandafter\gdef\csname cnd@#1\endcsname{x}%
+  \fi%
 }
 \DeclareRobustCommand*{\CNlabelsub}[2]{%
-\CNlabelsubnoref{#1}{#2}%
-\CNrefsub{#1}{#2}%
+  \CNlabelsubnoref{#1}{#2}%
+  \CNrefsub{#1}{#2}%
 }
 \DeclareRobustCommand*{\CNlabelsubnoref}[2]{%
-\CNlabelnoref{#1}%
-\expandafter\ifx\csname cna@#1#2\endcsname\relax%
-{\refstepcounter{BPCnoa}\label{cn:#1#2}}%
-\expandafter\gdef\csname cna@#1#2\endcsname{x}%
+  \CNlabelnoref{#1}%
+  \expandafter\ifx\csname cna@#1#2\endcsname\relax%
+  {\refstepcounter{BPCnoa}\label{cn:#1#2}}%
+  \expandafter\gdef\csname cna@#1#2\endcsname{x}%
 %% \newchems at b{#1}{#2}%
 %%   \write\@auxout{\string\newchems at b{#1}{#2}}%
   \fi%
@@ -204,26 +201,26 @@
 \DeclareRobustCommand{\trans}{\textit{trans}\xspace}
 %%%%%%%%%%%%%%%%%%%%%
 \ifusecbgreek% code with roman greek
-\PackageInfo{bpchem}{using upright greek fonts from cbgreek}
-\input{lgrenc.def}
-\DeclareRobustCommand{\rm at greekletter}[1]{{\fontencoding{LGR}\selectfont%
-     \def\encodingdefault{LGR}#1}}%
-\DeclareRobustCommand{\bpalpha}{\rm at greekletter{a}}
-\DeclareRobustCommand{\bpbeta}{\rm at greekletter{b}}
-\DeclareRobustCommand{\bpDelta}{\rm at greekletter{D}}
-\DeclareRobustCommand{\hapto}[1]{\rm at greekletter{h}\^{#1}}
+  \PackageInfo{bpchem}{using upright greek fonts from cbgreek}
+  \input{lgrenc.def}
+  \DeclareRobustCommand{\rm at greekletter}[1]{{\fontencoding{LGR}\selectfont%
+    \def\encodingdefault{LGR}#1}}%
+  \DeclareRobustCommand{\bpalpha}{\rm at greekletter{a}}
+  \DeclareRobustCommand{\bpbeta}{\rm at greekletter{b}}
+  \DeclareRobustCommand{\bpDelta}{\rm at greekletter{D}}
+  \DeclareRobustCommand{\hapto}[1]{\rm at greekletter{h}\^{#1}}
 \else
-\PackageInfo{bpchem}{using default math greek fonts}
-\DeclareRobustCommand{\bpalpha}{\ensuremath{\alpha}\xspace}
-\DeclareRobustCommand{\bpbeta}{\ensuremath{\beta}\xspace}
-\DeclareRobustCommand{\bpDelta}{\ensuremath{\Delta}\xspace}
-\DeclareRobustCommand{\hapto}[1]{\ensuremath{\eta^{#1}}}
-\fi
+  \PackageInfo{bpchem}{using default math greek fonts}
+  \DeclareRobustCommand{\bpalpha}{\ensuremath{\alpha}\xspace}
+  \DeclareRobustCommand{\bpbeta}{\ensuremath{\beta}\xspace}
+  \DeclareRobustCommand{\bpDelta}{\ensuremath{\Delta}\xspace}
+  \DeclareRobustCommand{\hapto}[1]{\ensuremath{\eta^{#1}}}
+\fi%
 \let\talpha\bpalpha
 \let\tbeta\bpbeta
 %%%%%%
 \DeclareRobustCommand*{\dreh}[1]%
-{$\lbrack \alpha \rbrack _{\mathrm D}^{#1}$}
+  {$\lbrack \alpha \rbrack _{\mathrm D}^{#1}$}
 \endinput
 %%
 %% End of file `bpchem.sty'.



More information about the tex-live-commits mailing list