def generate_latex_file(download_url, vtfile, version, tag, 
                      execute, showspreadsheetonly, path_to_figures, 
                      graphics_options,embedWorkflow=False, 
                      includeFullTree=False):
    log("generate_latex_file")
    if download_url is not None and download_url != "":
        url = build_vtl_file(download_url, vtfile, version, tag, execute, 
                             showspreadsheetonly, embedWorkflow=False)
        href = "\href{%s}{" % url
        log(url)
    ALLOWED_GRAPHICS = [".png", ".jpg", ".pdf"]
    images = []
    for root, dirs, file_names in os.walk(path_to_figures):
        for f in file_names:
            ext = os.path.splitext(f)[1]
            if ext in ALLOWED_GRAPHICS:
                images.append(f)
        break
    n = len(images)
    s = ''
    for f in images:
        filename = os.path.join(path_to_figures,f).replace("%","\%")
        if graphics_options:
            s += "\includegraphics[%s]{%s}\n" % (graphics_options, filename.replace("\\","/"))
        else:
            s += "\includegraphics{%s}\n" % filename.replace("\\","/")
    
    if download_url is not None and download_url != "":
        return href + s + "}"
    else:
        return s

###############################################################################
Start the process and hook up the callbacks.
dataset/ETHPy150Open VisTrails/VisTrails/extensions/latex/includevistrail.py/generate_latex_file--crossover with--dataset/ETHPy150Open ipython/ipython-py3k/IPython/deathrow/oldfrontend/process/pipedprocess.py/PipedProcess.run