def METHOD_NAME(string):
    string = str(string)
    for char, replacement in unicode_to_latex_mapping.items():
        string = string.replace(char, replacement)
    # The returned string may still contain unicode characters if
    # the user is using xelatex. But in that case, the remapping is not
    # needed anyway.
    # However, it could also mean that the mapping needs to be updated.
    try:
        string.encode('ascii')
    except UnicodeEncodeError:
        global warned_mapping
        if not warned_mapping:
            warned_mapping = True
            log.warn(_("Generated string for LaTeX contains unicode characters. This is likely fine!"))
    return string