summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkxl/chem-ini.mkxl
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkxl/chem-ini.mkxl')
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/chem-ini.mkxl53
1 files changed, 53 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkxl/chem-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/chem-ini.mkxl
new file mode 100644
index 00000000000..b88d4d8346e
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/chem-ini.mkxl
@@ -0,0 +1,53 @@
+%D \module
+%D [ file=chem-ini,
+%D version=2008.03.06,
+%D subtitle=Chemistry,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% todo: \mathscriptsmode
+
+\writestatus{loading}{ConTeXt Chemistry Macros / Initialization} % might become Inline
+
+\registerctxluafile{chem-ini}{}
+
+\unprotect
+
+% todo: use \mathscriptsmode if needed
+
+%D \macros
+%D {molecule}
+%D
+%D Quick and dirty:
+%D
+%D \starttyping
+%D \permanent\protected\def\molecule#1%
+%D {$\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
+
+\permanent\protected\def\molecule#1% todo: can become a public implementor
+ {\clf_molecule{#1}}
+
+%D For old times sake:
+
+\permanent\protected\def\chem#1#2#3%
+ {\dontleavehmode\begingroup#1\lohi{#2}{#3}\endgroup}
+
+\protect \endinput
+
+