def createTexFile(filename):
    """Creates a .tex file with the filename given and returns a file

    Parameters:
        filename (string): Name of the .tex file created.

    Returns:
        file: .tex file with filename
    """
    out_file = open(f'{filename}.tex', "w")
    header = "\documentclass{article}\n\\begin{document}\n"
    header += f"\\title{{{filename}}}\n"
    header += "\maketitle\n"
    out_file.write(header)
    return out_file