From: Hans Hagen <j.hagen@xs4all.nl>
To: ntg-context@ntg.nl
Subject: [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt
Date: Wed, 30 Oct 2024 21:41:11 +0100 [thread overview]
Message-ID: <10744aee-0990-47d4-95a3-0abc14a4fb32@xs4all.nl> (raw)
In-Reply-To: <ac22ae55-f282-cc1c-94dd-a169dc2558a9@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 485 bytes --]
On 10/30/2024 9:35 PM, Wolfgang Schuster wrote:
> \starttexdefinition protected tolerant electrons #=#=
ok, can you check the attached 'module'
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
[-- Attachment #2: m-electrons.mkxl --]
[-- Type: text/plain, Size: 2625 bytes --]
%D \module
%D [ file=m-electrons,
%D version=2024.10.30,
%D title=\CONTEXT\ Extra Modules,
%D subtitle=messing with electrons,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={\CONTEXT\ Development Team}]
% This is a follow up on mails to the list by Jorge and Bruce.
\startmodule [m-electrons]
\unprotect
\installcorenamespace {electrons}
\installcommandhandler \??electrons {electrons} \??electrons
\setupelectrons
[\c!textstyle=\tfxx,
\c!distance=.5\strutdp,
\c!depth=.5\strutdp]
\starttexdefinition tolerant protected electrons[#1]#*#:#=#=
\dontleavehmode
\begingroup
\ifparameter#2\or
\cdef\currentelectrons{#1}%
\fi
\setbox\scratchboxone\hpack\bgroup
\doloopovermatch {.} {#2} {
\framed
[\c!strut=\v!no,
\c!width=\lineheight,
\c!height=\lineheight]
{\useelectronsstyleandcolor\c!style\c!color
\symbol[electron##1]}
\hskip-\linewidth
}
\unskip
\egroup
\ifparameter#3\or
\setbox\scratchboxtwo\hbox to \wd\scratchboxone\bgroup
\useelectronsstyleandcolor\c!textstyle\c!textcolor
\setstrut\strut
\hss#3\hss
\egroup
\setbox\scratchboxone\hpack \bgroup
\box\scratchboxone
\hkern-\wd\scratchboxtwo
\boxymove\scratchboxtwo\dimexpr
-\htdp\scratchboxtwo
+\electronsparameter\c!distance
\relax
\box\scratchboxtwo
\egroup
\fi
\boxymove\scratchboxone-\electronsparameter\c!depth
\box\scratchboxone
\endgroup
\stoptexdefinition
\definesymbol[electronu][\m{\upharpoonleft}]
\definesymbol[electrond][\m{\downharpoonright}]
\definesymbol[electronb][\m{\upharpoonleft\downharpoonright}]
\definesymbol[electronB][\m{\darkred \symbol[electronb]}]
\definesymbol[electronD][\m{\darkblue\symbol[electrond]}]
\stopmodule
\protect
\continueifinputfile{m-electrons.mkxl}
\usemodule[scite]
\starttext
\startTEXpage[offset=1cm,width=17cm]
\startbuffer[b]
Nitrogen: \electrons{b}{1s} \electrons{b}{2s} \electrons{uuu}{2p}
Nitrogen: \electrons{b}{} \electrons{B}{} \electrons{uDu}{}
\defineelectrons [nitrogen]
\setupelectrons [nitrogen] [color=darkgreen]
Nitrogen:
\electrons[nitrogen]{b}{}
\electrons[nitrogen]{B}{}
\electrons[nitrogen]{uDu}{2p}
\stopbuffer
\typebuffer[b][option=TEX]
\getbuffer[b]
\stopTEXpage
\setuplayout[tight]
\typefile[option=TEX]{m-electrons.mkxl}
\stoptext
[-- Attachment #3: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2024-10-30 20:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5e4e292b-6d11-4b37-b00d-2e1aefdfe4b6@Spark>
2024-10-29 22:33 ` [NTG-context] " Jorge Manuel
2024-10-29 23:22 ` [NTG-context] " Hans Hagen
2024-10-30 0:21 ` Bruce Horrocks
2024-10-30 10:14 ` Hans Hagen
2024-10-30 10:25 ` Hans Hagen
2024-10-30 20:35 ` Wolfgang Schuster
2024-10-30 20:41 ` Hans Hagen [this message]
2024-10-30 21:07 ` Wolfgang Schuster
2024-10-30 21:45 ` Hans Hagen
2024-10-31 11:34 ` Bruce Horrocks
2024-10-31 12:13 ` Hans Hagen via ntg-context
2024-10-31 15:25 ` Jorge Manuel
2024-10-31 15:28 ` Hans Hagen via ntg-context
2024-10-31 15:47 ` Henning Hraban Ramm
2024-10-31 16:39 ` vm via ntg-context
2024-10-31 17:02 ` Henning Hraban Ramm
2024-10-31 17:38 ` vm via ntg-context
2024-10-31 18:01 ` Henning Hraban Ramm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=10744aee-0990-47d4-95a3-0abc14a4fb32@xs4all.nl \
--to=j.hagen@xs4all.nl \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).