Changes

Jump to navigation Jump to search
m
Corrected typo in URL to lpeg
:<code>\molecule{H_3SO_4^+}</code>.
So, we need a function that can take a string like that, parse it, and turn it into the appropriate TeX code. LuaTeX includes a general parser based on PEG (parsing expression grammar) called [http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html lpeg], and it makes writing little parsers positively joyful. (Once you've got the knack of it, at least.) For example, the above <code>\molecule</code> macro can be written as follows.
<texcode>
2

edits

Navigation menu