ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Nuclear reactions
@ 2023-04-15 17:19 Gavin via ntg-context
  2023-04-15 18:02 ` Gavin via ntg-context
  2023-04-15 20:41 ` Hans Åberg via ntg-context
  0 siblings, 2 replies; 5+ messages in thread
From: Gavin via ntg-context @ 2023-04-15 17:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Gavin

[-- Attachment #1: Type: text/plain, Size: 477 bytes --]

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


[-- Attachment #2: PastedGraphic-1.pdf --]
[-- Type: application/pdf, Size: 8484 bytes --]

[-- Attachment #3: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [NTG-context] Nuclear reactions
  2023-04-15 17:19 [NTG-context] Nuclear reactions Gavin via ntg-context
@ 2023-04-15 18:02 ` Gavin via ntg-context
  2023-04-16 17:22   ` Alan Braslau via ntg-context
  2023-04-15 20:41 ` Hans Åberg via ntg-context
  1 sibling, 1 reply; 5+ messages in thread
From: Gavin via ntg-context @ 2023-04-15 18:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Gavin

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 <gavinpublic@comcast.net> 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
> 
> <PastedGraphic-1.pdf>

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [NTG-context] Nuclear reactions
  2023-04-15 17:19 [NTG-context] Nuclear reactions Gavin via ntg-context
  2023-04-15 18:02 ` Gavin via ntg-context
@ 2023-04-15 20:41 ` Hans Åberg via ntg-context
  2023-04-16  8:36   ` Tomáš Hála via ntg-context
  1 sibling, 1 reply; 5+ messages in thread
From: Hans Åberg via ntg-context @ 2023-04-15 20:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Åberg


> On 15 Apr 2023, at 19:19, Gavin via ntg-context <ntg-context@ntg.nl> 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [NTG-context] Nuclear reactions
  2023-04-15 20:41 ` Hans Åberg via ntg-context
@ 2023-04-16  8:36   ` Tomáš Hála via ntg-context
  0 siblings, 0 replies; 5+ messages in thread
From: Tomáš Hála via ntg-context @ 2023-04-16  8:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Tomáš Hála


[-- Attachment #1.1: Type: text/plain, Size: 2095 bytes --]

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 <ntg-context-bounces@ntg.nl> za uživatele Hans Åberg via ntg-context <ntg-context@ntg.nl>
Odesláno: sobota 15. dubna 2023 22:41
Komu: mailing list for ConTeXt users <ntg-context@ntg.nl>
Kopie: Hans Åberg <haberg-1@telia.com>
Předmět: Re: [NTG-context] Nuclear reactions


> On 15 Apr 2023, at 19:19, Gavin via ntg-context <ntg-context@ntg.nl> 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
___________________________________________________________________________________

[-- Attachment #1.2: Type: text/html, Size: 4600 bytes --]

[-- Attachment #2: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [NTG-context] Nuclear reactions
  2023-04-15 18:02 ` Gavin via ntg-context
@ 2023-04-16 17:22   ` Alan Braslau via ntg-context
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Braslau via ntg-context @ 2023-04-16 17:22 UTC (permalink / raw)
  To: Gavin via ntg-context; +Cc: Alan Braslau

On Sat, 15 Apr 2023 12:02:28 -0600
Gavin via ntg-context <ntg-context@ntg.nl> 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-16 17:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-15 17:19 [NTG-context] Nuclear reactions Gavin via ntg-context
2023-04-15 18:02 ` Gavin via ntg-context
2023-04-16 17:22   ` Alan Braslau via ntg-context
2023-04-15 20:41 ` Hans Åberg via ntg-context
2023-04-16  8:36   ` Tomáš Hála via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).