def _escape_latex(string):
    """Format normal string to be LaTeX compliant."""
    string = string.replace('\\', '\\\\')
    string = string.replace('&', '\\&')
    string = string.replace('%', '\\%')
    string = string.replace('$', '\\$')
    string = string.replace('#', '\\#')
    string = string.replace('_', '\\_')
    string = string.replace('{', '\\{')
    string = string.replace('}', '\\}')
    string = string.replace('~', '\\textasciitilde ')
    string = string.replace('^', '\\textasciicircum ')
    return string
