diff options
author | Karl Berry <karl@freefriends.org> | 2006-12-08 00:14:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-12-08 00:14:05 +0000 |
commit | 22c5c5491cf9bb363f89c35c3c5a3f6fe1b58655 (patch) | |
tree | 7b715246ca55e92b961343dc1cfd0be28372be71 /Master | |
parent | 46b8a6fe6247a9476df0a843a54793d042ac2196 (diff) |
chemcompounds update (6dec06)
git-svn-id: svn://tug.org/texlive/trunk@2625 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/chemcompounds/chemcompounds.pdf | bin | 124370 -> 127051 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/chemcompounds/chemcompounds.dtx | 147 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/chemcompounds/chemcompounds.ins | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/chemcompounds/chemcompounds.sty | 22 | ||||
-rw-r--r-- | Master/texmf-dist/tpm/chemcompounds.tpm | 8 |
5 files changed, 114 insertions, 67 deletions
diff --git a/Master/texmf-dist/doc/latex/chemcompounds/chemcompounds.pdf b/Master/texmf-dist/doc/latex/chemcompounds/chemcompounds.pdf Binary files differindex b0293b8a5ee..f08171a96c9 100644 --- a/Master/texmf-dist/doc/latex/chemcompounds/chemcompounds.pdf +++ b/Master/texmf-dist/doc/latex/chemcompounds/chemcompounds.pdf diff --git a/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.dtx b/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.dtx index 5d6a71f3368..33788af1fad 100644 --- a/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.dtx +++ b/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.dtx @@ -1,7 +1,7 @@ % \iffalse %% -%% File: chemcompounds.dtx Copyright (C) 2005 Stephan Schenk -%% $Id: chemcompounds.dtx,v 1.6 2005/10/24 10:16:21 schenk Exp $ +%% File: chemcompounds.dtx Copyright (C) 2005-2007 Stephan Schenk +%% $Id: chemcompounds.dtx,v 1.8 2006/12/01 15:21:58 schenk Exp $ %% %% Stephan Schenk (mail@schenk-stephan.de) %% @@ -28,7 +28,7 @@ %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{chemcompounds} %<*package> - [2005/10/19 v1.1.2 Dictionary for compound numbering] + [2006/12/01 v1.1.3 Dictionary for compound numbering] %</package> % %<*driver> @@ -42,7 +42,7 @@ %</driver> % \fi % -% \CheckSum{188} +% \CheckSum{198} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -62,12 +62,13 @@ % % % +% \changes{1.1.3}{2006/12/01}{Updated documentation.} % \changes{1.1.2}{2005/10/24}{Posted on CTAN on 2005/10/24.} % \changes{1.0.0}{2005/07/21}{First version posted on CTAN.} % % \title{The \textsf{chemcompounds} package\thanks{This file describes % version \fileversion\ and has been last revised \filedate.}} -% \author{Stephan Schenk\\mail@schenk-stephan.de} +% \author{Stephan Schenk\\mail (at) schenk-stephan.de} % \maketitle % % \setcounter{tocdepth}{1} @@ -90,43 +91,44 @@ % times during the evolvement of the manuscript. For this reason it would be % nice to have an automaticism which will take care of every change. % -% Being myself a chemist I've been using the \texttt{chemcono} package by Stefan -% Schulz for this purpose quite successfully over several years. This package -% creates a library very similar to |thebibliography|. Users can now refer to -% entries in the library by a command very similar to |\cite|. Thus, once you -% change the library entry every reference to it will be updated automatically -% upon running \LaTeX\ on the file. There is only one issue associated with -% this package: You get a list of all declared compounds inside your document -% wich at least looks odd. I therefore decided to write a new package -% \texttt{chemcompounds} described in this document to address this problem. -% -% When taking a closer look at the \texttt{chemcono} package I realised that the -% only thing one has to do is to get rid of everything which produces text. -% Thus, as a basis I used the mechanism of |\bibitem| and |\cite| in pretty much -% the same way as \texttt{chemcono} does by extracting the corresponding code -% from |article.cls| and |latex.ltx| but deleting any unnecessary commands -% producing output. I also introduced several lines of code to make the printing -% of the compound names more customisable. -% -% At present the packages knows two different modes of operation. In -% the default |implicit| mode a compound name is created automatically as a +% Being myself a chemist, I've been using the \texttt{chemcono} package by +% Stefan Schulz for this purpose quite successfully over several years. This +% package creates a library very similar to |thebibliography|. Users can now +% refer to entries in the library by a command very similar to |\cite|. Thus, +% once you change the library entry every reference to it will be updated +% automatically upon running \LaTeX\ on the file. There is only one issue +% associated with this package: You get a list of all declared compounds +% inside your document wich at least looks odd. I therefore decided to write a +% new package \texttt{chemcompounds} described in this document to address +% this problem. +% +% When taking a closer look at the \texttt{chemcono} package, I realised that +% the only thing one has to do is to get rid of everything which produces +% text. Thus, as a basis I used the mechanism of |\bibitem| and |\cite| in +% pretty much the same way as \texttt{chemcono} does by extracting the +% corresponding code from |article.cls| and |latex.ltx| but deleting any +% unnecessary commands producing output. I also introduced several lines of +% code to make the printing of the compound names more customisable. +% +% Currently, the packages knows two different modes of operation. In +% the default |implicit| mode, a compound name is created automatically as a % consecutive number when the compound is referenced for the first time by % |\compound|. Thus, all compounds will be numbered % consecutively in the order they appear in the text. If the automatically % generated name is not appropriate, a custom name can be given to a compound % by means of the |\declarecompound| command described below. % -% In |noimplicit| mode names are not generated fully automatically. Instead for +% In |noimplicit| mode names are not generated fully automatically. Instead, for % every compound a |\declarecompound| must be issued. This will again create a % subsequent number and a custom name can be given as an optional argument. The -% main difference to |implicit| mode is that thus compounds will be +% main difference to |implicit| mode is that thus compounds will be % numbered in the order of the corresponding |\declarecompound| commands rather % than in the order of their appearance in the text. % % % \section{The user interface} % -% Because of the way the implementation works, two \LaTeX\ runs are required +% Because of the way the implementation works, two \LaTeX\ runs are required % to get everything right. This should not be a problem since you have to run % \LaTeX\ twice anyway to get the table of contents and references right. The % package will issue a ``labels have changed'' warning if you have to rerun @@ -159,7 +161,7 @@ % If the optional argument is omitted, a consecutive number is automatically % taken as compound name. This command can only occur in the preamble. % A personal recommendation is to keep all |\declarecompound|s together in a -% separate file and |\input| this file in the preamble. +% separate file and |\input| this file in the preamble. % % In |implicit| mode, if no optional argument is given, the command does nothing % since the automatic compound name will be generated by |\compound|. @@ -182,14 +184,20 @@ % even never mentioned in the text but the numbering scheme should take care of % them. % +% \item +% \DescribeMacro{\compound+} +% The version with a '|+|' really prints only the name of a compound. In +% |implicit| mode, no label is created. Thus, it is the opposite of the starred +% command. +% % \end{list} % % % -% \subsection{Customisation} +% \subsection{Customization} % % The commands in this section can be used to fine-tune the appearance of the -% compound names. In order to change the default behaviour you have to +% compound names. In order to change the default behaviour you have to % |\renewcommand| the corresponding commands. The defaults for every command % are given in parentheses. % @@ -229,7 +237,7 @@ % % \item % \DescribeMacro{\printcompound} -% |\printcompound| +% |\printcompound| % (|{\compoundprefix}{\compoundstyle{#1}}{\compoundsuffix}|)\\ % is used to actually format the name of each compound. If the previous % possibilities are not sufficient to meet your formatting demands the thing @@ -292,7 +300,7 @@ % \renewcommand{\compoundstyle}{\emph} % \end{verbatim} % gives \textbf{[}$\langle$\emph{1}$\rangle$\textbf{]} and -% \textbf{[}$\langle$\emph{1}$\rangle$, +% \textbf{[}$\langle$\emph{1}$\rangle$, % $\langle$\emph{2}$\rangle$, $\langle$\emph{5b}$\rangle$\textbf{]}. % % \end{itemize} @@ -316,7 +324,7 @@ % \iffalse % Identification is already done on top of the file. Thus the following % code should be printed in the documentation but should not be included -% in the package. +% in the package. %</package> %<*!package> % \fi @@ -403,7 +411,7 @@ % This command is used to assign a name to a compound. % It just looks ahead whether an optional argument was given % and calls the appropriate internal command. To avoid problems with the -% creation of the labels this command is only allowed in the preamble. +% creation of the labels, this command is only allowed in the preamble. % \begin{macrocode} \def\declarecompound{\@ifnextchar[\@ldeclarecompound\@declarecompound} \@onlypreamble\declarecompound @@ -411,7 +419,7 @@ % \end{macro} % % \begin{macro}{\ifchemcompounds@print} -% \changes{1.1.2}{2005/10/18}{New.} +% \changes{1.1.2}{2005/10/18}{New.} % Define a new boolean variable indicating whether the starred version of % |\compound| was used. % \begin{macrocode} @@ -419,38 +427,59 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\ifchemcompounds@create} +% \changes{1.1.3}{2006/12/01}{New.} +% Define a new boolean variable indicating whether a label name shall be +% created automatically in |implicit| mode. +% \begin{macrocode} +\newif\ifchemcompounds@create +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\compound} +% \changes{1.1.3}{2006/12/01}{Abandon use of \cs{@ifstar} since this breaks +% compatibility with amsmath (reported by J. Ryan).} +% \changes{1.1.3}{2006/12/01}{Set chemcompounds@create appropriately.} % \changes{1.1.2}{2005/10/18}{Only check for starred version and call internal % command. Functionality moved to \cs{@compound}.} % \changes{1.1.1}{2005/10/11}{Changed label prefix to 'comp'.} -% \changes{1.1.0}{2005/10/07}{Changed definition of +% \changes{1.1.0}{2005/10/07}{Changed definition of % \cs{compoundseparator}. Inserted \cs{@createcompoundhook}.} % \changes{1.0.1}{2005/10/05}{Replaced \cs{hbox} by \cs{mbox} % to work around some spacing issues when printing the compound name.} % \begin{macro}{\compound*} % \changes{1.1.2}{2005/10/18}{New.} -% This command will finally print the name associated with a compound label. +% \begin{macro}{\compound+} +% \changes{1.1.3}{2006/12/01}{New (suggested by J. Hooper).} +% This command will finally print the name associated with a compound label. % The starred version just creates the label (in |implicit| mode) without % printing the value. -% The command itself just checks whether the starred version is used, sets -% an internal flag appropriately and calls the internal command |\@compound|. +% The command itself just checks whether the starred or plussed version is used, +% sets the internal flags appropriately and calls the internal command +% |\@compound|. % \begin{macrocode} \DeclareRobustCommand{\compound}{% - \@ifstar{\chemcompounds@printfalse\@compound} - {\chemcompounds@printtrue\@compound} + \chemcompounds@createtrue + \chemcompounds@printtrue + \@ifnextchar *{\chemcompounds@printfalse\@firstoftwo\@compound} + {% + \@ifnextchar +{\chemcompounds@createfalse\@firstoftwo\@compound} + {\@compound} + } } % \end{macrocode} % \end{macro} % \end{macro} +% \end{macro} % % % % \subsection{Internal commands} % % \begin{macro}{\@compound} -% \changes{1.1.2}{2005/10/18}{New. Previous functionality moved to +% \changes{1.1.2}{2005/10/18}{New. Previous functionality moved to % \cs{printcompound}.} -% This command retrieves the name associated with a compound and prints it +% This command retrieves the name associated with a compound and prints it % in the text using the previously defined format. The code is a modified % version of the definition of |\cite| in |latex.ltx|. % If this command is invoked by |\compound*|, |\ifchemcompounds@print| will be @@ -478,7 +507,7 @@ \def\@compounda{{\compoundseparator}}% \fi % \end{macrocode} -% If compound is undefined print '\textbf{?}' and raise a warning. +% If compound is undefined, print '\textbf{?}' and raise a warning. % \begin{macrocode} \@ifcompoundundefined{\@compoundb}{% \ifchemcompounds@print @@ -507,7 +536,7 @@ \ifchemcompounds@print \compoundglobalsuffix % \end{macrocode} -% Although nothing is printed, under certain conditions an additional +% Although nothing is printed, under certain conditions an additional % space is created. Remove it. % \begin{macrocode} \else @@ -559,7 +588,7 @@ % % \begin{macro}{\@ldeclarecompound} % \changes{1.1.0}{2005/10/06}{Completly rewritten.} -% The next command gets called if an additional argument was supplied to +% The next command gets called if an additional argument was supplied to % |\declarecompound|. It creates the compound with the given name as soon as % the |aux| file is writeable. This command can only be used in the preamble. % \begin{macrocode} @@ -572,13 +601,13 @@ % % \begin{macro}{\@declarecompound} % \changes{1.1.0}{2005/10/06}{Completely rewritten.} -% In |implicit| mode this command does nothing since default names are created +% In |implicit| mode this command does nothing since default names are created % automatically by |\compound|. % \begin{macrocode} \ifchemcompounds@implicit \let\@declarecompound\@gobble % \end{macrocode} -% In |noimplicit| mode this simply creates the compound as soon as +% In |noimplicit| mode this simply creates the compound as soon as % the |aux| file is writeable. % \begin{macrocode} \else @@ -594,7 +623,7 @@ % \begin{macro}{\@ifcompoundundefined} % \changes{1.1.1}{2005/10/11}{Changed label prefix to 'comp'.} % \changes{1.1.0}{2005/10/06}{New.} -% Test whether a compound has already been defined by testing the associated +% Test whether a compound has already been defined by testing the associated % label. % \begin{macrocode} \def\@ifcompoundundefined#1{% @@ -655,7 +684,7 @@ \global\@namedef{compc@#1}{}% } % \end{macrocode} -% In |noimplicit| mode this is unnecessary thus just gobble the argument. +% In |noimplicit| mode this is unnecessary, thus just gobble the argument. % \begin{macrocode} \else \let\@compoundcreated\@gobble @@ -667,8 +696,8 @@ % \changes{1.1.1}{2005/10/11}{Changed label prefix to 'compc'.} % \changes{1.1.0}{2005/10/07}{New.} % Check whether a new compound name has already been created. -% In |implicit| mode existence of the corresponding label (flag) is checked. -% If it does not exist the code given as the second argument is executed. +% In |implicit| mode existence of the corresponding label (flag) is checked. +% If it does not exist, the code given as the second argument is executed. % \begin{macrocode} \ifchemcompounds@implicit \def\@ifnotcompoundcreated#1#2{% @@ -685,12 +714,20 @@ % \end{macro} % % \begin{macro}{\@createcompoundhook} +% \changes{1.1.3}{2006/12/01}{Implicit definition now checks for +% chemcompounds@create} % \changes{1.1.0}{2005/10/07}{New.} % This command gets called everytime a compound name is printed. -% In |implicit| mode this command is equal to creating a new compound name. +% In |implicit| mode this command creates a new compound name if +% |\ifchemcompounds@create| is true. The |\compound+| command sets +% this boolean to false. % \begin{macrocode} \ifchemcompounds@implicit - \let\@createcompoundhook\@createcompound + \def\@createcompoundhook#1{% + \ifchemcompounds@create + \@createcompound{#1}% + \fi + } % \end{macrocode} % In |noimplicit| mode this is unnecessary. Therefore just gobble the argument. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.ins b/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.ins index a7f6db5b17f..aee273065f7 100644 --- a/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.ins +++ b/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.ins @@ -1,6 +1,6 @@ %% -%% File: chemcompounds.ins Copyright (C) 2005 Stephan Schenk -%% $Id: chemcompounds.ins,v 1.2 2005/10/05 18:03:39 schenk Exp $ +%% File: chemcompounds.ins Copyright (C) 2005-2007 Stephan Schenk +%% $Id: chemcompounds.ins,v 1.3 2006/12/01 15:21:58 schenk Exp $ %% %% Stephan Schenk, %% e-mail: mail@schenk-stephan.de diff --git a/Master/texmf-dist/tex/latex/chemcompounds/chemcompounds.sty b/Master/texmf-dist/tex/latex/chemcompounds/chemcompounds.sty index 7e1efcb75b1..80aefcf7372 100644 --- a/Master/texmf-dist/tex/latex/chemcompounds/chemcompounds.sty +++ b/Master/texmf-dist/tex/latex/chemcompounds/chemcompounds.sty @@ -21,8 +21,8 @@ %% same distribution. (The sources need not necessarily be %% in the same archive or directory.) %% -%% File: chemcompounds.dtx Copyright (C) 2005 Stephan Schenk -%% $Id: chemcompounds.dtx,v 1.6 2005/10/24 10:16:21 schenk Exp $ +%% File: chemcompounds.dtx Copyright (C) 2005-2007 Stephan Schenk +%% $Id: chemcompounds.dtx,v 1.8 2006/12/01 15:21:58 schenk Exp $ %% %% Stephan Schenk (mail@schenk-stephan.de) %% @@ -37,7 +37,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{chemcompounds} - [2005/10/19 v1.1.2 Dictionary for compound numbering] + [2006/12/01 v1.1.3 Dictionary for compound numbering] \newif\ifchemcompounds@implicit \DeclareOption{implicit}{\chemcompounds@implicittrue} \DeclareOption{noimplicit}{\chemcompounds@implicitfalse} @@ -53,9 +53,15 @@ \def\declarecompound{\@ifnextchar[\@ldeclarecompound\@declarecompound} \@onlypreamble\declarecompound \newif\ifchemcompounds@print +\newif\ifchemcompounds@create \DeclareRobustCommand{\compound}{% - \@ifstar{\chemcompounds@printfalse\@compound} - {\chemcompounds@printtrue\@compound} + \chemcompounds@createtrue + \chemcompounds@printtrue + \@ifnextchar *{\chemcompounds@printfalse\@firstoftwo\@compound} + {% + \@ifnextchar +{\chemcompounds@createfalse\@firstoftwo\@compound} + {\@compound} + } } \def\@compound#1{% \ifchemcompounds@print @@ -145,7 +151,11 @@ \let\@ifnotcompoundcreated\@secondoftwo \fi \ifchemcompounds@implicit - \let\@createcompoundhook\@createcompound + \def\@createcompoundhook#1{% + \ifchemcompounds@create + \@createcompound{#1}% + \fi + } \else \let\@createcompoundhook\@gobble \fi diff --git a/Master/texmf-dist/tpm/chemcompounds.tpm b/Master/texmf-dist/tpm/chemcompounds.tpm index e2b580ab37c..e6844618874 100644 --- a/Master/texmf-dist/tpm/chemcompounds.tpm +++ b/Master/texmf-dist/tpm/chemcompounds.tpm @@ -3,7 +3,7 @@ <rdf:Description about="http://texlive.dante.de/texlive/Package/chemcompounds.zip"> <TPM:Name>chemcompounds</TPM:Name> <TPM:Type>Package</TPM:Type> - <TPM:Date>2006/01/11 23:03:17</TPM:Date> + <TPM:Date>2006/12/01 15:21:00</TPM:Date> <TPM:Version></TPM:Version> <TPM:Creator>karl</TPM:Creator> <TPM:Title> @@ -20,15 +20,15 @@ generating an odd-looking list of compounds inside the text. <TPM:Author></TPM:Author> <TPM:Size>155074</TPM:Size> <TPM:Build/> - <TPM:RunFiles size="5625"> + <TPM:RunFiles size="5853"> texmf-dist/tex/latex/chemcompounds/chemcompounds.sty texmf-dist/tpm/chemcompounds.tpm </TPM:RunFiles> - <TPM:DocFiles size="124781"> + <TPM:DocFiles size="127462"> texmf-dist/doc/latex/chemcompounds/README texmf-dist/doc/latex/chemcompounds/chemcompounds.pdf </TPM:DocFiles> - <TPM:SourceFiles size="24668"> + <TPM:SourceFiles size="25915"> texmf-dist/source/latex/chemcompounds/chemcompounds.dtx texmf-dist/source/latex/chemcompounds/chemcompounds.ins </TPM:SourceFiles> |