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
|
% arara: xelatex: { shell: on }
% arara: xelatex
\documentclass[toc=index]{cnpkgdoc}
\docsetup{
pkg = bohr ,
cmd = \BOHR ,
code-box = {
skipbelow = .5\baselineskip plus .5ex minus .5ex ,
skipabove = .5\baselineskip plus .5ex minus .5ex ,
roundcorner = 3pt ,
innerleftmargin = 1.5em ,
innerrightmargin = 1.5em
} ,
gobble = 1
}
\addcmds{bohr,ch,elementname,elementsymbol,setbohr}
\usepackage{chemmacros}
\usepackage{fontspec}
\defaultfontfeatures{Numbers={OldStyle,Proportional}}
\usepackage[supstfm=libertinesups]{superiors}
\usepackage{fnpct}
\usepackage{embrac}[2012/06/29]
\ChangeEmph{[}[,.02em]{]}[.055em,-.08em]
\ChangeEmph{(}[-.01em,.04em]{)}[.04em,-.05em]
\renewcommand*\othersectionlevelsformat[3]{\textcolor{main}{#3\autodot}\enskip}
\renewcommand*\partformat{\textcolor{main}{\partname~\thepart\autodot}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.ist}
heading_prefix "{\\bfseries "
heading_suffix "\\hfil}\\nopagebreak\n"
headings_flag 1
delim_0 "\\dotfill "
delim_1 "\\dotfill "
delim_2 "\\dotfill "
delim_r "\\textendash"
suffix_2p "\\nohyperpage{\\,f.}"
suffix_3p "\\nohyperpage{\\,ff.}"
\end{filecontents}
\usepackage{imakeidx}
% \indexsetup{noclearpage}
\makeindex[columns=2,intoc,options={-sl \jobname.ist}]
\TitlePicture{%
\parbox{.7\linewidth}{This package provides means for the creation of simple
Bohr models of atoms up to the atomic number 112. Additionally commands are
provided to convert atomic numbers to element symbols or element names and vice
versa.\par
The package is inspired by a question on \url{http://tex.stackexchange.com/}:
\href{http://tex.stackexchange.com/questions/73410/draw-bohr-atomic-model-with-electron-shells-in-tex}%
{Draw Bohr atomic model with electron shells in TeX?}}%
}
\newcommand*\Default[1]{%
\hfill\llap
{%
\ifblank{#1}%
{(initially~empty)}%
{Default:~\code{#1}}%
}%
\newline
}
\newcommand*\required{\hfill\llap{required}\newline}
\newcommand*\optional{\hfill\llap{optional}\newline}
\begin{document}
\section{Licence and Requirements}\secidx{License}
\BOHR is placed under the terms of the LaTeX Project Public License,
version 1.3 or later (\url{http://www.latex-project.org/lppl.txt}).
It has the status ``maintained.''
\BOHR loads and needs the packages \paket[pgf]{tikz}, \paket{pgfopts} and
\paket{etoolbox}.
\secidx*{License}
\section{Options}\secidx{Options}
Every option described in the manual can also be used as package option. Options
are indicated as \key{option} and are all key/value like options. Some options can
be set without value, too. Then the \default{underlined} value is used.
\secidx*{Options}
\section{Usage}\secidx{Usage}
\BOHR is used like any other \LaTeXe\ package:
\begin{beispiel}[code only]
\usepackage{bohr}
\end{beispiel}
The main command, \cmd{bohr}, creates the models:
\begin{beschreibung}
\Befehl{bohr}\oa{<num of shells>}\ma{<number of electrons>}\ma{<atom name>}
\end{beschreibung}
This is described best by an example:
\begin{beispiel}
\bohr{3}{Li}
\end{beispiel}
There is not much more to it. Another example using the optional argument:
\begin{beispiel}
\bohr[2]{2}{$\mathrm{Li^+}$}
\end{beispiel}
\secidx*{Usage}
\section{Customization}\secidx{Customization}
\BOHR provides a handful of options to customize the appearance:
\begin{beschreibung}
\Befehl{setbohr}{<options>}\newline
Options are set in a key/value syntax using this command.
\Option{insert-symbol}{\default{true}|false}\Default{false}
If set to \code{true} \BOHR will insert the atomic symbol suiting to the given
electron number if \emph{no} third argument is given.
\Option{insert-number}{\default{true}|false}\Default{false}
If set to \code{true} \BOHR will use the appropriate number of electrons
for the given element symbol in the third argument if \emph{no} second argument
is given. This of course only works if the third argument is one of the 112
element symbols.
\Option{insert-missing}{\default{true}|false}\Default{false}
Sets both \key{insert-symbol} and \key{insert-number}.
\Option{atom-style}{<code>}\Default{}
This code will be placed immediatly before the third argument of \cmd{bohr}.
The last macro in it may need one argument.
\Option{name-options-set}{<tikz>}\Default{}
This value is passed to the options of the \cmd*{node} the third argument of
\cmd{bohr} is placed in.
\Option{name-options-add}{<tikz>}\Default{}
This value will be added to options set with \key{name-options-set}.
\Option{nucleus-option-set}{<tikz>}\Default{draw=black!80,fill=black!10,opacity=.25}
This value is passed to the options of the \cmd*{draw} command that draws the
circle around the name-node.
\Option{nucleus-options-add}{<tikz>}\Default{}
This value will be added to options set with \key{nucleus-options-set}.
\Option{nucleus-radius}{<dim>}\Default{1em}
The radius of the circle around the name-node.
\Option{electron-options-set}{<tikz>}\Default{blue!50!black!50}
This value is passed to the options of the \cmd*{fill} command that draws the
electrons.
\Option{electron-options-add}{<tikz>}\Default{}
This value will be added to options set with \key{electron-options-set}.
\Option{electron-radius}{<dim>}\Default{1.5pt}
The radius of the circles that represent the electrons.
\Option{shell-options-set}{<tikz>}\Default{draw=blue!75,thin}
This value is passed to the options of the \cmd*{draw} command that draws the
circles that represent the shells.
\Option{shell-options-add}{<tikz>}\Default{}
This value will be added to options set with \key{shell-options-set}.
\Option{shell-dist}{<dim>}\Default{1em}
The distance between the nucleus and the first shell and between subsequent
shells.
\Option{german}{\default{true}|false}\Default{false}
If set to \code{true} the German names are defined (see section~\ref{sec:additional}
to understand what I mean). They are also defined if you use \paket{babel} and
select language \code{german} or \code{ngerman} in the preamble. The same holds
for \paket{polyglossia}.
\end{beschreibung}
\begin{beispiel}
\setbohr{name-options-set={font=\footnotesize\sffamily}}
\bohr{2}{He} \bohr{7}{N}
\end{beispiel}
\begin{beispiel}
% uses package `chemmacros'
\setbohr{atom-style={\footnotesize\sffamily\ch}}
\bohr{0}{H+} \bohr{10}{F-}
\end{beispiel}
\begin{beispiel}
\setbohr{
shell-options-add = dashed,
shell-dist = .5em,
insert-missing
}
\bohr{6}{} \bohr{}{K}
\end{beispiel}
\secidx*{Customization}
\section{Additional Commands}\label{sec:additional}
\BOHR provides some additional commands that return the element symbol or the
element name to a given atomic number and vice versa.
\begin{beschreibung}
\Befehl{elementsymbol}{<atomic number>|<element name>}\newline
Returns the element symbol for a given atomic number or element name.
\cmd{elementsymbol}{80}: \elementsymbol{80}; \cmd{elementsymbol}{rhenium}:
\elementsymbol{rhenium}.
\Befehl{elementname}{<atomic number>|<element symbol>}\newline
Returns the element name for a given atomic number or element symbol.
\cmd{elementname}{80}: \elementname{80}; \cmd{elementname}{Rh}: \elementname{Rh}.
\Befehl{atomicnumber}{<element name>|<element symbol>}\newline
Returns the atomic number for a given element name or element symbol.
\cmd{atomicnumber}{Hg}: \atomicnumber{Hg}; \cmd{atomicnumber}{rhenium}
\atomicnumber{rhenium}.
\Befehl{Z}\newline
If this command isn't defined by some other package it is available as an
alias of \cmd{atomicnumber}.
\end{beschreibung}
\begin{beispiel}
The elements \elementname{F}, \elementname{Cl}, \elementname{Br},
\elementname{I} and \elementname{At} are called \emph{halogens}.
\end{beispiel}
\section{Implementation}
\implementation
\printindex
\end{document}
|