summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-09-05 00:16:09 +0000
committerKarl Berry <karl@freefriends.org>2011-09-05 00:16:09 +0000
commitf5b4e2827c52206834b8c921b5a037c615b24f3a (patch)
tree6d63b57e789ca438eb428611c52fd797dc7d1e83 /Master/texmf-dist
parentb16b1651b5d296cd70188fe4ff2f1a72f81c4993 (diff)
chemnum (4sep11)
git-svn-id: svn://tug.org/texlive/trunk@23814 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/chemnum/README2
-rw-r--r--Master/texmf-dist/doc/latex/chemnum/bsp.tex2
-rw-r--r--Master/texmf-dist/doc/latex/chemnum/chemnum_doc_de.pdfbin421771 -> 423337 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemnum/chemnum_doc_de.tex48
-rw-r--r--Master/texmf-dist/doc/latex/chemnum/chemnum_doc_en.pdfbin409990 -> 411004 bytes
-rw-r--r--Master/texmf-dist/doc/latex/chemnum/chemnum_doc_en.tex43
-rw-r--r--Master/texmf-dist/tex/latex/chemnum/chemnum.sty404
7 files changed, 337 insertions, 162 deletions
diff --git a/Master/texmf-dist/doc/latex/chemnum/README b/Master/texmf-dist/doc/latex/chemnum/README
index 9c093de53c2..e49258841d0 100644
--- a/Master/texmf-dist/doc/latex/chemnum/README
+++ b/Master/texmf-dist/doc/latex/chemnum/README
@@ -11,7 +11,7 @@ chemnum also needs the packages etoolbox, psfrag and textgreek
to be fully functioning.
Clemens NIEDERBERGER
-2011/08/02
+2011/09/03
http://www.mychemistry.eu/
contact@mychemistry.eu
diff --git a/Master/texmf-dist/doc/latex/chemnum/bsp.tex b/Master/texmf-dist/doc/latex/chemnum/bsp.tex
index 8bcd6836dfa..81c4a4fd282 100644
--- a/Master/texmf-dist/doc/latex/chemnum/bsp.tex
+++ b/Master/texmf-dist/doc/latex/chemnum/bsp.tex
@@ -3,7 +3,7 @@
% - a comprehensive numbering method for chemical compounds - %
% ------------------------------------------------------------------------------------- %
% - Clemens NIEDERBERGER - %
-% - 2011/08/02 - %
+% - 2011/09/03 - %
% ------------------------------------------------------------------------------------- %
% - http://www.mychemistry.eu/ - %
% - contact@mychemistry.eu - %
diff --git a/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_de.pdf b/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_de.pdf
index f0153febfbd..827b5ae7d32 100644
--- a/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_de.pdf
+++ b/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_de.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_de.tex b/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_de.tex
index 719f56f5ce2..a283262c9d6 100644
--- a/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_de.tex
+++ b/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_de.tex
@@ -3,7 +3,7 @@
% - a comprehensive numbering method for chemical compounds - %
% ------------------------------------------------------------------------------------- %
% - Clemens NIEDERBERGER - %
-% - 2011/08/02 - %
+% - 2011/09/03 - %
% ------------------------------------------------------------------------------------- %
% - http://www.mychemistry.eu/ - %
% - contact@mychemistry.eu - %
@@ -32,13 +32,14 @@
\documentclass[DIV11]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenx}
+\usepackage[dvipsnames]{xcolor}
+ \colorlet{code}{RawSienna}
+ \colorlet{shadecolor}{yellow!20}
+\usepackage[runs=2]{auto-pst-pdf}
\usepackage{chemnum,textcomp,url,xspace,booktabs,array,chemscheme}
\usepackage[version=3]{mhchem}
\renewcommand*\schemename{Schema}
\usepackage[normalem]{ulem}
-\usepackage[dvipsnames]{xcolor}
- \colorlet{code}{RawSienna}
- \colorlet{shadecolor}{yellow!20}
\usepackage[runs=2]{auto-pst-pdf}
\usepackage{chemfig,chemmacros}
\input{bsp}
@@ -103,9 +104,22 @@
\newcommand*\changefont[3]{\fontfamily{#1}\fontseries{#2}\fontshape{#3}\selectfont}
+\ExplSyntaxOn
+\DeclareDocumentEnvironment { myquote } { m }
+ {
+ \quote
+ \small \changefont { cmss } { m } { sl }
+ }
+ {
+ \par\noindent
+ \parbox { \linewidth } { \raggedleft \normalfont \itshape #1 }
+ \endquote
+ }
+\ExplSyntaxOff
+
\newcommand*\chemnum{\textsf{chemnum}\xspace}
-\newcommand*\CNversion{v0.3\xspace}
-\newcommand*\CNdate{2011/08/02\xspace}
+\newcommand*\CNversion{v0.3a\xspace}
+\newcommand*\CNdate{2011/09/03\xspace}
\newcommand*\paket[1]{\textsf{#1}\footnote{\url{http://www.ctan.org/pkg/#1}}}
\newcommand*\zB{\mbox{z.\,B.}\xspace}
@@ -185,17 +199,15 @@ Wenn Sie das \textsf{textgreek}-Paket nicht installiert haben und keine griechis
Soweit mir bekannt ist, gab es bislang drei Pakete, die das Nummerieren von Verbindungen erleichtern sollen. Sie alle haben ihre Schwächen.
Das erste, \paket{chemcono}, hat für diesen Zweck Bibliographie-Befehle umdefiniert. Dort müs\-sen Verbindungen in einer Art Literaturliste definiert werden. Dadurch kann dann im Text auf sie referenziert werden. Da es die "`Verbindungs-Bibliothek"' immer mit ausgibt, schlägt der Paket-Autor folgendes vor:
-\begin{quote}\small\changefont{cmss}{m}{sl}
- After compilation and printout, discard the last page.\\
- \parbox{\linewidth}{\raggedleft\normalfont\itshape Stefan Schulz}
-\end{quote}
+\begin{myquote}{Stefan Schulz}
+ After compilation and printout, discard the last page.
+\end{myquote}
Ganz offensichtlich ist das keine perfekte Lösung.
Das zweite, \paket{chemcompounds}, ist enstanden, weil der Paket-Autor ebenfalls mit den Schwä\-chen von \textsf{chemcono} nicht mehr arbeiten wollte. Bei der Erstellung des Pakets hielt er sich stark an den gleichen prinzipiellen Mechanismus wie \textsf{chemcono}.
-\begin{quote}\small\changefont{cmss}{m}{sl}
- When taking a closer look at the 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 \lstinline=\bibitem= and \lstinline=\cite= in pretty much the same way as \textsf{chemcono} does by extracting the corresponding code from \lstinline=article.cls= and \lstinline=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.\\
- \parbox{\linewidth}{\raggedleft\normalfont\itshape Stephan Schenk}
-\end{quote}
+\begin{myquote}{Stephan Schenk}
+ When taking a closer look at the 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 \lstinline=\bibitem= and \lstinline=\cite= in pretty much the same way as \textsf{chemcono} does by extracting the corresponding code from \lstinline=article.cls= and \lstinline=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.
+\end{myquote}
Manche Schwächen hat auch dieses Paket:
\begin{enumerate}
\item Verbindungen müssen in der Regel mit \lstinline=\declarecompound= deklariert werden. Sie müs\-sen es auf jeden Fall, wenn man Label der Art \cmpd{a.one} haben möchte. Dann muss man die La\-bel sogar von Hand vergeben, was den Sinn einer automatischen Nummerierung untergräbt.
@@ -377,7 +389,6 @@ Wie zu Beginn dieses Abschnitts erwähnt, ist die Initialisierung von Labeln nic
\item Der Einsatz von \lstinline=\cmpdinit= bewirkt erst einmal dasselbe wie \lstinline=\cmpdinit*=, deklariert aber \emph{zusätzlich} die Label in der vorgegebenen Reihenfolge. Damit wird die Verwendung von \lstinline=\cmpd*= (Abschnitt \ref{cmd:unsichtbares_label}) und \lstinline=\cmpd+= (Abschnitt \ref{cmd:cmpd_plus}) überflüssig. Man hat damit direkte Kontrolle, welche Verbindung welche Nummer erhält.
\end{enumerate}
-\newpage
\section{Zurücksetzen des Zählers}\label{sec:cmpdreset}
Es ist möglich, mit folgendem Befehl
\begin{framed}
@@ -414,7 +425,7 @@ Der Befehl\label{cmd:cmpd_plus}
\begin{framed}
\centering\lstinline=\cmpd+{<label name>}=
\end{framed}
-liest den Labelnamen, der ausgegeben werden soll, aus der Datei \lstinline=<jobname>.cmpd=. Damit ist er sozusagen das Gegenteil von \lstinline=\cmpd*=, da das Label nicht deklariert sondern nur referenziert und ausgegeben wird. Damit man also \lstinline=\cmpd+{<label>}= einsetzen kann, muss \lstinline=<label>= entweder mit \lstinline=\cmpd{<label>}= oder \lstinline=\cmpd*{<label>}= (davor oder danach) deklariert worden sein. \lstinline=\cmpd*= ist nützlich, wenn ein Label in einem beweglichen Argument wie in \lstinline=\section{}= eingesetzt werden soll. \textbf{Er wird nicht benötigt, wenn} \lstinline=\cmpdinit{}= \textbf{verwendet wird, siehe Abschnitt \ref{sec:cmpdinit} (S. \pageref{sec:cmpdinit}ff).}
+liest den Labelnamen, der ausgegeben werden soll, aus der Datei \lstinline=<jobname>.cmpd=. Damit ist er sozusagen das Gegenteil von \lstinline=\cmpd*=, da das Label nicht deklariert sondern nur referenziert und ausgegeben wird. Damit man also \lstinline=\cmpd+{<label>}= einsetzen kann, muss \lstinline=<label>= entweder mit \lstinline=\cmpd{<label>}= oder \lstinline=\cmpd*{<label>}= (davor oder danach) deklariert worden sein. \lstinline=\cmpd+= ist nützlich, wenn ein Label in einem beweglichen Argument wie in \lstinline=\section{}= eingesetzt werden soll. \textbf{Er wird nicht benötigt, wenn} \lstinline=\cmpdinit{}= \textbf{verwendet wird, siehe Abschnitt \ref{sec:cmpdinit} (S. \pageref{sec:cmpdinit}ff).}
\begin{beispiel}
\subsubsection{Test-\"Uberschrift mit Verbindungslabel \cmpd+[cmpd-delim]{f.one}}
@@ -423,7 +434,7 @@ liest den Labelnamen, der ausgegeben werden soll, aus der Datei \lstinline=<jobn
\end{beispiel}
\subsection{Gleitumgebungen}\cmpdinit*{float1,float2}
-Die Verwendung von \lstinline=\cmpd= in Gleitumgebungen sollte kein Problem darstellen: die Labels werden in der Reihenfolge deklariert, wie Sie im Code auftauchen, eingeschlossen die Gleitumgebungen. Um auf der sicheren Seite können Sie natürlich dennoch \lstinline=\cmpd+= verwenden.
+Die Verwendung von \lstinline=\cmpd= in Gleitumgebungen sollte kein Problem darstellen: die Labels werden in der Reihenfolge deklariert, wie Sie im Code auftauchen, eingeschlossen die Gleitumgebungen. Um auf der sicheren Seite zu sein, können Sie natürlich dennoch \lstinline=\cmpd+= verwenden.
\begin{beispiel}[code and float]
% preamble:
% \usepackage{chemscheme}
@@ -441,7 +452,7 @@ Es funktioniert auch alles wie gewünscht, wenn die Gleitumgebung vor den aktuel
\cmpdinit*{Alc,EtherBr,cpd}
\subsection{Schemata externer Programme}\label{ssec:cmpdref}
-Wenn Sie Ihre Schemata mit externen Programmen wie \zB \textsc{ChemDraw} erstellen und dort ebenfalls \chemnum einsetzen wollen, dann können Sie das mit
+Wenn Sie Ihre Schemata mit externen Programmen wie \zB \textsc{ChemDraw} oder \textsc{Marvin\-Sketch} erstellen und dort ebenfalls \chemnum einsetzen wollen, dann können Sie das mit
\begin{framed}
\centering\lstinline=\cmpdref[<keyval>][<tag>]{<label name>}=
\end{framed}
@@ -534,7 +545,6 @@ Die Schlüssel sind in verschiedene Klassen\label{key_classes} unterteilt, die a
\item[\ttfamily ref] Schlüssel, die speziell mit \lstinline=\cmpdref= zu tun haben.
\end{description}
-\newpage
\subsection{Schriftstil}\label{ssec:schriftstil}
Um den Stil zu ändern, mit dem die Nummern geschrieben werden, verwenden Sie
\begin{framed}
diff --git a/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_en.pdf b/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_en.pdf
index 73560eb91d7..7f9c75c9c43 100644
--- a/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_en.pdf
+++ b/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_en.tex b/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_en.tex
index 46f1f65dd2c..8eafd9d0d2c 100644
--- a/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_en.tex
+++ b/Master/texmf-dist/doc/latex/chemnum/chemnum_doc_en.tex
@@ -3,7 +3,7 @@
% - a comprehensive numbering method for chemical compounds - %
% ------------------------------------------------------------------------------------- %
% - Clemens NIEDERBERGER - %
-% - 2011/08/02 - %
+% - 2011/09/03 - %
% ------------------------------------------------------------------------------------- %
% - http://www.mychemistry.eu/ - %
% - contact@mychemistry.eu - %
@@ -104,9 +104,22 @@
\newcommand*\changefont[3]{\fontfamily{#1}\fontseries{#2}\fontshape{#3}\selectfont}
+\ExplSyntaxOn
+\DeclareDocumentEnvironment { myquote } { m }
+ {
+ \quote
+ \small \changefont { cmss } { m } { sl }
+ }
+ {
+ \par\noindent
+ \parbox { \linewidth } { \raggedleft \normalfont \itshape #1 }
+ \endquote
+ }
+\ExplSyntaxOff
+
\newcommand*\chemnum{\textsf{chemnum}\xspace}
-\newcommand*\CNversion{v0.3\xspace}
-\newcommand*\CNdate{2011/08/03\xspace}
+\newcommand*\CNversion{v0.3a\xspace}
+\newcommand*\CNdate{2011/09/03\xspace}
\newcommand*\paket[1]{\textsf{#1}\footnote{\url{http://www.ctan.org/pkg/#1}}}
\newcommand*\eg{\mbox{e.\,g.}\xspace}
@@ -186,17 +199,15 @@ If you don't have the \textsf{textgreek} package installed and don't need to use
As far as I know there are three packages that are meant to help with numbering chemical compounds. All of them have their weaknesses.
The first one -- \paket{chemcono} -- redefined bibliography commands for that purpose. Compounds have to be declared in what is called \lstinline=\theffbibliography=. Then one can reference them with \lstinline=\fcite=. However, it produces a list of compounds in the text. So the package author suggests:
-\begin{quote}\small\changefont{cmss}{m}{sl}
- After compilation and printout, discard the last page.\\
- \parbox{\linewidth}{\raggedleft\normalfont\itshape Stefan Schulz}
-\end{quote}
+\begin{myquote}{Stefan Schulz}
+ After compilation and printout, discard the last page.
+\end{myquote}
Obviously that's not a perfect solution.
The second one -- \paket{chemcompounds} -- was written, because the author didn't want to work with the weaknesses of \textsf{chemcono} any more. When he wrote the package he basically used the same mechanism to create the labels as \textsf{chemcono} did.
-\begin{quote}\small\changefont{cmss}{m}{sl}
- When taking a closer look at the 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 \lstinline=\bibitem= and \lstinline=\cite= in pretty much the same way as \textsf{chemcono} does by extracting the corresponding code from \lstinline=article.cls= and \lstinline=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.\\
-\parbox{\linewidth}{\raggedleft\normalfont\itshape Stephan Schenk}
-\end{quote}
+\begin{myquote}{Stephan Schenk}
+ When taking a closer look at the 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 \lstinline=\bibitem= and \lstinline=\cite= in pretty much the same way as \textsf{chemcono} does by extracting the corresponding code from \lstinline=article.cls= and \lstinline=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.
+\end{myquote}
Some points still left me unsatisfied, though:
\begin{enumerate}
\item Compounds usually need to be declared with \lstinline=\declarecompound=. They need to be declared in any case if you need a label like \textbf{1a}. Then, one even needs to choose the label by hand, what somehow undermines the automatic numbering principle.
@@ -372,6 +383,7 @@ As mentioned in the beginning of this section the initiation of labels is not re
\item The use of \lstinline=\cmpdinit= does the same thing as \lstinline=\cmpdinit*= \emph{and} declares all the labels in the given order. So if you use it, you won't have to use \lstinline=\cmpd*= (section \ref{cmd:unsichtbares_label}) and \lstinline=\cmpd+= (section \ref{cmd:cmpd_plus}). This gives you direct control, which number is given to which compound.
\end{enumerate}
+\newpage
\section{Resetting the counter}\label{sec:cmpdreset}
With the command
\begin{framed}
@@ -432,8 +444,8 @@ The usage of \lstinline=\cmpd= inside a float shouldn't be a problem: labels are
This also works, of the floating environment is placed before the code, for instance by using the option \lstinline=[t]=.
\cmpdinit*{Alc,EtherBr,cpd}
-\subsection{Schemes created with external programs}\label{ssec:cmpdref}
-If you create your schemes with external programs like for \eg \textsc{ChemDraw} and want to use \chemnum with them as well, you can use this command:
+\subsection{Schemes created by external programs}\label{ssec:cmpdref}
+If you create your schemes by external programs like for \eg \textsc{ChemDraw} or \textsc{Marvin\-Sketch}, and want to use \chemnum with them as well, you can use this command:
\begin{framed}
\centering\lstinline=\cmpdref[<keyval>][<tag>]{<label name>}=
\end{framed}
@@ -453,7 +465,7 @@ This command is inspired by the \lstinline=\schemeref= command from the package
\caption{Scheme with automatted labels.}
\end{scheme}
\end{beispiel}
-So you nummerate the compounds with \textsf{TMP1}, \textsf{TMP2} \etc. These markers will then be replaced with the corresponding labels. Like \textsf{chemscheme} \chemnum uses the \lstinline=\psfrag= command to do that. This means you have to either compile via \textsc{latex}, \textsc{dvips}, \textsc{ps2pdf}, or for instance use the package \paket{auto-pst-pdf} to be able to use \textsc{pdflatex}.
+So you nummerate the compounds with \textsf{TMP1}, \textsf{TMP2} \etc These markers will then be replaced with the corresponding labels. Like \textsf{chemscheme} \chemnum uses the \lstinline=\psfrag= command to do that. This means you have to either compile via \textsc{latex}, \textsc{dvips}, \textsc{ps2pdf}, or for instance use the package \paket{auto-pst-pdf} to be able to use \textsc{pdflatex}.
In each case it is important that the marker is saved as \emph{text} in the \lstinline=eps= file.
@@ -496,7 +508,7 @@ Of course sublabels work in the known way:
\end{scheme}
\end{beispiel}
-\cmpdreset[9]
+\newpage\cmpdreset[9]
\section{Customization}\label{sec:cmpdsetup}
\subsection{The principle}
\chemnum is customized with a key-value system. They can either be used for all following commands with
@@ -765,6 +777,7 @@ For the time being the \lstinline=sub-list= key requires a little caution. Unfor
\cmpd[sub-list={five..three}]{q} or \cmpd[sub-list={three,one,four}]{q}.
\end{beispiel}
+\newpage
\subsection{Overview}\label{ssec:uebersicht}
In this section all keys are listed. Please be aware that the default values of \lstinline=cmpd-delim= and \lstinline=list-delim= and the default setting of \chemnum are \emph{not} the same. By default \chemnum doesn't use delimiters.
\begin{center}
diff --git a/Master/texmf-dist/tex/latex/chemnum/chemnum.sty b/Master/texmf-dist/tex/latex/chemnum/chemnum.sty
index dbc7ac73681..8030717e8c3 100644
--- a/Master/texmf-dist/tex/latex/chemnum/chemnum.sty
+++ b/Master/texmf-dist/tex/latex/chemnum/chemnum.sty
@@ -3,7 +3,7 @@
% - a comprehensive numbering method for chemical compounds - %
% --------------------------------------------------------------------------- %
% - Clemens NIEDERBERGER - %
-% - 2011/08/02 - %
+% - 2011/09/03 - %
% --------------------------------------------------------------------------- %
% - http://www.mychemistry.eu/ - %
% - contact@mychemistry.eu - %
@@ -31,7 +31,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage { expl3 , xparse , etoolbox , psfrag }
-\ProvidesExplPackage {chemnum} {2011/08/02} {0.3} {Numbering chemical compounds}
+\ProvidesExplPackage {chemnum} {2011/09/03} {0.3a} {Numbering chemical compounds}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CHECK FOR SUPPORT
@@ -77,7 +77,8 @@
Please~install~an~up~to~date~version~of~#1. \\
}
-% warning, if textgreek has already been loaded AND option "textgreek = <value>" is used
+% warning, if textgreek has already been loaded AND option
+% "textgreek = <value>" is used
\msg_set:nnnn { chemnum } { package-loaded }
{ Package~#1~already~loaded. }
{
@@ -100,7 +101,10 @@
{ \RequirePackage { #2 } }
{
\@ifpackageloaded { #2 }
- { \msg_warning:nnxx { chemnum } { package-loaded } { #2 } { #1 } }
+ {
+ \msg_warning:nnxx
+ { chemnum } { package-loaded } { #2 } { #1 }
+ }
{ \RequirePackage [ #1 ] { #2 } }
}
}
@@ -117,16 +121,35 @@
\keys_define:nn { chemnum / package } {
textgreek .choice: ,
- textgreek .choice_code:n = \chemnum_load_package:nn \l_keys_choice_tl { textgreek } ,
+ textgreek .choice_code:n =
+ \chemnum_load_package:nn \l_keys_choice_tl { textgreek } ,
textgreek .generate_choices:n = { artemisia , cbgreek , euler } ,
textgreek .default:n = cbgreek
}
-\DeclareOption { textgreek } { \bool_set_true:N \l_chemnum_textgreek_bool \chemnum_package_options:n { textgreek } }
-\DeclareOption { textgreek = artemisia } { \bool_set_true:N \l_chemnum_textgreek_bool \chemnum_package_options:n { textgreek = artemisia } }
-\DeclareOption { textgreek = cbgreek } { \bool_set_true:N \l_chemnum_textgreek_bool \chemnum_package_options:n { textgreek = cbgreek } }
-\DeclareOption { textgreek = euler } { \bool_set_true:N \l_chemnum_textgreek_bool \chemnum_package_options:n { textgreek = euler } }
-\DeclareOption { textgreek = false } { \bool_set_false:N \l_chemnum_textgreek_bool }
+\DeclareOption { textgreek }
+ {
+ \bool_set_true:N \l_chemnum_textgreek_bool
+ \chemnum_package_options:n { textgreek }
+ }
+\DeclareOption { textgreek = artemisia }
+ {
+ \bool_set_true:N \l_chemnum_textgreek_bool
+ \chemnum_package_options:n { textgreek = artemisia }
+ }
+\DeclareOption { textgreek = cbgreek }
+ {
+ \bool_set_true:N \l_chemnum_textgreek_bool
+ \chemnum_package_options:n { textgreek = cbgreek }
+ }
+\DeclareOption { textgreek = euler }
+ {
+ \bool_set_true:N \l_chemnum_textgreek_bool
+ \chemnum_package_options:n { textgreek = euler }
+ }
+\DeclareOption { textgreek = false }
+ { \bool_set_false:N \l_chemnum_textgreek_bool }
+
\ExecuteOptions { textgreek }
\ProcessOptions \scan_stop:
@@ -142,7 +165,8 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% READ FROM PREVIOUS RUN, SAVE FOR NEXT RUN
% save all labels in a clist
-\cs_new:Npn \chemnum_cmpd_save:n #1 { \clist_gput_right:Nn \g_chemnum_cmpd_save_clist { #1 } }
+\cs_new:Npn \chemnum_cmpd_save:n #1
+ { \clist_gput_right:Nn \g_chemnum_cmpd_save_clist { #1 } }
\msg_set:nnn { chemnum } { missing-cmpd-file }
{
@@ -154,7 +178,8 @@
{ \file_input:n { ./ \c_job_name_tl . cmpd } }
{ \msg_warning:nn { chemnum }{ missing-cmpd-file } }
-% write ref commands for all labels in <jobname>.cmpd file to make them available at the next run
+% write ref commands for all labels in <jobname>.cmpd file to make them
+% available at the next run
\AtEndDocument
{
\iow_open:Nn \chemnum_aux_file { ./ \c_job_name_tl . cmpd }
@@ -232,7 +257,8 @@
% error message for wrong argument length of delim-keys
\msg_set:nnn { chemnum } { delimiters }
{
- "#1-delim~=~<odelim><cdelim>"~needs~two~tokens~or~token~groups~as~a~value~\msg_line_context: .
+ "#1-delim~=~<odelim><cdelim>"~needs~two~tokens~or~token~groups~as~a~value~
+ \msg_line_context: .
}
% set compound delimiters
@@ -393,7 +419,12 @@
\tl_use:N \l_chemnum_sub_range_sep_tl
\use:c { chemnum_cmpd_#1_ \l_chemnum_cmpd_sub_two_label_tl _ref: }
}
- \int_compare:nT { \l_chemnum_sublabel_list_current_int < \l_chemnum_sublabel_list_length_int }
+ \int_compare:nT
+ {
+ \l_chemnum_sublabel_list_current_int
+ <
+ \l_chemnum_sublabel_list_length_int
+ }
{ \tl_use:N \l_chemnum_sublabel_list_sep_tl }
}
}
@@ -449,16 +480,21 @@
cmpd-all .bool_set:N = \l_chemnum_cmpd_all_bool ,
cmpd-all .default:n = true ,
cmpd-counter .choice: ,
- cmpd-counter .choice_code:n = \tl_set_eq:NN \l_chemnum_cmpd_kind_value_tl \l_keys_choice_tl ,
- cmpd-counter .generate_choices:n = { arabic , alph , Alph , greek, Greek , roman , Roman , Symbol } ,
+ cmpd-counter .choice_code:n =
+ \tl_set_eq:NN \l_chemnum_cmpd_kind_value_tl \l_keys_choice_tl ,
+ cmpd-counter .generate_choices:n =
+ { arabic , alph , Alph , greek, Greek , roman , Roman , Symbol } ,
cmpd-counter .default:n = arabic ,
sub-counter .choice: ,
- sub-counter .choice_code:n = \tl_set_eq:NN \l_chemnum_cmpd_sub_kind_value_tl \l_keys_choice_tl ,
- sub-counter .generate_choices:n = { arabic , alph , Alph , greek , Greek , roman , Roman , Symbol } ,
+ sub-counter .choice_code:n =
+ \tl_set_eq:NN \l_chemnum_cmpd_sub_kind_value_tl \l_keys_choice_tl ,
+ sub-counter .generate_choices:n =
+ { arabic , alph , Alph , greek , Greek , roman , Roman , Symbol } ,
sub-counter .default:n = alph ,
sub-marker .code:n = \chemnum_subcmpdsep:n { #1 } ,
sub-marker .default:n = . ,
- sub-range-marker .code:n = \chemnum_sublabel_range_marker:n { #1 } ,
+ sub-range-marker .code:n =
+ \chemnum_sublabel_range_marker:n { #1 } ,
sub-range-marker .default:n = { .. } ,
sub-range-sep .tl_set:N = \l_chemnum_sub_range_sep_tl ,
sub-range-sep .default:n = { - } ,
@@ -484,7 +520,8 @@
\tl_set:Nn \l_chemnum_list_last_separator_lang_tl { and }
\tl_new:N \l_chemnum_list_last_separator_tl
-\tl_set:Nn \l_chemnum_list_last_separator_tl { \tl_use:N \l_chemnum_list_last_separator_lang_tl }
+\tl_set:Nn \l_chemnum_list_last_separator_tl
+ { \tl_use:N \l_chemnum_list_last_separator_lang_tl }
\tl_new:N \l_chemnum_list_prefix_tl { }
\tl_set:Nn \l_chemnum_list_prefix_tl { }
@@ -567,7 +604,9 @@
\cs_if_exist:cF { chemnum_cmpd_#1: }
{
\int_gincr:N \g_chemnum_cmpd_main_int
- \prop_gput:Nnx \g_chemnum_label_prop { #1 } { \int_use:N \g_chemnum_cmpd_main_int }
+ \prop_gput:Nnx \g_chemnum_label_prop
+ { #1 }
+ { \int_use:N \g_chemnum_cmpd_main_int }
\chemnum_cmpd_save:n { #1 }
\bool_if:NF \l_chemnum_cmpd_name_bool
{ \int_gincr:N \g_chemnum_cmpd_int }
@@ -617,8 +656,14 @@
\cs_if_exist:cF { chemnum_cmpd_ #1 _ #2 _init: }
{
\bool_if:NTF \l_chemnum_cmpd_init_strict_bool
- { \msg_error:nnx { chemnum } { cmpd-sub-init } { #1 \l_chemnum_cmpd_labelsep_tl #2 } }
- { \msg_warning:nnx { chemnum } { cmpd-sub-init } { #1 \l_chemnum_cmpd_labelsep_tl #2 } }
+ {
+ \msg_error:nnx { chemnum } { cmpd-sub-init }
+ { #1 \l_chemnum_cmpd_labelsep_tl #2 }
+ }
+ {
+ \msg_warning:nnx { chemnum } { cmpd-sub-init }
+ { #1 \l_chemnum_cmpd_labelsep_tl #2 }
+ }
}
}
}
@@ -635,10 +680,12 @@
% error message if no separator is chosen
\msg_set:nnnn { chemnum } { sub-label-separator }
{
- Missing~separator~token~as~value~for~the~key~sub-cmpd-sep \c_space_tl \msg_line_context: !
+ Missing~separator~token~as~value~for~the~key~sub-cmpd-sep \c_space_tl
+ \msg_line_context: !
}
{
- You~used~the~key~sub-cmpd-sep \c_space_tl \msg_line_context: ~but~left~the~argument~empty.\\
+ You~used~the~key~sub-cmpd-sep \c_space_tl \msg_line_context: ~but~left~the~
+ argument~empty.\\
This~can't~work.~Please~select~a~token~as~separator.
}
@@ -662,21 +709,26 @@
\exp_args:Noo \tl_if_in:nnTF { #1 } { \l_chemnum_cmpd_labelsep_tl }
{
\tl_set:Nn \l_chemnum_labelsep_tmp_tl { #1 }
- \exp_args:NNo \tl_replace_once:Nnn \l_chemnum_labelsep_tmp_tl { \l_chemnum_cmpd_labelsep_tl } { \q_nil }
- \exp_after:wN \chemnum_cmpd_labelsep_aux_ii:n \l_chemnum_labelsep_tmp_tl \q_stop
+ \exp_args:NNo \tl_replace_once:Nnn \l_chemnum_labelsep_tmp_tl
+ { \l_chemnum_cmpd_labelsep_tl }
+ { \q_nil }
+ \exp_after:wN \chemnum_cmpd_labelsep_aux_ii:n
+ \l_chemnum_labelsep_tmp_tl \q_stop
}
{ \chemnum_cmpd_labelsep_aux_i:n { #1 } }
}
-\cs_new_nopar:Npn \chemnum_cmpd_labelsep_aux_i:n #1 {
- \tl_set:Nn \l_chemnum_cmpd_main_label_tl { #1 }
- \tl_clear:N \l_chemnum_cmpd_sub_label_tl
-}
+\cs_new_nopar:Npn \chemnum_cmpd_labelsep_aux_i:n #1
+ {
+ \tl_set:Nn \l_chemnum_cmpd_main_label_tl { #1 }
+ \tl_clear:N \l_chemnum_cmpd_sub_label_tl
+ }
-\cs_new_nopar:Npn \chemnum_cmpd_labelsep_aux_ii:n #1 \q_nil #2 \q_stop {
- \tl_set:Nn \l_chemnum_cmpd_main_label_tl { #1 }
- \tl_set:Nn \l_chemnum_cmpd_sub_label_tl { #2 }
-}
+\cs_new_nopar:Npn \chemnum_cmpd_labelsep_aux_ii:n #1 \q_nil #2 \q_stop
+ {
+ \tl_set:Nn \l_chemnum_cmpd_main_label_tl { #1 }
+ \tl_set:Nn \l_chemnum_cmpd_sub_label_tl { #2 }
+ }
% sublabel separating to display a range
\cs_new_nopar:Npn \chemnum_sublabel_range_marker:n #1 {
@@ -690,8 +742,11 @@
\exp_args:Noo \tl_if_in:nnTF { #1 } { \l_chemnum_sublabel_range_marker_tl }
{
\tl_set:Nn \l_chemnum_sublabelsep_tmp_tl { #1 }
- \exp_args:NNo \tl_replace_once:Nnn \l_chemnum_sublabelsep_tmp_tl { \l_chemnum_sublabel_range_marker_tl } { \q_nil }
- \exp_after:wN \chemnum_cmpd_sublabelsep_aux_ii:n \l_chemnum_sublabelsep_tmp_tl \q_stop
+ \exp_args:NNo \tl_replace_once:Nnn \l_chemnum_sublabelsep_tmp_tl
+ { \l_chemnum_sublabel_range_marker_tl }
+ { \q_nil }
+ \exp_after:wN \chemnum_cmpd_sublabelsep_aux_ii:n
+ \l_chemnum_sublabelsep_tmp_tl \q_stop
}
{ \chemnum_cmpd_sublabelsep_aux_i:n { #1 } }
}
@@ -731,57 +786,65 @@
%-----------------------------------------------------------------------------%
% main internal compound label command
% #1: <main label> #2: <sub label> #3: <invisible> #4: <no delim>
-\cs_new_nopar:Npn \chemnum_cmpd_aux_i:nnnn #1#2#3#4 {
- \bool_if:NT \l_chemnum_cmpd_initiated_bool
- { \chemnum_cmpd_initiate:nn { #1 } { #2 } }
- \bool_if:NF \l_chemnum_cmpd_ref_bool
- { \chemnum_cmpd_declare:n { #1 } }
- \tl_if_blank:nF { #2 } {
- \cs_if_exist:cF { g_chemnum_cmpd_#1_int }
- { \int_new:c { g_chemnum_cmpd_#1_int } }
+\cs_new_nopar:Npn \chemnum_cmpd_aux_i:nnnn #1#2#3#4
+ {
+ \bool_if:NT \l_chemnum_cmpd_initiated_bool
+ { \chemnum_cmpd_initiate:nn { #1 } { #2 } }
\bool_if:NF \l_chemnum_cmpd_ref_bool
- { \chemnum_cmpd_sub_declare:nn { #1 } { #2 } }
- }
- \bool_if:NTF #3
- { \mode_if_horizontal:T { \tex_unskip:D } }
- {
- \bool_if:NT #4 {
- \tl_clear:N \l_chemnum_cmpd_odelim_tl
- \tl_clear:N \l_chemnum_cmpd_cdelim_tl
+ { \chemnum_cmpd_declare:n { #1 } }
+ \tl_if_blank:nF { #2 }
+ {
+ \cs_if_exist:cF { g_chemnum_cmpd_#1_int }
+ { \int_new:c { g_chemnum_cmpd_#1_int } }
+ \bool_if:NF \l_chemnum_cmpd_ref_bool
+ { \chemnum_cmpd_sub_declare:nn { #1 } { #2 } }
}
- \chemnum_cmpd_print:n
- {
- \bool_if:NTF \l_chemnum_cmpd_ref_bool
- { \use:c { chemnum_cmpd_ #1 _ref: } }
- { \use:c { chemnum_cmpd_ #1 : } }
- \bool_if:NTF \l_chemnum_cmpd_all_bool
- {
- \tl_use:N \l_chemnum_cmpd_separator_tl
- \use:c { chemnum_cmpd_ #1 _min_ref: }
- \cs_if_eq:ccF { chemnum_cmpd_ #1 _min_ref: } { chemnum_cmpd_ #1 _max_ref: }
- {
- \tl_use:N \l_chemnum_sub_range_sep_tl
- \use:c { chemnum_cmpd_ #1 _max_ref: }
- }
- }
- {
- \bool_if:NTF \l_chemnum_sublabel_list_bool
- {
- \chemnum_cmpd_sublabel_list:nn { #1 } { \l_chemnum_cmpd_sublabel_list_tl }
- }
- {
- \tl_if_blank:nF { #2 }
- {
- \tl_use:N \l_chemnum_cmpd_separator_tl
- \bool_if:NTF \l_chemnum_cmpd_ref_bool
- { \use:c { chemnum_cmpd_ #1 _ #2 _ref: } }
- { \use:c { chemnum_cmpd_ #1 _ #2 : } }
- }
- }
- }
- }
- }
-}
+ \bool_if:NTF #3
+ { \mode_if_horizontal:T { \tex_unskip:D } }
+ {
+ \bool_if:NT #4
+ {
+ \tl_clear:N \l_chemnum_cmpd_odelim_tl
+ \tl_clear:N \l_chemnum_cmpd_cdelim_tl
+ }
+ \chemnum_cmpd_print:n
+ {
+ \bool_if:NTF \l_chemnum_cmpd_ref_bool
+ { \use:c { chemnum_cmpd_ #1 _ref: } }
+ { \use:c { chemnum_cmpd_ #1 : } }
+ \bool_if:NTF \l_chemnum_cmpd_all_bool
+ {
+ \tl_use:N \l_chemnum_cmpd_separator_tl
+ \use:c { chemnum_cmpd_ #1 _min_ref: }
+ \cs_if_eq:ccF
+ { chemnum_cmpd_ #1 _min_ref: }
+ { chemnum_cmpd_ #1 _max_ref: }
+ {
+ \tl_use:N \l_chemnum_sub_range_sep_tl
+ \use:c { chemnum_cmpd_ #1 _max_ref: }
+ }
+ }
+ {
+ \bool_if:NTF \l_chemnum_sublabel_list_bool
+ {
+ \chemnum_cmpd_sublabel_list:nn { #1 }
+ { \l_chemnum_cmpd_sublabel_list_tl }
+ }
+ {
+ \tl_if_blank:nF { #2 }
+ {
+ \tl_use:N \l_chemnum_cmpd_separator_tl
+ \bool_if:NTF \l_chemnum_cmpd_ref_bool
+ { \use:c { chemnum_cmpd_ #1 _ #2 _ref: } }
+ { \use:c { chemnum_cmpd_ #1 _ #2 : } }
+ }
+ }
+ }
+ }
+ }
+ }
+
+\cs_generate_variant:Nn \chemnum_cmpd_aux_i:nnnn { oonn }
%-----------------------------------------------------------------------------%
% create compound label
@@ -791,10 +854,16 @@
\tl_clear:N \l_chemnum_cmpd_main_label_tl
\tl_clear:N \l_chemnum_cmpd_sub_label_tl
\chemnum_cmpd_labelsep:n #1 \q_stop
- \exp_args:Noo \chemnum_cmpd_aux_i:nnnn { \l_chemnum_cmpd_main_label_tl } { \l_chemnum_cmpd_sub_label_tl } { #2 } { #3 }
+ \chemnum_cmpd_aux_i:oonn
+ { \l_chemnum_cmpd_main_label_tl }
+ { \l_chemnum_cmpd_sub_label_tl }
+ { #2 }
+ { #3 }
\group_end:
}
+\cs_generate_variant:Nn \chemnum_cmpd:nnn { onn }
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DOCUMENT COMMANDS
% variables:
@@ -806,12 +875,29 @@
\bool_new:N \l_chemnum_cmpd_ref_bool
+\msg_set:nnnn { chemnum } { fatal-combination }
+ {
+ You~can't~use \c_space_tl \token_to_str:N \cmpd \c_space_tl
+ with~star~and~#1 \c_space_tl \msg_line_context: .
+ }
+ {
+ You~used \c_space_tl \token_to_str:N \cmpd \c_space_tl
+ with~both~star~and~#1 \c_space_tl \msg_line_context: .\\
+ ~This~is~not~possible~since~it~doesn't~make~any~sense.
+ }
+
%-----------------------------------------------------------------------------%
% MAIN COMMAND
-% \cmpd*+-[<key-value-list>]{<(possibly comma separated list of) compound label(s)>}
+% \cmpd*+-[<key-value-list>]{<(possibly comma separated list of) compound
+% label(s)>}
\NewDocumentCommand \cmpd { s t+ t- o m }
{
- \IfBooleanT #2 { \bool_set_true:N \l_chemnum_cmpd_ref_bool }
+ \IfBooleanT #2
+ {
+ \bool_set_true:N \l_chemnum_cmpd_ref_bool
+ \IfBooleanT #1
+ { \msg_error:nnx { chemnum } { fatal-combination } { plus } }
+ }
\tl_clear:N \l_chemnum_tmpa_tl
\group_begin:
\int_zero:N \l_chemnum_list_items_int
@@ -832,38 +918,74 @@
\IfBooleanF #1
{
\if_int_compare:w \l_chemnum_list_separate_int = 1
- \if_int_compare:w \l_chemnum_list_items_int = 1 \else:
+ \if_int_compare:w \l_chemnum_list_items_int = 1
+ \else:
\tl_use:N \l_chemnum_list_prefix_tl
- \tl_if_blank:VF { \l_chemnum_list_prefix_tl } { \l_chemnum_list_space_tl }
+ \tl_if_blank:VF { \l_chemnum_list_prefix_tl }
+ { \l_chemnum_list_space_tl }
\tl_use:N \l_chemnum_list_odelim_tl
\fi:
\fi:
}
\IfBooleanTF #1
- { \exp_args:No \chemnum_cmpd:nnn { \l_chemnum_tmpa_tl } { \BooleanTrue } { \BooleanFalse } }
+ {
+ \chemnum_cmpd:onn
+ { \l_chemnum_tmpa_tl }
+ { \BooleanTrue }
+ { \BooleanFalse }
+ \IfBooleanT #3
+ {
+ \msg_error:nnx { chemnum }
+ { fatal-combination } { minus }
+ }
+ }
{
\IfBooleanTF #3
- { \exp_args:No \chemnum_cmpd:nnn { \l_chemnum_tmpa_tl } { \BooleanFalse } { \BooleanTrue } }
- { \exp_args:No \chemnum_cmpd:nnn { \l_chemnum_tmpa_tl } { \BooleanFalse } { \BooleanFalse } }
- \if_int_compare:w \l_chemnum_list_separate_int = \l_chemnum_list_items_int
+ {
+ \chemnum_cmpd:onn
+ { \l_chemnum_tmpa_tl }
+ { \BooleanFalse }
+ { \BooleanTrue }
+ }
+ {
+ \chemnum_cmpd:onn
+ { \l_chemnum_tmpa_tl }
+ { \BooleanFalse }
+ { \BooleanFalse }
+ }
+ \if_int_compare:w
+ \l_chemnum_list_separate_int = \l_chemnum_list_items_int
\if_int_compare:w \l_chemnum_list_items_int = 1 \else:
\tl_use:N \l_chemnum_list_cdelim_tl
- \tl_if_blank:VF { \l_chemnum_list_suffix_tl } { \l_chemnum_list_space_tl }
+ \tl_if_blank:VF
+ { \l_chemnum_list_suffix_tl }
+ { \l_chemnum_list_space_tl }
\tl_use:N \l_chemnum_list_suffix_tl
\fi:
\else:
- \if_int_compare:w \l_chemnum_list_separate_int = \int_eval:n { \l_chemnum_list_items_int - 1 }
- \tl_if_eq:NNTF \l_chemnum_list_last_separator_tl \l_chemnum_list_last_sep_empty_tl
- { \tl_use:N \l_chemnum_list_separator_tl \l_chemnum_list_space_tl }
+ \if_int_compare:w \l_chemnum_list_separate_int =
+ \int_eval:n { \l_chemnum_list_items_int - 1 }
+ \tl_if_eq:NNTF
+ \l_chemnum_list_last_separator_tl
+ \l_chemnum_list_last_sep_empty_tl
+ {
+ \tl_use:N \l_chemnum_list_separator_tl
+ \l_chemnum_list_space_tl
+ }
{
- \if_int_compare:w \l_chemnum_list_separate_int = 1 \else:
- \bool_if:NT \l_chemnum_list_last_sep_US_bool { \l_chemnum_list_separator_tl }
+ \if_int_compare:w \l_chemnum_list_separate_int = 1
+ \else:
+ \bool_if:NT \l_chemnum_list_last_sep_US_bool
+ { \l_chemnum_list_separator_tl }
\fi:
- \tl_if_blank:VF \l_chemnum_list_last_separator_tl { \l_chemnum_list_space_tl }
- \tl_use:N \l_chemnum_list_last_separator_tl \l_chemnum_list_space_tl
+ \tl_if_blank:VF \l_chemnum_list_last_separator_tl
+ { \l_chemnum_list_space_tl }
+ \tl_use:N \l_chemnum_list_last_separator_tl
+ \l_chemnum_list_space_tl
}
\else:
- \tl_use:N \l_chemnum_list_separator_tl \l_chemnum_list_space_tl
+ \tl_use:N \l_chemnum_list_separator_tl
+ \l_chemnum_list_space_tl
\fi:
\fi:
}
@@ -893,12 +1015,14 @@
% warning/error messages
\msg_set:nnn { chemnum } { cmpd-init }
{
- You~used~\token_to_str:N \cmpdinit \c_space_tl but~didn't~initiate~compound~"#1"~\msg_line_context: .
+ You~used~\token_to_str:N \cmpdinit \c_space_tl but~didn't~initiate~
+ compound~"#1"~\msg_line_context: .
}
\msg_set:nnn { chemnum } { cmpd-sub-init }
{
- You~used~\token_to_str:N \cmpdinit \c_space_tl and~"sub-init~=~true"~but~didn't~initiate~sub-compound~"#1"~\msg_line_context: .
+ You~used~\token_to_str:N \cmpdinit \c_space_tl and~"sub-init~=~true"~
+ but~didn't~initiate~sub-compound~"#1"~\msg_line_context: .
}
% initialize (and maybe declare) labels
@@ -912,21 +1036,41 @@
\exp_after:wN \chemnum_cmpd_labelsep:n \l_chemnum_tmpa_tl \q_stop
\cs_if_exist:cF { chemnum_cmpd_ \l_chemnum_cmpd_main_label_tl _init: }
{
- \cs_new_nopar:cpn { chemnum_cmpd_ \l_chemnum_cmpd_main_label_tl _init: } { }
+ \cs_new_nopar:cpn
+ { chemnum_cmpd_ \l_chemnum_cmpd_main_label_tl _init: }
+ { }
}
\bool_if:NT \l_chemnum_cmpd_sub_init_bool
{
\tl_if_blank:VF \l_chemnum_cmpd_sub_label_tl
{
- \cs_if_exist:cF { chemnum_cmpd_ \l_chemnum_cmpd_main_label_tl _ \l_chemnum_cmpd_sub_label_tl _init: }
+ \cs_if_exist:cF
+ {
+ chemnum_cmpd_
+ \l_chemnum_cmpd_main_label_tl
+ _
+ \l_chemnum_cmpd_sub_label_tl
+ _init:
+ }
{
- \cs_new_nopar:cpn { chemnum_cmpd_ \l_chemnum_cmpd_main_label_tl _ \l_chemnum_cmpd_sub_label_tl _init: } { }
+ \cs_new_nopar:cpn
+ {
+ chemnum_cmpd_
+ \l_chemnum_cmpd_main_label_tl
+ _
+ \l_chemnum_cmpd_sub_label_tl
+ _init:
+ }
+ { }
}
}
}
\bool_if:NT \l_chemnum_cmpd_init_declare_bool
{
- \exp_args:No \chemnum_cmpd:nnn { \l_chemnum_tmpa_tl } { \BooleanTrue } { \BooleanFalse }
+ \chemnum_cmpd:onn
+ { \l_chemnum_tmpa_tl }
+ { \BooleanTrue }
+ { \BooleanFalse }
}
}
@@ -956,7 +1100,7 @@
% CHEMNUM SETUP COMMAND
% \cmpdsetup{<key-value-list>}
\NewDocumentCommand \cmpdsetup { m }
- { \keys_set:nn { chemnum } { #1 } }
+ { \keys_set:nn { chemnum } { #1 } \tex_ignorespaces:D }
%-----------------------------------------------------------------------------%
% REPLACE TAG IN EPS PICTURE WITH LABEL
@@ -1012,31 +1156,39 @@ HISTORY:
one (\cmpd) for both tasks
- setup with a keyval system
- possibility to initiate sublabels
- - choices "greek" and "Greek" for the cmpd-counter keys,
- choice "symbol" changed to "Symbol"
- - package option "textgreek = <value>" to control usage
- of the textgreek package
+ - choices "greek" and "Greek" for the cmpd-counter
+ keys, choice "symbol" changed to "Symbol"
+ - package option "textgreek = <value>" to control
+ usage of the textgreek package
- former \cmpd+ is now \cmpd-
- - new \cmpd+ added which reads label from <jobname>.cmpd
- - bugfix: wrong declaration in \cmpdinit and \cmpd when
- used with line break fixed
- - bugfix: error when \cmpd was used in vertical mode fixed
+ - new \cmpd+ added which reads label from
+ <jobname>.cmpd
+ - bugfix: wrong declaration in \cmpdinit and \cmpd
+ when used with line break fixed
+ - bugfix: error when \cmpd was used in vertical mode
+ fixed
- bugfix: corrected up to date support test
- bugfix: wrong output in \cmpd* list removed
- commented and cleaned up code
2011/08/02 version 0.3 - keys "cmpd-all", "sub-list", "sub-range-sep" and
- "sub-range-marker" added, key "cmpd-sub-counter" renamed
- into "sub-counter", key "sub-cmpd-sep" renamed into
- "sub-marker"
+ "sub-range-marker" added, key "cmpd-sub-counter"
+ renamed into "sub-counter", key "sub-cmpd-sep"
+ renamed into "sub-marker"
- \cmpdref-[<keyval>][<tag>]{<label name>} added
- key "ref-tag" added
- cleaned up code
+ 2011/09/03 version 0.3a - it is now impossible to use the (conflicting or
+ better: senseless) \cmpd*+ and \cmpd*- command
+ versions. An error message is produced.
+ - made sure code has no more than 80 tokens per line
+ to improve readability on small screens
+ - bug (unwanted whitespace) in \cmpdsetup fixed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TODO:
- - Warnung/Fehler ausgeben, wenn \cmpd*+ oder \cmpd*- verwendet werden?
- - Bug: wenn als "sub-marker" ":" von einer anderen Datei gesetzt wird, wird der
- Key nicht erkannt -> catcode Problem: entweder temporär catcode von ":"
+ - Bug: wenn als "sub-marker" ":" von einer anderen Datei gesetzt wird, wird
+ der Key nicht erkannt -> catcode Problem: entweder temporär catcode von ":"
wieder auf 12 setzen oder den Marker prinzipiell auf 11?
- einen Key "hide-main" oder "sub-only" hinzufügen?
- Bug: Key "cmpd-style" wenn zB \color{<farbe>} eingegeben: Fehler beim Test
- auf Makro; Test entfernen? \ No newline at end of file
+ auf Makro; Test entfernen?
+ - \cmpdref: Reihenfolge der optionalen Argumente vertauschen? \ No newline at end of file