1%D \module 2%D [ file=chem-ini, 3%D version=2008.03.06, 4%D subtitle=Chemistry, 5%D author=Hans Hagen, 6%D date=\currentdate, 7%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] 8%C 9%C This module is part of the \CONTEXT\ macro||package and is 10%C therefore copyrighted by \PRAGMA. See mreadme.pdf for 11%C details. 12 13% todo: \mathscriptsmode 14 15\writestatus{loading}{ConTeXt Chemistry Macros / Initialization} % might become Inline 16 17\registerctxluafile{chem-ini}{} 18 19\unprotect 20 21% todo: use \mathscriptsmode if needed 22 23%D \macros 24%D {molecule} 25%D 26%D Quick and dirty: 27%D 28%D \starttyping 29%D \unexpanded\def\molecule#1% 30%D {$\enablesupersub\tf#1$} 31%D \stoptyping 32%D 33%D Using \LUA: 34%D 35%D \startbuffer 36%D \molecule{H_2SO_4^-2} 37%D \molecule{H_2SO_4^{-2}} 38%D \molecule{H_2SO_4^{-2{x}}} 39%D \stopbuffer 40%D 41%D \typebuffer \getbuffer 42 43\unexpanded\def\molecule#1% 44 {\clf_molecule{#1}} 45 46%D For old times sake: 47 48\unexpanded\def\chem#1#2#3% 49 {\dontleavehmode\begingroup#1\lohi{#2}{#3}\endgroup} 50 51\protect \endinput 52 53 54 |