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