def convert_extension(filename, extensions=('yaml', 'yml')):
    """
    Convert YeT extension in filename to .tex

    :param filename: string of file name. validity not checked.
    :param extensions: tuple of extensions (without dot) to treat as YeT
    """
    if '.' in filename:
        ext = filename.split('.')[-1]
        if ext in extensions:
            idx = filename.rindex('.')
            return f'{filename[:idx]}.tex'
    return f'{filename}.tex'
