summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/chem-ini.mkiv
blob: 5184fe1a7a023058138ad8d064420fdc722e1e0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
%D \module
%D   [       file=chem-ini,
%D        version=2008.03.06,
%D       subtitle=Chemistry,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright=\PRAGMA]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{ConTeXt Chemistry Macros / Initialization} % might become Inline

\registerctxluafile{chem-ini}{1.001}

\unprotect

%D \macros
%D   {molecule}
%D
%D Quick and dirty:
%D
%D \starttyping
%D \def\molecule#1{$\enablesupersub\tf#1$}
%D \stoptyping
%D
%D Using \LUA:
%D
%D \startbuffer
%D \molecule{H_2SO_4^-2}
%D \molecule{H_2SO_4^{-2}}
%D \molecule{H_2SO_4^{-2{x}}}
%D \stopbuffer
%D
%D \typebuffer \getbuffer

\def\molecule#1{\ctxlua{commands.molecule(\!!bs#1\!!es)}}

%D For old times sake:

\def\chem#1#2#3%
  {\dontleavehmode\begingroup#1\lohi{#2}{#3}\endgroup}

\protect \endinput