* [NTG-context] Seeking Advice on Electron Configuration Notation in ConTeXt [not found] <5e4e292b-6d11-4b37-b00d-2e1aefdfe4b6@Spark> @ 2024-10-29 22:33 ` Jorge Manuel 2024-10-29 23:22 ` [NTG-context] " Hans Hagen 0 siblings, 1 reply; 18+ messages in thread From: Jorge Manuel @ 2024-10-29 22:33 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 789 bytes --] Hello everyone, I’m searching for an efficient way to represent electronic configurations in subshell and orbital notation within ConTeXt. I found similar examples discussed on StackExchange, which you can see here: Atomic electronic configuration with small boxes: https://tex.stackexchange.com/questions/372581/atomic-electronic-configuration-with-small-boxes/372598#372598 Box and arrow notation of writing electron configuration https://tex.stackexchange.com/questions/616989/box-and-arrow-notation-of-writing-electron-configuration Ideally, I’d like to use a package similar to atoms.sty for this purpose. Does anyone know of a straightforward approach to achieve this in ConTeXt? Thank you very much for any guidance or examples! Best regards, Jorge [-- Attachment #1.2: Type: text/html, Size: 1811 bytes --] [-- Attachment #2: 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 2024-10-29 22:33 ` [NTG-context] Seeking Advice on Electron Configuration Notation in ConTeXt Jorge Manuel @ 2024-10-29 23:22 ` Hans Hagen 2024-10-30 0:21 ` Bruce Horrocks 0 siblings, 1 reply; 18+ messages in thread From: Hans Hagen @ 2024-10-29 23:22 UTC (permalink / raw) To: Jorge Manuel, mailing list for ConTeXt users On 10/29/2024 11:33 PM, Jorge Manuel wrote: > Hello everyone, > > I’m searching for an efficient way to represent electronic > configurations in subshell and orbital notation within ConTeXt. I found > similar examples discussed on StackExchange, which you can see here: > > Atomic electronic configuration with small boxes <https:// > tex.stackexchange.com/questions/372581/atomic-electronic-configuration- > with-small-boxes/372598#372598>: https://tex.stackexchange.com/ > questions/372581/atomic-electronic-configuration-with-small- > boxes/372598#372598 <https://tex.stackexchange.com/questions/372581/ > atomic-electronic-configuration-with-small-boxes/372598#372598> > > Box and arrow notation of writing electron configuration > https://tex.stackexchange.com/questions/616989/box-and-arrow-notation- > of-writing-electron-configuration <https://tex.stackexchange.com/ > questions/616989/box-and-arrow-notation-of-writing-electron-configuration> > > Ideally, I’d like to use a package similar to atoms.sty for this > purpose. Does anyone know of a straightforward approach to achieve this > in ConTeXt? > > Thank you very much for any guidance or examples! It's no problem to come up with something as this kind of stuff is rather trivial but (as always with these things in context) the question is "what is the nicest interface?". \definesymbol[electronu][\m{\upharpoonleft}] \definesymbol[electrond][\m{\downharpoonright}] \definesymbol[electronb][\m{\upharpoonleft\downharpoonright}] \starttexdefinition protected electrons#1 \dontleavehmode \doloopovermatch {.} {#1} { \inframed [width=\lineheight,height=\lineheight] {\symbol[electron##1]} \hskip-\linewidth } \unskip \stoptexdefinition \electrons{bddb} \electrons{uddbuud} Don't look at other packages, just think about what is best and most natural for the field, reading the source, and intreface wise fits into context (looks ok in the source, not like some hack). The above is just an example. We can always make clever parsers in lua but we need specs and examples first. Like, do you want to color specific electrons? Maybe this is enough: \definesymbol[electronB][\m{\red \symbol[electronb]}] \definesymbol[electronD][\m{\blue\symbol[electrond]}] \electrons{uddBbuDd} 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 ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 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 0 siblings, 2 replies; 18+ messages in thread From: Bruce Horrocks @ 2024-10-30 0:21 UTC (permalink / raw) To: ntg-context mailing list > On 29 Oct 2024, at 23:22, Hans Hagen <j.hagen@xs4all.nl> wrote: > > On 10/29/2024 11:33 PM, Jorge Manuel wrote: >> Hello everyone, >> I’m searching for an efficient way to represent electronic configurations in subshell and orbital notation within ConTeXt. I found similar examples discussed on StackExchange, which you can see here: >> Atomic electronic configuration with small boxes <https:// tex.stackexchange.com/questions/372581/atomic-electronic-configuration- with-small-boxes/372598#372598>: https://tex.stackexchange.com/ questions/372581/atomic-electronic-configuration-with-small- boxes/372598#372598 <https://tex.stackexchange.com/questions/372581/ atomic-electronic-configuration-with-small-boxes/372598#372598> >> Box and arrow notation of writing electron configuration >> https://tex.stackexchange.com/questions/616989/box-and-arrow-notation- of-writing-electron-configuration <https://tex.stackexchange.com/ questions/616989/box-and-arrow-notation-of-writing-electron-configuration> >> Ideally, I’d like to use a package similar to atoms.sty for this purpose. Does anyone know of a straightforward approach to achieve this in ConTeXt? >> Thank you very much for any guidance or examples! > > It's no problem to come up with something as this kind of stuff is rather trivial but (as always with these things in context) the question is "what is the nicest interface?". > > \definesymbol[electronu][\m{\upharpoonleft}] > \definesymbol[electrond][\m{\downharpoonright}] > \definesymbol[electronb][\m{\upharpoonleft\downharpoonright}] > > \starttexdefinition protected electrons#1 > \dontleavehmode > \doloopovermatch {.} {#1} { > \inframed > [width=\lineheight,height=\lineheight] > {\symbol[electron##1]} > \hskip-\linewidth > } > \unskip > \stoptexdefinition > > \electrons{bddb} > > \electrons{uddbuud} > > Don't look at other packages, just think about what is best and most natural for the field, reading the source, and intreface wise fits into context (looks ok in the source, not like some hack). The above is just an example. We can always make clever parsers in lua but we need specs and examples first. Like, do you want to color specific electrons? Maybe this is enough: > > \definesymbol[electronB][\m{\red \symbol[electronb]}] > \definesymbol[electronD][\m{\blue\symbol[electrond]}] > > \electrons{uddBbuDd} > > 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 > ----------------------------------------------------------------- Also, as per the images in the StackExchange question, try adding this to the previous example: %% start %% Nitrogen: \vbox to \lineheight{\placeontopofeachother{\electrons{b}}{\tfx 1s}} \vbox to \lineheight{\placeontopofeachother{\electrons{b}}{\tfx 2s}} \vbox to \lineheight{\placeontopofeachother{\electrons{uuu}}{\tfx 2p}} %% end %% As Hans says, a parser is relatively easy, so the above can be made much less verbose if the layout is suitable. I think the message is: you don’t need to blindly copy \subshells if there is something easier to enter with less chance of error. Regards, — ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 2024-10-30 0:21 ` Bruce Horrocks @ 2024-10-30 10:14 ` Hans Hagen 2024-10-30 10:25 ` Hans Hagen 1 sibling, 0 replies; 18+ messages in thread From: Hans Hagen @ 2024-10-30 10:14 UTC (permalink / raw) To: ntg-context On 10/30/2024 1:21 AM, Bruce Horrocks wrote: > > >> On 29 Oct 2024, at 23:22, Hans Hagen <j.hagen@xs4all.nl> wrote: >> >> On 10/29/2024 11:33 PM, Jorge Manuel wrote: >>> Hello everyone, >>> I’m searching for an efficient way to represent electronic configurations in subshell and orbital notation within ConTeXt. I found similar examples discussed on StackExchange, which you can see here: >>> Atomic electronic configuration with small boxes <https:// tex.stackexchange.com/questions/372581/atomic-electronic-configuration- with-small-boxes/372598#372598>: https://tex.stackexchange.com/ questions/372581/atomic-electronic-configuration-with-small- boxes/372598#372598 <https://tex.stackexchange.com/questions/372581/ atomic-electronic-configuration-with-small-boxes/372598#372598> >>> Box and arrow notation of writing electron configuration >>> https://tex.stackexchange.com/questions/616989/box-and-arrow-notation- of-writing-electron-configuration <https://tex.stackexchange.com/ questions/616989/box-and-arrow-notation-of-writing-electron-configuration> >>> Ideally, I’d like to use a package similar to atoms.sty for this purpose. Does anyone know of a straightforward approach to achieve this in ConTeXt? >>> Thank you very much for any guidance or examples! >> >> It's no problem to come up with something as this kind of stuff is rather trivial but (as always with these things in context) the question is "what is the nicest interface?". >> >> \definesymbol[electronu][\m{\upharpoonleft}] >> \definesymbol[electrond][\m{\downharpoonright}] >> \definesymbol[electronb][\m{\upharpoonleft\downharpoonright}] >> >> \starttexdefinition protected electrons#1 >> \dontleavehmode >> \doloopovermatch {.} {#1} { >> \inframed >> [width=\lineheight,height=\lineheight] >> {\symbol[electron##1]} >> \hskip-\linewidth >> } >> \unskip >> \stoptexdefinition >> >> \electrons{bddb} >> >> \electrons{uddbuud} >> >> Don't look at other packages, just think about what is best and most natural for the field, reading the source, and intreface wise fits into context (looks ok in the source, not like some hack). The above is just an example. We can always make clever parsers in lua but we need specs and examples first. Like, do you want to color specific electrons? Maybe this is enough: >> >> \definesymbol[electronB][\m{\red \symbol[electronb]}] >> \definesymbol[electronD][\m{\blue\symbol[electrond]}] >> >> \electrons{uddBbuDd} >> >> 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 >> ----------------------------------------------------------------- > > Also, as per the images in the StackExchange question, try adding this to the previous example: > > %% start %% > Nitrogen: \vbox to \lineheight{\placeontopofeachother{\electrons{b}}{\tfx 1s}} > \vbox to \lineheight{\placeontopofeachother{\electrons{b}}{\tfx 2s}} > \vbox to \lineheight{\placeontopofeachother{\electrons{uuu}}{\tfx 2p}} > %% end %% > > As Hans says, a parser is relatively easy, so the above can be made much less verbose if the layout is suitable. I think the message is: you don’t need to blindly copy \subshells if there is something easier to enter with less chance of error. Good! So the next step now is: \starttexdefinition protected electrons#1#2 \dontleavehmode \ifparameter#2\or \vbox to \lineheight \bgroup % 1 \placeontopofeachother \bgroup % 2 \fi \dontleavehmode \doloopovermatch {.} {#1} { \inframed [width=\lineheight, height=\lineheight] {\symbol[electron##1]} \hskip-\linewidth } \ifparameter#2\or \egroup % 2 \bgroup % 3 \tfx \setstrut \strut #2 \egroup % 3 \egroup % 1 \fi \unskip \stoptexdefinition Nitrogen: \electrons{b}{1s} \electrons{b}{2s} \electrons{uuu}{2p} which is still relative simple. 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 ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 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 1 sibling, 1 reply; 18+ messages in thread From: Hans Hagen @ 2024-10-30 10:25 UTC (permalink / raw) To: ntg-context On 10/30/2024 1:21 AM, Bruce Horrocks wrote: > > >> On 29 Oct 2024, at 23:22, Hans Hagen <j.hagen@xs4all.nl> wrote: >> >> On 10/29/2024 11:33 PM, Jorge Manuel wrote: >>> Hello everyone, >>> I’m searching for an efficient way to represent electronic configurations in subshell and orbital notation within ConTeXt. I found similar examples discussed on StackExchange, which you can see here: >>> Atomic electronic configuration with small boxes <https:// tex.stackexchange.com/questions/372581/atomic-electronic-configuration- with-small-boxes/372598#372598>: https://tex.stackexchange.com/ questions/372581/atomic-electronic-configuration-with-small- boxes/372598#372598 <https://tex.stackexchange.com/questions/372581/ atomic-electronic-configuration-with-small-boxes/372598#372598> >>> Box and arrow notation of writing electron configuration >>> https://tex.stackexchange.com/questions/616989/box-and-arrow-notation- of-writing-electron-configuration <https://tex.stackexchange.com/ questions/616989/box-and-arrow-notation-of-writing-electron-configuration> >>> Ideally, I’d like to use a package similar to atoms.sty for this purpose. Does anyone know of a straightforward approach to achieve this in ConTeXt? >>> Thank you very much for any guidance or examples! >> >> It's no problem to come up with something as this kind of stuff is rather trivial but (as always with these things in context) the question is "what is the nicest interface?". >> >> \definesymbol[electronu][\m{\upharpoonleft}] >> \definesymbol[electrond][\m{\downharpoonright}] >> \definesymbol[electronb][\m{\upharpoonleft\downharpoonright}] >> >> \starttexdefinition protected electrons#1 >> \dontleavehmode >> \doloopovermatch {.} {#1} { >> \inframed >> [width=\lineheight,height=\lineheight] >> {\symbol[electron##1]} >> \hskip-\linewidth >> } >> \unskip >> \stoptexdefinition >> >> \electrons{bddb} >> >> \electrons{uddbuud} >> >> Don't look at other packages, just think about what is best and most natural for the field, reading the source, and intreface wise fits into context (looks ok in the source, not like some hack). The above is just an example. We can always make clever parsers in lua but we need specs and examples first. Like, do you want to color specific electrons? Maybe this is enough: >> >> \definesymbol[electronB][\m{\red \symbol[electronb]}] >> \definesymbol[electronD][\m{\blue\symbol[electrond]}] >> >> \electrons{uddBbuDd} >> >> 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 >> ----------------------------------------------------------------- > > Also, as per the images in the StackExchange question, try adding this to the previous example: > > %% start %% > Nitrogen: \vbox to \lineheight{\placeontopofeachother{\electrons{b}}{\tfx 1s}} > \vbox to \lineheight{\placeontopofeachother{\electrons{b}}{\tfx 2s}} > \vbox to \lineheight{\placeontopofeachother{\electrons{uuu}}{\tfx 2p}} > %% end %% > > As Hans says, a parser is relatively easy, so the above can be made much less verbose if the layout is suitable. I think the message is: you don’t need to blindly copy \subshells if there is something easier to enter with less chance of error. A bit more low level but we're in educational mode anyway: \starttexdefinition protected electrons#1#2 \dontleavehmode \ifparameter#2\or \setbox\scratchboxone\hbox\bgroup \fi \dontleavehmode \doloopovermatch {.} {#1} { \framed [width=\lineheight, height=\lineheight] {\symbol[electron##1]} \hskip-\linewidth } \ifparameter#2\or \egroup \setbox\scratchboxtwo\hbox to \wd\scratchboxone\bgroup \tfx \setstrut\strut \hss#2\hss \egroup \ruledhpack \bgroup \box\scratchboxone \hkern-\wd\scratchboxtwo \boxymove\scratchboxtwo-\dimexpr\htdp\scratchboxtwo-\strutdp\relax \box\scratchboxtwo \egroup \fi \unskip \stoptexdefinition Nitrogen: \electrons{b}{1s} \electrons{b}{2s} \electrons{uuu}{2p} Nitrogen: \electrons{b}{} \electrons{B}{} \electrons{uuu}{} better for spacing 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 ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 2024-10-30 10:25 ` Hans Hagen @ 2024-10-30 20:35 ` Wolfgang Schuster 2024-10-30 20:41 ` Hans Hagen 0 siblings, 1 reply; 18+ messages in thread From: Wolfgang Schuster @ 2024-10-30 20:35 UTC (permalink / raw) To: mailing list for ConTeXt users Hans Hagen schrieb am 30.10.2024 um 11:25: > On 10/30/2024 1:21 AM, Bruce Horrocks wrote: >> >> >>> On 29 Oct 2024, at 23:22, Hans Hagen <j.hagen@xs4all.nl> wrote: >>> >>> On 10/29/2024 11:33 PM, Jorge Manuel wrote: >>>> Hello everyone, >>>> I’m searching for an efficient way to represent electronic >>>> configurations in subshell and orbital notation within ConTeXt. I >>>> found similar examples discussed on StackExchange, which you can >>>> see here: >>>> Atomic electronic configuration with small boxes <https:// >>>> tex.stackexchange.com/questions/372581/atomic-electronic-configuration- >>>> with-small-boxes/372598#372598>: https://tex.stackexchange.com/ >>>> questions/372581/atomic-electronic-configuration-with-small- >>>> boxes/372598#372598 >>>> <https://tex.stackexchange.com/questions/372581/ >>>> atomic-electronic-configuration-with-small-boxes/372598#372598> >>>> Box and arrow notation of writing electron configuration >>>> https://tex.stackexchange.com/questions/616989/box-and-arrow-notation- >>>> of-writing-electron-configuration <https://tex.stackexchange.com/ >>>> questions/616989/box-and-arrow-notation-of-writing-electron-configuration> >>>> >>>> Ideally, I’d like to use a package similar to atoms.sty for this >>>> purpose. Does anyone know of a straightforward approach to achieve >>>> this in ConTeXt? >>>> Thank you very much for any guidance or examples! >>> >>> It's no problem to come up with something as this kind of stuff is >>> rather trivial but (as always with these things in context) the >>> question is "what is the nicest interface?". >>> >>> \definesymbol[electronu][\m{\upharpoonleft}] >>> \definesymbol[electrond][\m{\downharpoonright}] >>> \definesymbol[electronb][\m{\upharpoonleft\downharpoonright}] >>> >>> \starttexdefinition protected electrons#1 >>> \dontleavehmode >>> \doloopovermatch {.} {#1} { >>> \inframed >>> [width=\lineheight,height=\lineheight] >>> {\symbol[electron##1]} >>> \hskip-\linewidth >>> } >>> \unskip >>> \stoptexdefinition >>> >>> \electrons{bddb} >>> >>> \electrons{uddbuud} >>> >>> Don't look at other packages, just think about what is best and most >>> natural for the field, reading the source, and intreface wise fits >>> into context (looks ok in the source, not like some hack). The above >>> is just an example. We can always make clever parsers in lua but we >>> need specs and examples first. Like, do you want to color specific >>> electrons? Maybe this is enough: >>> >>> \definesymbol[electronB][\m{\red \symbol[electronb]}] >>> \definesymbol[electronD][\m{\blue\symbol[electrond]}] >>> >>> \electrons{uddBbuDd} >>> >>> 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 >>> ----------------------------------------------------------------- >> >> Also, as per the images in the StackExchange question, try adding >> this to the previous example: >> >> %% start %% >> Nitrogen: \vbox to >> \lineheight{\placeontopofeachother{\electrons{b}}{\tfx 1s}} >> \vbox to \lineheight{\placeontopofeachother{\electrons{b}}{\tfx >> 2s}} >> \vbox to >> \lineheight{\placeontopofeachother{\electrons{uuu}}{\tfx 2p}} >> %% end %% >> >> As Hans says, a parser is relatively easy, so the above can be made >> much less verbose if the layout is suitable. I think the message is: >> you don’t need to blindly copy \subshells if there is something >> easier to enter with less chance of error. > > A bit more low level but we're in educational mode anyway: > > \starttexdefinition protected electrons#1#2 I would make the second argument optional. \starttexdefinition protected tolerant electrons #=#= Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 2024-10-30 20:35 ` Wolfgang Schuster @ 2024-10-30 20:41 ` Hans Hagen 2024-10-30 21:07 ` Wolfgang Schuster 0 siblings, 1 reply; 18+ messages in thread From: Hans Hagen @ 2024-10-30 20:41 UTC (permalink / raw) To: ntg-context [-- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 2024-10-30 20:41 ` Hans Hagen @ 2024-10-30 21:07 ` Wolfgang Schuster 2024-10-30 21:45 ` Hans Hagen 0 siblings, 1 reply; 18+ messages in thread From: Wolfgang Schuster @ 2024-10-30 21:07 UTC (permalink / raw) To: mailing list for ConTeXt users, Hans Hagen Hans Hagen schrieb am 30.10.2024 um 21:41: > On 10/30/2024 9:35 PM, Wolfgang Schuster wrote: > >> \starttexdefinition protected tolerant electrons #=#= > > ok, can you check the attached 'module' 1. You're checking the wrong parameter (should be \ifparameter#1\or). \ifparameter#2\or \cdef\currentelectrons{#1}% \fi 2. Using \installframedcommandhandler can be useful because it allows changing the \framed width and height but it requires a few changes: a) Map style and style to foregroundstyle and foregroundcolor b) Change the depth key to another name, e.g. voffset. 3. Add \doifsymboldefinedelse to check for all input before you place the box/symbol. Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 2024-10-30 21:07 ` Wolfgang Schuster @ 2024-10-30 21:45 ` Hans Hagen 2024-10-31 11:34 ` Bruce Horrocks 0 siblings, 1 reply; 18+ messages in thread From: Hans Hagen @ 2024-10-30 21:45 UTC (permalink / raw) To: Wolfgang Schuster, mailing list for ConTeXt users Hi Wolfgang, > Hans Hagen schrieb am 30.10.2024 um 21:41: >> On 10/30/2024 9:35 PM, Wolfgang Schuster wrote: >> >>> \starttexdefinition protected tolerant electrons #=#= >> >> ok, can you check the attached 'module' > > 1. You're checking the wrong parameter (should be \ifparameter#1\or). > > \ifparameter#2\or > \cdef\currentelectrons{#1}% > \fi oeps > 2. Using \installframedcommandhandler can be useful because it allows > changing the \framed width and height but it requires a few changes: > > a) Map style and style to foregroundstyle and foregroundcolor > > b) Change the depth key to another name, e.g. voffset. makes sense, it probably makes less sense to also define a command (depends on usage i guess) maybe we should we put a colon between electron:u in the symbol or make it a symbolset > 3. Add \doifsymboldefinedelse to check for all input before you place > the box/symbol. ok, just send me the patched file, thanks for checking Hans (i think that it makes a nice example of simple interfacing and a bit of native tex coding) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 2024-10-30 21:45 ` Hans Hagen @ 2024-10-31 11:34 ` Bruce Horrocks 2024-10-31 12:13 ` Hans Hagen via ntg-context ` (2 more replies) 0 siblings, 3 replies; 18+ messages in thread From: Bruce Horrocks @ 2024-10-31 11:34 UTC (permalink / raw) To: ntg-context mailing list > On 30 Oct 2024, at 21:45, Hans Hagen <j.hagen@xs4all.nl> wrote: > >> 2. Using \installframedcommandhandler can be useful because it allows changing the \framed width and height but it requires a few changes: >> a) Map style and style to foregroundstyle and foregroundcolor >> b) Change the depth key to another name, e.g. voffset. > > makes sense, it probably makes less sense to also define a command (depends on usage i guess) I agree with Wolfgang’s suggestions regarding the addition of framecommandhandler - I was going to suggest this thinking that the default line thickness might be too thin for printing. But there are also some other features that could be added: e.g. a style parameter for the labels text so the font can be changed; and a vertical alignment (location=top|center|bottom). And, although the StackExchange article originally linked used harpoons for the spin direction, other sources online use regular arrows so that might be an option to add? Another detail - probably needs input from Jorge - at the moment if there is a single electron, the arrow is centred in the box. Would it help to have an option that up arrows align left and down arrows align right so that there is a space where the missing arrow would go? (e.g. <https://chem.libretexts.org/Courses/Valley_City_State_University/Chem_115/Chapter_2%3A_Atomic_Structure/2.4_Electron_Configurations>) So, all of that combined, suggests adding a defineelectrons and a setupelectrons as well? I’d like to give it a go as a learning exercise - following Wolfgang’s module tutorial - but don’t want to step on anyone’s toes by taking over. Regards, — Bruce Horrocks Hampshire, UK ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 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:47 ` Henning Hraban Ramm 2 siblings, 0 replies; 18+ messages in thread From: Hans Hagen via ntg-context @ 2024-10-31 12:13 UTC (permalink / raw) To: ntg-context; +Cc: Hans Hagen Hi Bruce, >> On 30 Oct 2024, at 21:45, Hans Hagen <j.hagen@xs4all.nl> wrote: >> >>> 2. Using \installframedcommandhandler can be useful because it allows changing the \framed width and height but it requires a few changes: >>> a) Map style and style to foregroundstyle and foregroundcolor >>> b) Change the depth key to another name, e.g. voffset. >> >> makes sense, it probably makes less sense to also define a command (depends on usage i guess) > > I agree with Wolfgang’s suggestions regarding the addition of framecommandhandler - I was going to suggest this thinking that the default line thickness might be too thin for printing. > > But there are also some other features that could be added: e.g. a style parameter for the labels text so the font can be changed; and a vertical alignment (location=top|center|bottom). > > And, although the StackExchange article originally linked used harpoons for the spin direction, other sources online use regular arrows so that might be an option to add? > > Another detail - probably needs input from Jorge - at the moment if there is a single electron, the arrow is centred in the box. Would it help to have an option that up arrows align left and down arrows align right so that there is a space where the missing arrow would go? > > (e.g. <https://chem.libretexts.org/Courses/Valley_City_State_University/Chem_115/Chapter_2%3A_Atomic_Structure/2.4_Electron_Configurations>) > > So, all of that combined, suggests adding a defineelectrons and a setupelectrons as well? > > I’d like to give it a go as a learning exercise - following Wolfgang’s module tutorial - but don’t want to step on anyone’s toes by taking over. Well, you can take the m-electrons from the just uploaded update. You can play with it and add if needed. As long as you can live with "Wolfgang will scrutinize the result as part of the ConTeXt Quality Assurancy Policy" which i guess you are. 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 ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 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 2 siblings, 1 reply; 18+ messages in thread From: Jorge Manuel @ 2024-10-31 15:25 UTC (permalink / raw) To: ntg-context mailing list, mailing list for ConTeXt users, Bruce Horrocks [-- Attachment #1.1: Type: text/plain, Size: 561 bytes --] Bruce is correct. In half-filled orbitals (with only one electron), electrons with spin "up" should be positioned on the left, while those with spin "down" should be placed on the right. Jorge On 31 Oct 2024, 11:35 +0000, mailing list for ConTeXt users <ntg-context@ntg.nl>, wrote: > > Another detail - probably needs input from Jorge - at the moment if there is a single electron, the arrow is centred in the box. Would it help to have an option that up arrows align left and down arrows align right so that there is a space where the missing arrow would go? [-- Attachment #1.2: Type: text/html, Size: 1188 bytes --] [-- Attachment #2: 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 2024-10-31 15:25 ` Jorge Manuel @ 2024-10-31 15:28 ` Hans Hagen via ntg-context 0 siblings, 0 replies; 18+ messages in thread From: Hans Hagen via ntg-context @ 2024-10-31 15:28 UTC (permalink / raw) To: ntg-context; +Cc: Hans Hagen On 10/31/2024 4:25 PM, Jorge Manuel wrote: > Bruce is correct. In half-filled orbitals (with only one electron), > electrons with spin "up" should be positioned on the left, while those > with spin "down" should be placed on the right. i also wondered about that but the stack exchange samples centered .. so i suggest that you collect examples (maybe just draw and scan) 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 ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 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:47 ` Henning Hraban Ramm 2024-10-31 16:39 ` vm via ntg-context 2 siblings, 1 reply; 18+ messages in thread From: Henning Hraban Ramm @ 2024-10-31 15:47 UTC (permalink / raw) To: ntg-context [-- Attachment #1: Type: text/plain, Size: 387 bytes --] Am 31.10.24 um 12:34 schrieb Bruce Horrocks: > I’d like to give it a go as a learning exercise - following Wolfgang’s module tutorial - but don’t want to step on anyone’s toes by taking over. Find attached the uncompleted CGJ article that I made from Wolfgang’s presentation and additional hints (still need to include some more that he gave to my in German). Hraban [-- Attachment #2: modules.tex --] [-- Type: application/x-tex, Size: 32900 bytes --] [-- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in 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 0 siblings, 1 reply; 18+ messages in thread From: vm via ntg-context @ 2024-10-31 16:39 UTC (permalink / raw) To: ntg-context; +Cc: vm On 31/10/2024 16:47, Henning Hraban Ramm wrote: > > Find attached the uncompleted CGJ article that I made from Wolfgang’s > presentation and additional hints (still need to include some more that > he gave to my in German). the file is in latex, not context i assume? ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 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 0 siblings, 1 reply; 18+ messages in thread From: Henning Hraban Ramm @ 2024-10-31 17:02 UTC (permalink / raw) To: vm via ntg-context Am 31.10.24 um 17:39 schrieb vm via ntg-context: > > > On 31/10/2024 16:47, Henning Hraban Ramm wrote: >> >> Find attached the uncompleted CGJ article that I made from Wolfgang’s >> presentation and additional hints (still need to include some more >> that he gave to my in German). > > the file is in latex, not context i assume? If you think that’s LaTeX, you shouldn’t try to write ConTeXt modules. ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in 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 0 siblings, 1 reply; 18+ messages in thread From: vm via ntg-context @ 2024-10-31 17:38 UTC (permalink / raw) To: ntg-context; +Cc: vm [-- Attachment #1: Type: text/plain, Size: 312 bytes --] On 31/10/2024 18:02, Henning Hraban Ramm wrote: > > If you think that’s LaTeX, you shouldn’t try to write ConTeXt modules. Well if i compile it with context, most of the pdf is empty. So it was my first guess ;-) ! Undefined control sequence. <line 3.5> \startArticle [ [-- Attachment #2: modules.pdf --] [-- Type: application/pdf, Size: 19258 bytes --] [-- 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
* [NTG-context] Re: Seeking Advice on Electron Configuration Notation in ConTeXt 2024-10-31 17:38 ` vm via ntg-context @ 2024-10-31 18:01 ` Henning Hraban Ramm 0 siblings, 0 replies; 18+ messages in thread From: Henning Hraban Ramm @ 2024-10-31 18:01 UTC (permalink / raw) To: vm via ntg-context Am 31.10.24 um 18:38 schrieb vm via ntg-context: > > On 31/10/2024 18:02, Henning Hraban Ramm wrote: >> >> If you think that’s LaTeX, you shouldn’t try to write ConTeXt modules. > > Well if i compile it with context, most of the pdf is empty. > So it was my first guess ;-) Have a look at the code and uncomment the first 3 lines. It’s an article for CGJ (context group journal) and assumes its environment. HR ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2024-10-31 18:05 UTC | newest] Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <5e4e292b-6d11-4b37-b00d-2e1aefdfe4b6@Spark> 2024-10-29 22:33 ` [NTG-context] Seeking Advice on Electron Configuration Notation in 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 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
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).