def raw_string(txt):
    """
    Python automatically converts escape characters (i.e. \\n), which causes
    problems when inputing latex strings since they are full of backslashes.  
    This function returns a raw string representation of text
    
    Parameters
    ----------
    txt : string
        string that possibly contains escape characters
    
    Returns
    -------
    new_text : string
        same as 'text' but without any escape characters
    """
    escape_dict = {'\x07': '\\a', '\x08': '\\b', '\\c': '\\c', '\x0c':
        '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t', '\x0b': '\\v', "'":
        "\\'", '"': '\\"'}
    new_txt = ''
    for char in txt:
        try:
            new_txt += escape_dict[char]
        except KeyError:
            new_txt += char
    return new_txt
