summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/elements/elements_en.tex
blob: 5867f1bf23f678080601a20bfec8145028c4f53c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
% arara: pdflatex: { action: nonstopmode }
% arara: biber
% arara: pdflatex: { action: nonstopmode }
% arara: pdflatex: { action: nonstopmode }
% --------------------------------------------------------------------------
% the ELEMENTS package
% 
%   retrieve different properties of chemical elements
% 
% --------------------------------------------------------------------------
% Clemens Niederberger
% Web:    http://www.mychemistry.eu/forums/forum/elements/
% E-Mail: contact@mychemistry.eu
% --------------------------------------------------------------------------
% Copyright 2011--2019 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.
% --------------------------------------------------------------------------
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
\documentclass[load-preamble+]{cnltx-doc}
\usepackage[utf8]{inputenc}
\usepackage{elements}

\setcnltx{
  package = elements ,
  authors = Clemens Niederberger ,
  email   = contact@mychemistry.eu ,
  url     = https://github.com/cgnieder/elements ,
  add-cmds = {
    atomicnumber,
    DeclareAtomIsotopes,
    DeclareAtomName,
    DeclareAtomSymbol,
    DeclareElectronDistribution,
    elconf,
    elementname,
    elementsymbol,
    mainelementisotope,
    printangularmomentum,
    saveatomicnumber,
    saveelementisotopes,
    saveelementname,
    saveelementsymbol,
    savemainelementisotope,
    setangularmomentum,
    setatomisotopes,
    setatomname,
    setatomsymbol,
    setelectrondistribution,
    writeelconf,
    Z
  } ,
  add-silent-cmds = {
    endhead, foo, ifnumless, LTleft, LTright, midrule, theelement, toprule,
    whileboolexpr
  } ,
  add-silent-envs = { longtable, landscape } ,
  abstract = {%
    This package provides means for retrieving properties of chemical elements
    like atomic number, element symbol, element name, electron distribution or
    isotope number.  Properties are defined for the elements up to the atomic
    number~118.

    This package is a spin-off of the package \pkg{bohr}~\cite{pkg:bohr} by
    the same author.
  } ,
  index-setup = {
     othercode = \footnotesize ,
     level = \addsec ,
     noclearpage
  } ,
  makeindex-setup = {
     columns = 3 ,
     columnsep = 1em
  }
}

\makeatletter
\def\libertine@figurestyle{LF}
\RequirePackage{amsmath}
\undef\lvert \undef\lVert
\undef\rvert \undef\rVert
\RequirePackage[libertine]{newtxmath}
\def\libertine@figurestyle{OsF}
\makeatother

\usepackage{array,booktabs,longtable}
\usepackage{lscape}

\defbibheading{bibliography}{\addsec{References}}

\begin{document}

\section{Licence and Requirements}
\license

\elements\ loads the packages \pkg{etoolbox}~\cite{pkg:etoolbox} and
\pkg{translations}~\cite{pkg:translations}.

\section{Element Names}

\begin{commands}
  \command{elementname}[\Marg{\meta{atomic number}|\meta{element symbol}}]
    Prints the element name of a given element as defined with \cs{setatomname}.
  \command{setatomname}[\oarg{alt.\@ name}\marg{atomic number}\marg{element
    name}]
    Define or redefine the name of an element.  If \meta{element name}
    contains non-ascii symbols the optional argument \meta{alt.\@ name} must
    be given.  In this case \meta{alt.\@ name} must be used in \elements'
    other macros where an element's name can be given as argument.
  \command{DeclareAtomName}[\oarg{alt.\@ name}\marg{atomic
    number}\marg{element name}]
    This is the same as \cs{setatomname} but used before begin document or in
    packages/classes.
  \command{saveelementname}[\marg{cs}\Marg{\meta{atomic number}|\meta{element
      symbol}|\meta{element name}}]
    Saves the name of the given element as replacement text for the macro
    \meta{cs}.
\end{commands}

\begin{example}[side-by-side]
  \elementname{Cu} \par
  \elementname{11} \par
  \saveelementname\foo{28}
  \ttfamily\meaning\foo
\end{example}

\section{Element Symbols}

\begin{commands}
  \command{elementsymbol}[\Marg{\meta{atomic number}|\meta{element name}}]
    Prints the element symbol of a given element as defined with \cs{setatomsymbol}.
  \command{setatomsymbol}[\marg{atomic number}\marg{element symbol}]
    Define or redefine the symbol of an element.
  \command{DeclareAtomSymbol}[\marg{atomic number}\marg{element symbol}]
    This is the same as \cs{setatomsymbol} but used before begin document or in
    packages/classes.
  \command{saveelementsymbol}[\marg{cs}\Marg{\meta{atomic number}|\meta{element
      symbol}|\meta{element name}}]
    Saves the symbol of the given element as replacement text for the macro
    \meta{cs}.
\end{commands}

\begin{example}[side-by-side]
  \elementsymbol{13} \par
  \elementsymbol{Sulfur} \par
  \saveelementsymbol\foo{83}
  \ttfamily\meaning\foo
\end{example}

\section{Atomic Numbers}

\begin{commands}
  \command{atomicnumber}[\Marg{\meta{element symbol}|\meta{element name}}]
    Prints the atomic number of a given element.
  \command{Z}[\Marg{\meta{element symbol}|\meta{element name}}]
    An alias of \cs{atomicnumber} but only defined at begin document and only
    if it isn't defined already.
  \command{saveatomicnumber}[\marg{cs}\Marg{\meta{atomic number}|\meta{element
      symbol}|\meta{element name}}]
    Saves the atomic number of the given element as replacement text for the
    macro \meta{cs}.
\end{commands}

\begin{example}[side-by-side]
  \atomicnumber{U} \par
  \atomicnumber{Chlorine} \par
  \saveatomicnumber\foo{Kr}
  \ttfamily\meaning\foo
\end{example}

\section{Electron Configuration}

\begin{commands}
  \command{elconf}[\Marg{\meta{atomic number}|\meta{element
      symbol}|\meta{element name}}]
    Typesets the electron configuration of the given element.
  \command{writeelconf}[\marg{electron distribution}]
    Typesets the electron distribution \meta{electron distribution}.  The
    input is the same as described below for \cs{setelectrondistribution}.
  \command{setelectrondistribution}[\marg{atomic number}\marg{electron distribution}]
     This set the electron distribution associated with the atom number
     \meta{atomic number}.  \meta{electron distribution} is a comma-separated
     list of the number of electrons placed on each shell from inner to outer
     shell.  For example \verbcode+\setelectrondistribution{3}{2,0,1}+ would
     be an excited \elementname{3}.   The number of electrons with the same
     principal quantum number but a different angular quantum number are
     separated with a \code{+} ordered by the angular quantum number, \ie,
     first \emph{s}, then \emph{p}, then \emph{d}, and then \emph{f} .
     \elementname{29}’s distribution would be declared like this: \\
     \verbcode!\setelectrondistribution{29}{2,2+6,2+6+10,1}!. \\
     A declaration with \verbcode!\setelectrondistribution{29}{2,8,18,1}!
     would work but then \verbcode!\elconf{29}! would give the wrong results.
  \command{DeclareElectronDistribution}
    This is the same as \cs{setelectrondistribution} but used before begin
    document or in packages/classes.
  \command{printangularmomentum}[\marg{angular momentum}]
    \sinceversion{0.1e}This command is used be \cs{elconf} and
    \cs{writeelconf} for typesetting $\printangularmomentum{s}$,
    $\printangularmomentum{p}$, $\printangularmomentum{d}$, \ldots{} You can
    redefine it if you want to change how those functions are typeset (keeping
    in mind that it will be used in \emph{math mode}).  The initial definition
    is:\par
    \verbcode+\newcommand*\printangularmomentum[1]{\mathrm{#1}}+
\end{commands}

\begin{example}[side-by-side]
  \writeelconf{2,2+6,2+6+7} \par
  \elconf{Cl}
\end{example}

There is currently \emph{no way} to get the electron configuration in the
shortened way (\eg:
[Ar]$\printangularmomentum{d}^{10}4\printangularmomentum{s}^1$).

\section{Isotope Lists}

\begin{commands}
  \command{setatomisotopes}[\marg{atomic number}\marg{isotope list}]
    Defines or redefines the isotope list for a given element.  \meta{isotope
      list} should be a comma seperated list of integers.  One of the integers
    may be preceded with a \code{!} to mark the main isotope for the given
    element: \verbcode+\setatomisotopes{6}{10,11,!12,13,14,15,16}+
  \command{DeclareAtomIsotopes}[\marg{atomic number}\marg{isotope list}]
    This is the same as \cs{setatomisotopes} but used before begin document or
    in packages/classes.
  \command{saveelementisotopes}[\marg{cs}\Marg{\meta{atomic number}|\meta{element
      symbol}|\meta{element name}}]
    Saves the isotope list of the given element as replacement text for the
    macro \meta{cs}.
  \command{savemainelementisotope}[\marg{cs}\Marg{\meta{atomic number}|\meta{element
      symbol}|\meta{element name}}]
    Saves the main isotope of the given element as replacement text for the
    macro \meta{cs}.  If the isotope list of the element contains no main
    isotope \meta{cs} will be equivalent to \cs*{@empty}.
  \command{mainelementisotope}[\Marg{\meta{atomic number}|\meta{element
      symbol}|\meta{element name}}]
    Print\sinceversion{0.1d} the main isotope of the given element.  If the
    isotope list of the element contains no main isotope nothing will be
    printed.
\end{commands}

\begin{example}[side-by-side]
  \ttfamily
  \saveelementisotopes\foo{C}
  \meaning\foo\par
  \savemainelementisotope\foo{C}
  \meaning\foo\par
  \normalfont
  \mainelementisotope{C}
\end{example}

\clearpage

\section{Supported Languages}
Currently the following languages are supported:
\begin{itemize}
  \item English
  \item German
  \item French
  \item \sinceversion{0.2}Spanish
  \item \sinceversion{0.3}Portuguese and Brazilian Portuguese
\end{itemize}

\addsec{Element Properties}

On the following pages a table containing the properties known to \elements\
is printed. For those interested: the code used to get the table is as follows
(using the packages \pkg{lscape}~\cite{pkg:lscape},
\pkg{longtable}~\cite{pkg:longtable} and \pkg{booktabs}~\cite{pkg:booktabs}).

\begin{sourcecode}[gobble=0]
\setlength\LTleft\fill
\setlength\LTright\fill
\newcounter{element}
\setcounter{element}{1}
\begin{landscape}
\begin{longtable}{lllll}
  \toprule
    Number & Symbol & Name & Main Isotope & Electron Configuration \\
  \midrule
  \endhead
  \whileboolexpr{test{\ifnumless{\value{element}}{119}}}
    {
      \theelement &
      \elementsymbol{\arabic{element}} &
      \elementname{\arabic{element}} &
      \mainelementisotope{\arabic{element}} &
      \elconf{\arabic{element}}
      \stepcounter{element} \\
    }
    {}
\end{longtable}
\end{landscape}
\end{sourcecode}

\setlength\LTleft\fill
\setlength\LTright\fill
\newcounter{element}
\setcounter{element}{1}
\begin{landscape}
\begin{longtable}{lllll}
  \toprule
    Number & Symbol & Name & Main Isotope & Electron Configuration \\
  \midrule
  \endhead
  \whileboolexpr{test{\ifnumless{\value{element}}{119}}}
    {
      \theelement &
      \elementsymbol{\arabic{element}} &
      \elementname{\arabic{element}} &
      \mainelementisotope{\arabic{element}} &
      \elconf{\arabic{element}}
      \stepcounter{element} \\
    }
    {}
\end{longtable}
\end{landscape}

\end{document}