def include_latexdefs(name):
    """This function is used to include latex user definitions
    in the html template, using the syntax
    {{ include_latexdefs('latexdefs.tex') }}
    This function is included in jinja2 environment"""
    text = ''
    try:
        with open(name) as f:
            for line in f:
                text += '$' + line[:-1] + '$\n'
    except:
        pass
    return text
