def escape_percentage(equation):
    """
    Escape percentage symbols in equations.

    Inputs:
        equation: string containing equation

    Returns string with percentage symbols escaped
    """
    if '%' in equation:
        equation = equation.replace('%', '\\%').replace('\\\\%', '\\%')

    return equation