'Render an preview of a formula or equation. `get` should
contain a key \'formula\' with a math expression.
Returns a json dictionary:
\'preview\' : \'<some latex>\' or \'\'
\'error\' : \'the-error\' or \'\'
\'request_start\' : <time sent with request>'

def preview_formcalc(self, get):

    _ = self.capa_system.i18n.ugettext
    result = {'preview': '', 'error': ''}
    try:
        formula = get['formula']
    except KeyError:
        result['error'] = _('No    formula    specified.')
        return result
    result['request_start'] = int(get.get('request_start', 0))
    try:
        result['preview'] = latex_preview(formula)
    except pyparsing.ParseException:
        result['error'] = _("Sorry,    couldn't    parse    formula")
        result['formula'] = formula
    except Exception:
        log.warning('Error    while    previewing    formula', exc_info=True)
        result['error'] = _('Error    while    rendering    preview')
    return result
