summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bohr/bohr.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-11-05 23:20:52 +0000
committerKarl Berry <karl@freefriends.org>2013-11-05 23:20:52 +0000
commit716054507cf3c82578fca00f234f742a74ed6b07 (patch)
treeb69b6d0feeeff3e72121ead07f562b96ca0ccaeb /Master/texmf-dist/tex/latex/bohr/bohr.sty
parentb5ba601a229f163d52b5f8b68a297e92e675b401 (diff)
bohr (5nov13)
git-svn-id: svn://tug.org/texlive/trunk@32083 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bohr/bohr.sty')
-rw-r--r--Master/texmf-dist/tex/latex/bohr/bohr.sty433
1 files changed, 327 insertions, 106 deletions
diff --git a/Master/texmf-dist/tex/latex/bohr/bohr.sty b/Master/texmf-dist/tex/latex/bohr/bohr.sty
index 4d9e60a76b2..874d07c63b2 100644
--- a/Master/texmf-dist/tex/latex/bohr/bohr.sty
+++ b/Master/texmf-dist/tex/latex/bohr/bohr.sty
@@ -8,7 +8,7 @@
% Web: https://bitbucket.org/cgnieder/bohr/
% E-Mail: contact@mychemistry.eu
% --------------------------------------------------------------------------
-% Copyright 2012 Clemens Niederberger
+% Copyright 2012-2013 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -25,34 +25,104 @@
% The bohr package consists of the files
% - bohr.sty
% - bohr_en.tex, bohr_en.pdf
-% - bohr_elements_english.def, bohr_elements_german.def
+% - bohr_elements_english.def, bohr_elements_german.def,
+% bohr_elements_french.def
% - README
% --------------------------------------------------------------------------
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-\def\@bohr@date{2012/12/30}
-\def\@bohr@version{v0.2c}
-\def\@bohr@description{simple atom representation according to the Bohr model}
+\newcommand*\@bohr@date{2013/11/05}
+\newcommand*\@bohr@version{v0.3}
+\newcommand*\@bohr@description{simple atom representation according to the Bohr model}
\ProvidesPackage{bohr}[\@bohr@date\space \@bohr@version\space \@bohr@description]
-\RequirePackage{tikz,etoolbox,pgfopts}
+\RequirePackage{tikz,cnltx-base}
% --------------------------------------------------------------------------
% message handling
-\def\@bohr@create@message#1{%
- \ifstrequal{#1}{Error}
+\newcommand*\@bohr@error@message{%
+ For details have a look at the `exsheets' manual.}
+
+\cnltx@create@generic@message{@bohr}{bohr}{Error}{\@bohr@error@message}
+\cnltx@create@generic@message{@bohr}{bohr}{Warning}{}
+\cnltx@create@generic@message{@bohr}{bohr}{WarningNoLine}{}
+\cnltx@create@generic@message{@bohr}{bohr}{Info}{}
+
+% --------------------------------------------------------------------------
+% options
+\newcommand*\@bohr@name@options{}
+\newcommand*\@bohr@write@atom[1]{#1}
+\newcommand*\@bohr@nucleus@radius{1em}
+\newcommand*\@bohr@electron@options{blue!50!black!50}
+\newcommand*\@bohr@electron@radius{1.5pt}
+\newcommand*\@bohr@shell@dist{1em}
+\newcommand*\@bohr@nucleus@options{draw=black!80,fill=black!10,opacity=.25}
+\newcommand*\@bohr@shell@options{draw=blue!75,thin}
+
+\newbool{bohr@insert@symbol}
+\newbool{bohr@insert@number}
+
+\newcommand*\@bohr@insert@symbol[2]{%
+ \ifbool{bohr@insert@symbol}
{%
- \lowercase{\csdef{@bohr@#1}}##1##2{%
- \csuse{Package#1}{bohr}{##1}{##2}}%
- }{%
- \lowercase{\csdef{@bohr@#1}}##1{%
- \csuse{Package#1}{bohr}{##1}}%
- }}
-\@bohr@create@message{Error}
-\@bohr@create@message{Warning}
-\@bohr@create@message{WarningNoLine}
-\@bohr@create@message{Info}
+ \ifblank{#2}
+ {\@bohr@write@atom{\@bohr@get@atom@symbol{#1}}}
+ {\@bohr@write@atom{#2}}%
+ }
+ {\@bohr@write@atom{#2}}}
+
+\newcommand\@bohr@add@options@to[2]{%
+ \edef#1{\expandonce#1,\unexpanded{#2}}%
+}
+
+\newcommand*\@bohr@option@deprecated[2]{%
+ \@bohr@warning{option `#1' has deprecated, use `#2' instead}%
+}
+
+\pgfkeys{
+ bohr/.cd,
+ insert-symbol/.is if = bohr@insert@symbol ,
+ insert-number/.is if = bohr@insert@number ,
+ insert-missing/.is choice,
+ insert-missing/true/.code =
+ \booltrue{bohr@insert@symbol}\booltrue{bohr@insert@number} ,
+ insert-missing/false/.code =
+ \boolfalse{bohr@insert@symbol}\boolfalse{bohr@insert@number} ,
+ insert-missing/.default = true ,
+ atom-style/.code = \def\@bohr@write@atom{#1} ,
+ name-options-set/.code = \def\@bohr@name@options{#1} ,
+ name-options-add/.code =
+ \@bohr@add@options@to\@bohr@name@options{#1} ,
+ nucleus-radius/.code = \def\@bohr@nucleus@radius{#1} ,
+ nucleus-options-set/.code = \def\@bohr@nucleus@options{#1} ,
+ nucleus-options-add/.code =
+ \@bohr@add@options@to\@bohr@nucleus@options{#1} ,
+ electron-radius/.code = \def\@bohr@electron@radius{#1} ,
+ electron-options-set/.code = \def\@bohr@electron@options{#1} ,
+ electron-options-add/.code =
+ \@bohr@add@options@to\@bohr@electron@options{#1} ,
+ shell-dist/.code = \def\@bohr@shell@dist{#1} ,
+ shell-options-set/.code = \def\@bohr@shell@options{#1} ,
+ shell-options-add/.code =
+ \@bohr@add@options@to\@bohr@shell@options{#1} ,
+ german/.code =
+ \@bohr@option@deprecated{german}{language=german} ,
+ ngerman/.code =
+ \@bohr@option@deprecated{ngerman}{language=german} ,
+ language/.code = \def\@bohr@language{#1} ,
+ distribution-method/.is choice ,
+ distribution-method/periodic/.code =
+ \def\@bohr@draw@electrons{\@bohr@draw@electrons@periodic} ,
+ distribution-method/quantum/.code =
+ \def\@bohr@draw@electrons{\@bohr@draw@electrons@quantum}
+}
+
+\newrobustcmd\setbohr[1]{\pgfqkeys{/bohr}{#1}}
+
+\setbohr{distribution-method=quantum}
+
+\ProcessPgfOptions*
% --------------------------------------------------------------------------
% the \bohr command
@@ -61,7 +131,7 @@
% #3: atom name
\newrobustcmd*\bohr[3][]{\@bohr{#1}{#2}{#3}}
-\def\@bohr#1#2#3{%
+\newcommand*\@bohr[3]{%
\ifblank{#2}% electron number given ?
{% no
\ifboolexpr{ bool {bohr@insert@number} and test {\ifblank{#3}} }
@@ -90,7 +160,7 @@
\else
\ifnum#2>112\relax
\@bohr@warning{I only know atoms up to 112 (Copernicium). You
- gave me #1 so I am using 112 instead.}
+ gave me #2 so I am using 112 instead.}
\def\@bohr@electron@current@number{112}%
\else
\def\@bohr@electron@current@number{#2}%
@@ -129,7 +199,7 @@
\endtikzpicture
}
-\def\@bohr@get@shell@num#1{%
+\newcommand*\@bohr@get@shell@num[1]{%
\ifnum#1<3\relax
\def\@bohr@shell@num{1}%
\else
@@ -157,7 +227,7 @@
\fi
}
-\def\@bohr@distribute@electrons#1#2#3#4{%
+\newrobustcmd*\@bohr@distribute@electrons[4]{%
\pgfmathparse{#2}%
\let\@bohr@last@electron\pgfmathresult
\foreach\@bohr@electron@number in {#1,...,\@bohr@last@electron}
@@ -168,7 +238,9 @@
}
}
-\def\@bohr@draw@electrons#1{%
+% the simple model according to periods:
+
+\newcommand*\@bohr@draw@electrons@periodic[1]{%
\ifnum#1<1\relax\else
\ifnum#1<3\relax
\@bohr@distribute@electrons{1}{#1}{180}{1}%
@@ -203,18 +275,20 @@
\@bohr@distribute@electrons{1}{18}{20}{5}%
\@bohr@distribute@electrons{1}{#1-54}{11.25}{6}%
\else
- \@bohr@distribute@electrons{1}{2}{180}{1}%
- \@bohr@distribute@electrons{1}{8}{45}{2}%
- \@bohr@distribute@electrons{1}{8}{45}{3}%
- \@bohr@distribute@electrons{1}{18}{20}{4}%
- \@bohr@distribute@electrons{1}{18}{20}{5}%
- \@bohr@distribute@electrons{1}{32}{11.25}{6}%
+ \@bohr@distribute@electrons{1}{2}{180}{1}%
+ \@bohr@distribute@electrons{1}{8}{45}{2}%
+ \@bohr@distribute@electrons{1}{8}{45}{3}%
+ \@bohr@distribute@electrons{1}{18}{20}{4}%
+ \@bohr@distribute@electrons{1}{18}{20}{5}%
+ \@bohr@distribute@electrons{1}{32}{11.25}{6}%
\ifnum#1<113\relax
\@bohr@distribute@electrons{1}{#1-86}{11.25}{7}%
\else
\@bohr@distribute@electrons{1}{26}{11.25}{7}%
- \@bohr@warning{I only know atoms up to 112 (Copernicium). You
- gave me #1 so I am using 112 instead.}
+ \@bohr@warning{%
+ I only know atoms up to 112 (Copernicium). You gave me
+ #1 so I am using 112 instead.%
+ }%
\fi
\fi
\fi
@@ -226,11 +300,86 @@
}
% --------------------------------------------------------------------------
+% electron distribution per electron number
+\newrobustcmd*\DeclareElectronDistribution[2]{%
+ \@bohr@define@electron@distribution{#1}{#2}%
+}
+\newrobustcmd*\@bohr@define@electron@distribution[2]{%
+ \csdef{@bohr@electron@distribution@\romannumeral#1}{#2}%
+}
+
+\newcounter{@bohr@shell@number}
+
+\newrobustcmd*\@bohr@draw@electrons@quantum[1]{%
+ \cnltx@expandargs(x)\@bohr@get@shell@electrons
+ {\csuse{@bohr@electron@distribution@\romannumeral#1}}%
+}
+
+\newrobustcmd*\@bohr@get@shell@electrons[1]{%
+ % \def\x{#1}\show\x
+ \setcounter{@bohr@shell@number}{0}%
+ \forcsvlist{\@bohr@draw@shell@electrons}{#1}%
+}
+
+\newrobustcmd*\@bohr@draw@shell@electrons[1]{%
+ \stepcounter{@bohr@shell@number}%
+ \ifnum\value{@bohr@shell@number}=1\relax % n=1
+ \@bohr@distribute@electrons{1}{#1}{180}{1}%
+ \fi
+ \ifnum\value{@bohr@shell@number}=2\relax % n=2
+ \@bohr@distribute@electrons{1}{#1}{45}{2}%
+ \fi
+ \ifnum\value{@bohr@shell@number}=3\relax % n=3
+ \ifnum#1<9\relax
+ \@bohr@distribute@electrons{1}{#1}{45}{3}%
+ \else
+ \@bohr@distribute@electrons{1}{#1}{20}{3}%
+ \fi
+ \fi
+ \ifnum\value{@bohr@shell@number}=4\relax % n=4
+ \ifnum#1<9\relax
+ \@bohr@distribute@electrons{1}{#1}{45}{4}%
+ \else
+ \ifnum#1<18\relax
+ \@bohr@distribute@electrons{1}{#1}{20}{4}%
+ \else
+ \@bohr@distribute@electrons{1}{#1}{11.25}{4}%
+ \fi
+ \fi
+ \fi
+ \ifnum\value{@bohr@shell@number}=5\relax % n=5
+ \ifnum#1<9\relax
+ \@bohr@distribute@electrons{1}{#1}{45}{5}%
+ \else
+ \ifnum#1<18\relax
+ \@bohr@distribute@electrons{1}{#1}{20}{5}%
+ \else
+ \@bohr@distribute@electrons{1}{#1}{11.25}{5}%
+ \fi
+ \fi
+ \fi
+ \ifnum\value{@bohr@shell@number}=6\relax % n=6
+ \ifnum#1<9\relax
+ \@bohr@distribute@electrons{1}{#1}{45}{6}%
+ \else
+ \ifnum#1<18\relax
+ \@bohr@distribute@electrons{1}{#1}{20}{6}%
+ \else
+ \@bohr@distribute@electrons{1}{#1}{11.25}{6}%
+ \fi
+ \fi
+ \fi
+ \ifnum\value{@bohr@shell@number}=7\relax % n=7
+ \@bohr@distribute@electrons{1}{#1}{180}{7}%
+ \fi
+}
+
+% --------------------------------------------------------------------------
% atomic numbers and element symbols and names
-\def\@bohr@define@atom@symbol#1#2{%
+\newrobustcmd*\@bohr@define@atom@symbol[2]{%
\csdef{@bohr@atom@symbol@num@\romannumeral#1}{#2}%
\lowercase{\csdef{@bohr@atom@number@#2}}{#1}}
-\def\@bohr@define@atom@name#1#2#3{%
+\newrobustcmd*\@bohr@define@atom@name[3]{%
\csdef{@bohr@atom@name@\romannumeral#1}{#2}%
\lowercase{\csdef{@bohr@atom@name@num@#3}}{#1}}
@@ -246,24 +395,24 @@
\newrobustcmd*\DeclareAtomSymbol[2]{%
\@bohr@define@atom@symbol{#1}{#2}}
-\def\@bohr@get@atom@symbol#1{%
+\newcommand*\@bohr@get@atom@symbol[1]{%
\csuse{@bohr@atom@symbol@num@\romannumeral#1}}
-\def\@bohr@get@atom@number#1{%
+\newcommand*\@bohr@get@atom@number[1]{%
\lowercase{\csuse{@bohr@atom@number@#1}}}
-\def\@bohr@get@atom@name#1{%
+\newcommand*\@bohr@get@atom@name[1]{%
\csuse{@bohr@atom@name@\romannumeral#1}}
-\def\@bohr@element@symbol#1{%
+\newcommand*\@bohr@element@symbol[1]{%
\lowercase{\ifcsdef{@bohr@atom@name@num@#1}}
{\lowercase{\@bohr@get@atom@symbol{\csuse{@bohr@atom@name@num@#1}}}}
{\@bohr@get@atom@symbol{#1}}}
-\def\@bohr@atomic@number#1{%
+\newcommand*\@bohr@atomic@number[1]{%
\lowercase{\ifcsdef{@bohr@atom@number@#1}}
{\@bohr@get@atom@number{#1}}
{\lowercase{\csuse{@bohr@atom@name@num@#1}}}}
-\def\@bohr@elemt@symbol#1{%
+\newcommand*\@bohr@elemt@symbol[1]{%
\if!\ifnum9<1#1!\@bohr@get@atom@name{#1}\fi
\else
\lowercase{\@bohr@get@atom@name{\csuse{@bohr@atom@number@#1}}}%
@@ -387,76 +536,143 @@
\DeclareAtomSymbol{111}{Rg}
\DeclareAtomSymbol{112}{Cn}
-% element names are defined in bohr_elements_english.def or
-% bohr_elements_german.def, respectively. Now we need to decide
-% which ones we want
-\AfterEndPreamble{
-\ifdef\bbl@afterfi{}{\long\def\bbl@afterfi#1{\fi#1}}
-\ifboolexpr
- {
- test {\iflanguage{german}} or
- test {\iflanguage{ngerman}}
- }
- {\booltrue{bohr@german}}{}
-\ifbool{bohr@german}
- {\input{bohr_elements_german.def}}
- {\input{bohr_elements_english.def}}
-}
-
+% period 1
+\DeclareElectronDistribution{1}{1}
+\DeclareElectronDistribution{2}{2}
+% period 2
+\DeclareElectronDistribution{3}{2,1}
+\DeclareElectronDistribution{4}{2,2}
+\DeclareElectronDistribution{5}{2,3}
+\DeclareElectronDistribution{6}{2,4}
+\DeclareElectronDistribution{7}{2,6}
+\DeclareElectronDistribution{8}{2,6}
+\DeclareElectronDistribution{9}{2,7}
+\DeclareElectronDistribution{10}{2,8}
+% period 3
+\DeclareElectronDistribution{11}{2,8,1}
+\DeclareElectronDistribution{12}{2,8,2}
+\DeclareElectronDistribution{13}{2,8,3}
+\DeclareElectronDistribution{14}{2,8,4}
+\DeclareElectronDistribution{15}{2,8,5}
+\DeclareElectronDistribution{16}{2,8,6}
+\DeclareElectronDistribution{17}{2,8,7}
+\DeclareElectronDistribution{18}{2,8,8}
+% period 4
+\DeclareElectronDistribution{19}{2,8,8,1}
+\DeclareElectronDistribution{20}{2,8,8,2}
+\DeclareElectronDistribution{21}{2,8,9,2}
+\DeclareElectronDistribution{22}{2,8,10,2}
+\DeclareElectronDistribution{23}{2,8,11,2}
+\DeclareElectronDistribution{24}{2,8,13,1}
+\DeclareElectronDistribution{25}{2,8,13,2}
+\DeclareElectronDistribution{26}{2,8,14,2}
+\DeclareElectronDistribution{27}{2,8,15,2}
+\DeclareElectronDistribution{28}{2,8,16,2}
+\DeclareElectronDistribution{29}{2,8,18,1}
+\DeclareElectronDistribution{30}{2,8,18,2}
+\DeclareElectronDistribution{31}{2,8,18,3}
+\DeclareElectronDistribution{32}{2,8,18,4}
+\DeclareElectronDistribution{33}{2,8,18,5}
+\DeclareElectronDistribution{34}{2,8,18,6}
+\DeclareElectronDistribution{35}{2,8,18,7}
+\DeclareElectronDistribution{36}{2,8,18,8}
+% period 5
+\DeclareElectronDistribution{37}{2,8,18,8,1}
+\DeclareElectronDistribution{38}{2,8,18,8,2}
+\DeclareElectronDistribution{39}{2,8,18,9,2}
+\DeclareElectronDistribution{40}{2,8,18,10,2}
+\DeclareElectronDistribution{41}{2,8,18,12,1}
+\DeclareElectronDistribution{42}{2,8,18,13,1}
+\DeclareElectronDistribution{43}{2,8,18,14,1}
+\DeclareElectronDistribution{44}{2,8,18,15,1}
+\DeclareElectronDistribution{45}{2,8,18,16,1}
+\DeclareElectronDistribution{46}{2,8,18,18}
+\DeclareElectronDistribution{47}{2,8,18,18,1}
+\DeclareElectronDistribution{48}{2,8,18,18,2}
+\DeclareElectronDistribution{49}{2,8,18,18,3}
+\DeclareElectronDistribution{50}{2,8,18,18,4}
+\DeclareElectronDistribution{51}{2,8,18,18,5}
+\DeclareElectronDistribution{52}{2,8,18,18,6}
+\DeclareElectronDistribution{53}{2,8,18,18,7}
+\DeclareElectronDistribution{54}{2,8,18,18,8}
+% period 6
+\DeclareElectronDistribution{55}{2,8,18,18,8,1}
+\DeclareElectronDistribution{56}{2,8,18,18,8,2}
+\DeclareElectronDistribution{57}{2,8,18,18,9,2}
+\DeclareElectronDistribution{58}{2,8,18,20,8,2}
+\DeclareElectronDistribution{59}{2,8,18,21,8,2}
+\DeclareElectronDistribution{60}{2,8,18,22,8,2}
+\DeclareElectronDistribution{61}{2,8,18,23,8,2}
+\DeclareElectronDistribution{62}{2,8,18,24,8,2}
+\DeclareElectronDistribution{63}{2,8,18,25,8,2}
+\DeclareElectronDistribution{64}{2,8,18,25,9,2}
+\DeclareElectronDistribution{65}{2,8,18,27,8,2}
+\DeclareElectronDistribution{66}{2,8,18,28,8,2}
+\DeclareElectronDistribution{67}{2,8,18,29,8,2}
+\DeclareElectronDistribution{68}{2,8,18,30,8,2}
+\DeclareElectronDistribution{69}{2,8,18,31,8,2}
+\DeclareElectronDistribution{70}{2,8,18,32,8,2}
+\DeclareElectronDistribution{71}{2,8,18,32,9,2}
+\DeclareElectronDistribution{72}{2,8,18,32,10,2}
+\DeclareElectronDistribution{73}{2,8,18,32,11,2}
+\DeclareElectronDistribution{74}{2,8,18,32,12,2}
+\DeclareElectronDistribution{75}{2,8,18,32,13,2}
+\DeclareElectronDistribution{76}{2,8,18,32,14,2}
+\DeclareElectronDistribution{77}{2,8,18,32,15,2}
+\DeclareElectronDistribution{78}{2,8,18,32,17,1}
+\DeclareElectronDistribution{79}{2,8,18,32,18,1}
+\DeclareElectronDistribution{80}{2,8,18,32,18,2}
+\DeclareElectronDistribution{81}{2,8,18,32,18,3}
+\DeclareElectronDistribution{82}{2,8,18,32,18,4}
+\DeclareElectronDistribution{83}{2,8,18,32,18,5}
+\DeclareElectronDistribution{84}{2,8,18,32,18,6}
+\DeclareElectronDistribution{85}{2,8,18,32,18,7}
+\DeclareElectronDistribution{86}{2,8,18,32,18,8}
+% period 7
+\DeclareElectronDistribution{87}{2,8,18,32,18,8,1}
+\DeclareElectronDistribution{88}{2,8,18,32,18,8,2}
+\DeclareElectronDistribution{89}{2,8,18,32,18,9,2}
+\DeclareElectronDistribution{90}{2,8,18,32,18,10,2}
+\DeclareElectronDistribution{91}{2,8,18,32,20,9,2}
+\DeclareElectronDistribution{92}{2,8,18,32,21,9,2}
+\DeclareElectronDistribution{93}{2,8,18,32,22,9,2}
+\DeclareElectronDistribution{94}{2,8,18,32,24,8,2}
+\DeclareElectronDistribution{95}{2,8,18,32,25,8,2}
+\DeclareElectronDistribution{96}{2,8,18,32,25,9,2}
+\DeclareElectronDistribution{97}{2,8,18,32,27,8,2}
+\DeclareElectronDistribution{98}{2,8,18,32,28,8,2}
+\DeclareElectronDistribution{99}{2,8,18,32,29,8,2}
+\DeclareElectronDistribution{100}{2,8,18,32,30,8,2}
+\DeclareElectronDistribution{101}{2,8,18,32,31,8,2}
+\DeclareElectronDistribution{102}{2,8,18,32,32,8,2}
+\DeclareElectronDistribution{103}{2,8,18,32,32,9,2}
+\DeclareElectronDistribution{104}{2,8,18,32,32,10,2}
+\DeclareElectronDistribution{105}{2,8,18,32,32,11,2}
+\DeclareElectronDistribution{106}{2,8,18,32,32,12,2}
+\DeclareElectronDistribution{107}{2,8,18,32,32,13,2}
+\DeclareElectronDistribution{108}{2,8,18,32,32,14,2}
+\DeclareElectronDistribution{109}{2,8,18,32,32,15,2}
+\DeclareElectronDistribution{110}{2,8,18,32,32,17,1}
+\DeclareElectronDistribution{111}{2,8,18,32,32,18,1}
+\DeclareElectronDistribution{112}{2,8,18,32,32,18,2}
% --------------------------------------------------------------------------
-% options
-\def\@bohr@name@options{}
-\def\@bohr@write@atom#1{#1}
-\def\@bohr@nucleus@radius{1em}
-\def\@bohr@electron@options{blue!50!black!50}
-\def\@bohr@electron@radius{1.5pt}
-\def\@bohr@shell@dist{1em}
-\def\@bohr@nucleus@options{draw=black!80,fill=black!10,opacity=.25}
-\def\@bohr@shell@options{draw=blue!75,thin}
-
-\newbool{bohr@insert@symbol}
-\newbool{bohr@insert@number}
-\newbool{bohr@german}
-
-\def\@bohr@insert@symbol#1#2{%
- \ifbool{bohr@insert@symbol}
- {\ifblank{#2}{\@bohr@get@atom@symbol{#1}}{\@bohr@write@atom{#2}}}
- {\@bohr@write@atom{#2}}}
-
-\pgfkeys{
- bohr/.cd,
- insert-symbol/.is if = bohr@insert@symbol ,
- insert-number/.is if = bohr@insert@number ,
- insert-missing/.is choice,
- insert-missing/true/.code =
- \booltrue{bohr@insert@symbol}\booltrue{bohr@insert@number} ,
- insert-missing/false/.code =
- \boolfalse{bohr@insert@symbol}\boolfalse{bohr@insert@number} ,
- insert-missing/.default = true ,
- atom-style/.code = \def\@bohr@write@atom{#1} ,
- name-options-set/.code = \def\@bohr@name@options{#1} ,
- name-options-add/.code =
- \expandafter\def\expandafter\@bohr@name@options\expandafter{\@bohr@name@options,#1} ,
- nucleus-radius/.code = \def\@bohr@nucleus@radius{#1} ,
- nucleus-options-set/.code = \def\@bohr@nucleus@options{#1} ,
- nucleus-options-add/.code =
- \expandafter\def\expandafter\@bohr@nucleus@options\expandafter{\@bohr@nucleus@options,#1} ,
- electron-radius/.code = \def\@bohr@electron@radius{#1} ,
- electron-options-set/.code = \def\@bohr@electron@options{#1} ,
- electron-options-add/.code =
- \expandafter\def\expandafter\@bohr@electron@options\expandafter{\@bohr@electron@options,#1} ,
- shell-dist/.code = \def\@bohr@shell@dist{#1} ,
- shell-options-set/.code = \def\@bohr@shell@options{#1} ,
- shell-options-add/.code =
- \expandafter\def\expandafter\@bohr@shell@options\expandafter{\@bohr@shell@options,#1} ,
- german/.is if = bohr@german ,
- ngerman/.is if = bohr@german
+% extandable language settings
+\RequirePackage{translations}
+\AfterEndPreamble{
+ % this will load a file `bohr_elements_<lang>.def', <lang> is a
+ % `translations' base language
+ % currently only German and English are available, English being the
+ % fallback; other languages are added by providing the corresponding file
+ \ifdef\@bohr@language
+ {\edef\@bohr@language{\@trnslt@language{\@bohr@language}}}
+ {\def\@bohr@language{\@trnslt@language{\@trnslt@current@language}}}
+ \InputIfFileExists
+ {bohr_elements_\@bohr@language.def}
+ {}
+ {\input{bohr_elements_english.def}}
}
-\newrobustcmd\setbohr[1]{\pgfqkeys{/bohr}{#1}}
-
-\ProcessPgfOptions*
\endinput
% HISTORY
@@ -465,4 +681,9 @@
- added the commands \elementname and \elementsymbol with
language support German and English
- improved error checking
-2012/12/30 v0.2c - bug fixes in error checking \ No newline at end of file
+2012/12/30 v0.2c - bug fixes in error checking
+2013/07/25 v0.2d - bug fix in warning message
+ - added missing \@bohr@write@atom to \@bohr@insert@symbol
+ - extended language support, added french element names
+ - corrected name of Praseodynium
+2013/11/?? v0.3 - draw shell electrons according to main quantum number