Module:SimpleFormula

local p = {}

local process_args = require'Module:ProcessArgs'

function p.simpleformula(frame) local args = process_args.merge(true)

local formula = frame:preprocess(args['formula'])

local size = args['size'] if size ~= nil then size = size else size = '130' end

local color = args['color'] if color ~= nil then color = color else color = '#009403' end

-- use times symbol formula = formula:gsub('*', '×')

-- unbold words (2 letters or longer) formula = formula:gsub('(%a%a+)', ' %1 ')

-- convert powers (^X) into a superscript formula = formula:gsub('%^(%d)', '%1')

-- format the entire formula with size, color, and bolding formula = ' ' .. formula .. ' '

return formula end

return p