def fix_filename(filename):
    """Latex has problems if there are one or more points in the filename,
    thus 'abc.def.jpg' will be changed to '{abc.def}.jpg
    
        :param filename: 
        
        :type filename: str
        
        :return: 
        :rtype: str
    """
    
    parts = filename.split('.')
    
    return '{' + '.'.join(parts[0:-1]) + '}.' + parts[-1]