Sanitizes the name of a file (for including graphics in LaTeX).

    :param name: the name of the file to sanitize.
    :type name: str

    :returns: the sanitized name.

    For example, if the name of the graphic file is ``test.1.png``, the
    sanitized version of it for LaTeX is ``{test.1}.png``.

def sanitize_fig_name(name):
    """Sanitizes the name of a file (for including graphics in LaTeX).

    :param name: the name of the file to sanitize.
    :type name: str

    :returns: the sanitized name.

    For example, if the name of the graphic file is ``test.1.png``, the
    sanitized version of it for LaTeX is ``{test.1}.png``.

    """
    name, extension = os.path.splitext(name)
    return "{" + name + "}" + extension