In one of the last posts I told you about my bohr package. In a comment the question came up how to draw Bohr models of atoms in an excited state. This made me thinking: should I improve the package adding support for this? And how should I do this regarding the syntax? As it is now the syntax does not easily allow to be extended for it. I can think of several approaches:
  • Introduce a new command, [cce inline=”true” lang=”latex”]\exbohr[/cce] say, that would be used for excited states. This would give me full freedom of choice for a suited syntax.
  • Introduce a starred variant [cce inline=”true” lang=”latex”]\bohr*[/cce] for excited states. While I like this version thinking that excited states in chemistry are also marked with a star this would either limit my choices for a syntax or violate what is LaTeX practice: if I use a completely different syntax for the starred variant the [cce inline=”true” lang=”latex”]\bohr[/cce] command wouldn’t follow most other LaTeX commands that have a starred variant.
  • Design [cce inline=”true” lang=”latex”]\bohr[/cce] completely new with a new syntax allowing both excited and non-excited states, switch package version from 0 to 1 and add a package option “compatibility” (or something) that allows for older documents still to be compiled correctly.
What do you think? Would such an improvement be useful? Which way regarding the syntax would you choose? Do you have another proposal for a syntax? Can you think of further features/improvements?

6 thoughts on “Improving bohr

  1. Svend Mortensen says:

    If you plan not to develop (but only do bug fixes) the package further, the first choice seems more than fine.

    If you, however, plan to develop the package further, then maybe the third/last choice is the best.

    1. cgnieder says:

      Thanks Svend! I’m not planning to abandon the package. Its use-case may be a niche but its features are not covered by any other package, except TikZ and PSTricks if one designs Bohr models from scratch (which isn’t too complicated, of course…).

      I also favour the third option but possibly breaking existing documents is not something I like to do very much…

      I’ll wait a few weeks for more opinions. 🙂

  2. mase says:

    It would be nice (e.g. for a test in chemistry class) to be able to replace the symbolname by the number of neutrons and protons (perhaps with empty space to fill in the symbolname)

    and

    just neutrons and an empty field to fill in the number of protons

    and

    no electrons, so pupils have to fill in the number or electrons.

    1. cgnieder says:

      Hi mase,

      Do you mean something like this:

      [cce lang=”latex”]\documentclass{article}
      \usepackage{bohr}
      \usepackage{multirow}
      \setbohr{nucleus-radius=1.2cm}

      \newcommand*\blank[1]{\underline{\hspace*{#1}}}
      \newcommand*\atomsymbol[3]{%
      \begingroup
      \huge
      \begin{tabular}{r@{\hskip.1em}l}
      \small\ifblank{#1}{\blank{.5cm}}{#1} &
      \multirow{3}{*}[.4em]{\ifblank{#3}{\blank{1cm}}{\scalebox{1.7}{#3}}} \\
      \small\ifblank{#2}{\blank{.5cm}}{#2} & \\
      \end{tabular}
      \endgroup
      }

      \begin{document}

      \bohr[4]{0}{\atomsymbol{12}{}{C}}

      \bohr[4]{0}{\atomsymbol{}{8}{}}

      \bohr[4]{0}{\atomsymbol{19}{}{}}

      \end{document}[/cce]

      Rendered by QuickLaTeX.com

  3. mase says:

    Yes, that is great!
    Thanks a lot. It would be great to have a field for the number of neutrons as in my second example below for the oxygen atom. I used the field for the atommass which does not look nice. The pupils don’t have to learn the number of nuclei or electrons by heart, so the numbers of the other particles have to be given like in the example below.

    [cce lang=”latex”]\documentclass{article}
    \usepackage{bohr,chemmacros}
    \usepackage{multirow}
    \setbohr{nucleus-radius=1.2cm}

    \newcommand*\blank[1]{\underline{\hspace*{#1}}}
    \newcommand*\atomsymbol[3]{%
    \begingroup
    \huge
    \begin{tabular}{r@{\hskip.1em}l}
    \small\ifblank{#1}{\blank{.5cm}}{#1} &
    \multirow{3}{*}[.4em]{\ifblank{#3}{\blank{1cm}}{\scalebox{1.7}{#3}}} \\
    \small\ifblank{#2}{\blank{.5cm}}{#2} & \\
    \end{tabular}
    \endgroup
    }

    \begin{document}

    \bohr[4]{6}{\atomsymbol{12}{\prt:\hspace*{3mm}}{C}}

    \bohr[4]{0}{\atomsymbol{\ntr: 16}{\prt: 8}{}}

    \bohr[4]{9}{\atomsymbol{19}{\prt:\hspace*{3mm}}{F}}

    \end{document}[/cce]

  4. mase says:

    Something like this, only nicer is what I’m looking for:

    [cce lang=”latex”]\documentclass{article}
    \usepackage{bohr,chemmacros}
    \usepackage{multirow}
    \setbohr{nucleus-radius=1.2cm}

    \newcommand*\blank[1]{\underline{\hspace*{#1}}}
    \newcommand*\atomsymbol[3]{%
    \begingroup
    \huge
    \begin{tabular}{r@{\hskip.1em}l}
    \small\ifblank{#1}{\blank{.5cm}}{#1} &
    \multirow{3}{*}[.4em]{\ifblank{#3}{\blank{1cm}}{\scalebox{1.7}{#3}}} \\
    \small\ifblank{#2}{\blank{.5cm}}{#2} & \\
    \end{tabular}
    \endgroup
    }

    \begin{document}

    \bohr[4]{9}{\atomsymbol{19}{\prt:\hspace*{3mm}\\ \ntr:\hspace*{3mm}}{F}}
    \end{document}[/cce]

Leave a Reply

Your email address will not be published. Required fields are marked *