%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % - chemnum - chemnum_doc_en.tex - % % - a comprehensive numbering method for chemical compounds - % % ------------------------------------------------------------------------------------- % % - Clemens NIEDERBERGER - % % - 2011/11/01 - % % ------------------------------------------------------------------------------------- % % - http://www.mychemistry.eu/ - % % - contact@mychemistry.eu - % % ------------------------------------------------------------------------------------- % % - If you have any ideas, questions, suggestions or bugs to report, please feel free - % % - to contact me. - % % ------------------------------------------------------------------------------------- % % - Copyright 2011 Clemens Niederberger - % % - - % % - This work may be distributed and/or modified under the - % % - conditions of the LaTeX Project Public License, either version 1.3 - % % - of this license or (at your option) any later version. - % % - The latest version of this license is in - % % - http://www.latex-project.org/lppl.txt - % % - and version 1.3 or later is part of all distributions of LaTeX - % % - version 2005/12/01 or later. - % % - - % % - This work has the LPPL maintenance status `maintained'. - % % - - % % - The Current Maintainer of this work is Clemens Niederberger. - % % - - % % - This work consists of the files chemnum.sty, chemnum_doc_de.tex, - % % - chemnum_doc_en.tex, bsp.tex, scheme-tmp.eps, scheme-bla.eps README and the - % % - derived files chemnum_doc_de.pdf and chemnum_doc_en.pdf - % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass[DIV11]{scrartcl} \usepackage[english]{babel} \usepackage[utf8]{inputenx} \usepackage{chemnum,textcomp,lmodern,microtype,url,xspace,booktabs,array,chemscheme} \usepackage[version=3]{mhchem} \usepackage[normalem]{ulem} \usepackage[dvipsnames]{xcolor} \colorlet{code}{RawSienna} \usepackage[runs=2]{auto-pst-pdf} \usepackage{chemfig,chemmacros} \input{bsp} \lstset{ language=[LaTeX]TeX, basicstyle={\ttfamily}, % Grundstil extendedchars=true, numbers=left, % Zeilennummern numberstyle=\tiny, % Größe des Zeilennummern numberblanklines=true, % Leerzeilen nummerieren gobble=0, % das erste Leerzeichen abschneiden xleftmargin=20pt, % Einrückung links breaklines=true, % Zeilenumbruch literate={ä}{{\"a}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 {Ä}{{\"A}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 {ß}{{\ss}}1, moredelim=[is][\color{red!25!purple}]{!!}{!!},% Hervorhebung moredelim=[is][\color{black}]{++}{++}, % Hervorhebung der Keywords rückgängig commentstyle={\color[named]{Gray}}, keywordstyle=\color{code}, texcsstyle=[30]\color{code}, moretexcs=[30] { @m, bf, cmpd, cmpdinit, cmpdref, cmpdreset, cmpdsetup, CNlabel, CNlabelnoref, CNref, CNlabelsub, CNlabelsubnoref, CNrefsub, declarecompound, compound, compoundprefix, compoundsuffix, fcite, lstinline, penalty, psfrag, schemeref, sf, tableofcontents, textcolor, textnumero, theffbibliography, uline } }% \usepackage{hyperref} \hypersetup{colorlinks=true, plainpages=false, bookmarksopen=true, bookmarksopenlevel=2, bookmarksnumbered=true, pdfauthor={Clemens Niederberger}, pdftitle={chemnum - Manual}, pdfsubject={Numbering chemical compounds}, pdfkeywords={chemmnum}, pdfcreator={LaTeX} } \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.3b\xspace} \newcommand*\CNdate{2011/11/03\xspace} \newcommand*\paket[1]{\textsf{#1}\footnote{\url{http://www.ctan.org/pkg/#1}}} \newcommand*\eg{\mbox{e.\,g.}\xspace} \newcommand*\ie{\mbox{i.\,e.}\xspace} \newcommand*\etc{\mbox{etc.}\xspace} \cmpdinit*{a,aa,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,benzol} \begin{document} \begin{titlepage} \centering \Huge chemnum \CNversion \vskip.5cm \Large \CNdate \vskip.5cm \large Clemens \textsc{Niederberger} \vskip.25cm \normalsize\url{http://www.mychemistry.eu/}\\ \href{mailto:contact@mychemistry.eu}{contact@mychemistry.eu} \vskip2cm \begin{abstract} \chemnum is a new and hopefully comprehensive approach for the numbering of chemical compounds. \end{abstract} \vskip3cm \cmpdinit*{glucose.alpha, glucose.beta, glucose.chain} \cmpd*[sub-counter = greek]{glucose.alpha, glucose.beta}\cmpd*{glucose.chain} \setatomsep{2em} \definesubmol{x}{(-[4]H)(-[0]OH)} \definesubmol{y}{(-[0]H)(-[4]HO)} \begin{scheme}[h] \centering\small \schemestart \chemfig{?(-[:-170]HO)-[:-50](-[:170]HO)-[:10](-[:-55,0.7]OH)-[:-10](-[6,0.8]OH)-[:130]O-[:-170]?(-[:150,0.7]-[2,0.7]OH)} \arrow(alpha--chain){<=>} \chemfig{[2]OH-[3]-!x-!x-!y-!x-=[1]O} \arrow(--beta){<=>} \chemfig{?(-[:-170]HO)-[:-50](-[:170]HO)-[:10](-[:-55,0.7]OH)-[:-10](-[:10]OH)(-[6,,,,draw=none]\vphantom{OH})-[:130]O-[:-170]?(-[:150,0.7]-[2,0.7]OH)} \arrow(@chain--chainlabel){0}[-90,.2] \normalsize\cmpd[cmpd-delim]{glucose.chain} \arrow(@chainlabel--){0}[,2.5] \normalsize\cmpd[cmpd-delim]{glucose.beta} \arrow(@chainlabel--){0}[180,2.3] \normalsize\cmpd[cmpd-delim]{glucose.alpha} \schemestop \caption{In a solution the \textalpha- and the \textbeta-anomer of \Dfi-glucose \cmpd[list-delim]{glucose.alpha,glucose.beta} are in equilibrium via the open-chain form \cmpd[cmpd-delim]{glucose.chain}.} \end{scheme} \end{titlepage} \cmpdreset \tableofcontents \section{Licence, Requirements} \chemnum \CNversion underlies the \LaTeX\ Project Public License Version 1.3 or later.\newline(\url{http://www.latex-project.org/lppl.txt}) \chemnum internally loads the packages \textsf{expl3} and \paket{xparse}. \textsf{xparse} is part of the \paket{l3packages} bundle, \textsf{expl3} is part of the \paket{l3kernel} bundle. This means, \chemnum needs \LaTeX3 Support. \chemnum also needs the packages \paket{etoolbox}, \paket{psfrag} and (sometimes) \paket{textgreek}, see section \ref{sec:package_options}. \section{New in \chemnum \CNversion} Since \CNversion the following is new:\cmpd*{a.one,a.two,a.three,a.four,a.five} \begin{itemize} \item the key \lstinline=sub-cmpd-sep= now is \lstinline=sub-marker=, see page \pageref{ssec:sub_label_marker} \item the key \lstinline=cmpd-sub-counter= now is \lstinline=sub-counter=, see page \pageref{key:sub-counter} \end{itemize} The renaming follows the wish, to distinguish different classes of keys indicating the scope they're used for, see page \pageref{key_classes}. \begin{itemize} \item several keys to create labels like \cmpd[sub-list={one..three,five}]{a}, see section \ref{ssec:lists_ranges} on page \pageref{ssec:lists_ranges}. \item the command \lstinline=\cmpdref=, which replaces strings in \lstinline=eps= files, see section \ref{ssec:cmpdref}. \item the key \lstinline=ref-tag=, see page \pageref{key:key-tag}. \end{itemize} \section{Package Options}\label{sec:package_options} \chemnum has one package option. \begin{framed} \centering\lstinline+\usepackage[textgreek = ]{chemnum}+ \end{framed} With this you can both choose between the three different styles of the \textsf{textgreek} package\footnote{See the \textsf{textgreek} documentation for details.} or load \chemnum without the \textsf{textgreek} package. Available values are \lstinline=artemisia=, \lstinline=cbgreek=, \lstinline=euler= and \lstinline=false=. If you use \chemnum without option, then \textsf{textgreek} is loaded with the \lstinline=cbgreek= style. Using \lstinline+\usepackage[textgreek]{chemnum}+ is the same as \lstinline+\usepackage[textgreek = cbgreek]{chemnum}+ and \lstinline+\usepackage{chemnum}+. If you don't have the \textsf{textgreek} package installed and don't need to use greek labels, you can use \lstinline+\usepackage[textgreek = false]{chemnum}+. Then choosing the counter options \lstinline=greek= or \lstinline=Greek= will the result in using \lstinline=alph= or \lstinline=Alph=, respectively (see section \ref{ssec:counter}). \section{Motivation} 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{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{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. \item The layout can't be changed for a single label but only for all. \item The numbers can't be reset. \emph{Although in most cases this is neither necessary nor can it be recommended}, there can be individual cases where this would be useful. \item A list of several compounds \lstinline=\compound{a,b,c}= can only be customized with more effort than what would be convenient. \end{enumerate} Then there is \paket{bpchem}, which provides commands similar to \lstinline=\label= \lstinline=\ref=: \lstinline=\CNlabel{}=, \lstinline=\CNlabelnoref{}= and \lstinline=\CNref{}=. It provides commands for sublabels, too: \lstinline=\CNlabelsub{}{}=, \lstinline=\CNlabelsubnoref{}{}= and \lstinline=\CNrefsub{}{}=. This makes it more flexible than the others regarding sublabels. However, it barely provides possibilities to customize the labels, lists are not possible and the fact that there are different commands for labels and sublabels isn't the best solution, either. \chemnum is intended to fill these gaps. For this all commands have been written from scratch. Some of the ideas of \textsf{chemcompounds} \eg regarding delimiters and layout have been picked up, though. If you notice any feature missing, please let me know by sending me an email. \section{Numbering compounds}\label{sec:nummerieren} \subsection{Basic command} The main command of this package is \begin{framed} \centering\lstinline=\cmpd{