Re: [NTG-context] Nuclear reactions

2023-04-16 Thread Alan Braslau via ntg-context
On Sat, 15 Apr 2023 12:02:28 -0600
Gavin via ntg-context  wrote:

> Hi List,
> 
> I am still interested in knowing if there is a good way to do nuclear
> reactions using \chemical.

>From the chemical manual:

As in mathematical typesetting mode, subscripts and superscripts can
precede text. Thus, isotopes (such as this alpha particle, for
example), can be written as: \chemical{^4_2He^{2+}}. But compare the
alignment of \chemical{_{92}^{238}U} with
\chemical{\lohi[left]{92}{238}U}.

I have not used chemical formulas for some time, but

\chemical{^{235)_{92}U,+,$n$,->,^{94}_{38}Sr,+,^{140}_{54}Xe,+,$2n$}

"->" and "GIVES" are synonyms, as are "+" and "PLUS"
(also MINUS, SINGLE, DOUBLE, TRIPLE, EQUILIBRIUM, MESOMERIC with ascii
and unicode synonyms).

Alignment can be altered using \lohi[left]{92}{235} 
(remember left is flushright)


There is also "display mode" for chemical formulae:

\startchemicalformula
\chemical{text}
\chemical{text}{below}
\chemical{text}{above}{below}
\stopchemicalformula

where above and below can be used for labels, etc.

Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Nuclear reactions

2023-04-16 Thread Tomáš Hála via ntg-context
Hi Gavin,

maybe you have solved your problem yet.

\startformula
 {\null}^^{194}__{38}{\rm Sr}
or  {\hbox{Xe}}^^{140}__{54}.
\stopformula

Better, ConTeXt way could be the variation on \chem:

\unexpanded\def\isotope#1#2#3{\dontleavehmode\begingroup\null\lohi[left]{#2}{#3}#1\endgroup}
\isotope{Sr}{38}{194}
or (with more logical order of parameters)
\unexpanded\def\isotope#1#2#3{\dontleavehmode\begingroup\null\lohi[left]{#1}{#2}#3\endgroup}
\isotope{38}{999}{Sr}

Or for text and math modes together:

\unexpanded\def\isotope#1#2#3{%
\ifmmode\begingroup\null^^{#1}__{#2}{\rm#3}\endgroup%
   \else\dontleavehmode\begingroup\null\lohi[left]{\tfx 
#1}{\tfx#2}\rm#3\endgroup%
\fi}

\isotope{999}{38}{Sr}
\startformula
\isotope{999}{38}{Sr}
\stopformula

You can do it either way, whichever way suits you better.

Tomáš



Od: ntg-context  za uživatele Hans Åberg via 
ntg-context 
Odesláno: sobota 15. dubna 2023 22:41
Komu: mailing list for ConTeXt users 
Kopie: Hans Åberg 
Předmět: Re: [NTG-context] Nuclear reactions


> On 15 Apr 2023, at 19:19, Gavin via ntg-context  wrote:
>
> I’m writing nuclear reactions. When add prescripts to atomic symbols with two 
> letters, (Be, Sr, Xe, etc.) the prescripts split the atoms!

One can use Unicode superscript and subscript numbers, as in ²³⁵₉₂U, which is 
easier to read. For input, an editor supporting text substitutions might be 
used.


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Nuclear reactions

2023-04-15 Thread Hans Åberg via ntg-context

> On 15 Apr 2023, at 19:19, Gavin via ntg-context  wrote:
> 
> I’m writing nuclear reactions. When add prescripts to atomic symbols with two 
> letters, (Be, Sr, Xe, etc.) the prescripts split the atoms!

One can use Unicode superscript and subscript numbers, as in ²³⁵₉₂U, which is 
easier to read. For input, an editor supporting text substitutions might be 
used.


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Nuclear reactions

2023-04-15 Thread Gavin via ntg-context
Hi List,

I am still interested in knowing if there is a good way to do nuclear reactions 
using \chemical. But I found something that works for my current needs:

\define[1]\Sr{\mathord{\rm Sr}__{38}^^{#1}}
\define[1]\Xe{\mathord{\rm Xe}__{54}^^{#1}}
\define[1]\U{\mathord{\rm U}__{92}^^{#1}}

\starttext
Reaction:
\startformula
  \U{235} + n \rightarrow \Sr{94} + \Xe{140} + 2n
\stopformula 
\stoptext

Since I will be writing many reactions with a dozen or so different atomic 
symbols, it makes sense to create a command for each atomic symbol that adds 
the correct atomic number and takes the mass number as an argument.

Hope someone else can benefit. I still getting used to ConTeXt's treatment of 
{…}, which does not appear to be TeX's way.

Gavin


> On Apr 15, 2023, at 11:19 AM, Gavin  wrote:
> 
> Hi list,
> 
> I’m writing nuclear reactions. When add prescripts to atomic symbols with two 
> letters, (Be, Sr, Xe, etc.) the prescripts split the atoms! (See output 
> below.) 
> 
> \starttext
> Text:   \lohi[left]{4}{10}Be.
> Reaction:
> \startformula
>  {\rm U}^^{235}__{92} + n \rightarrow {\rm Sr}^^{94}__{38} + {\rm 
> Xe}^^{140}__{54} + 2n
> \stopformula 
> \stoptext
> 
> I looked at \chemical and \molecule, but could not find a way to make 
> isotopes with those. Any ideas?
> 
> Gavin
> 
> 

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___