def build_pdf(branch):
    os.chdir(os.path.join(gitdname, 'statsmodels', 'docs'))
    sphinx_dir = os.path.join(virtual_dir, 'bin')
    retcode = subprocess.call(" ".join(['make', 'latexpdf',
                              'SPHINXBUILD='+sphinx_dir+'/sphinx-build']),
                              shell=True)
    if retcode != 0:
        msg = """Could not build the pdf docs for branch %s""" % branch
        raise Exception(msg)
    os.chdir(dname)
Changes into new_branch_dir and builds the docs using sphinx in the
dataset/ETHPy150Open statsmodels/statsmodels/tools/update_web.py/build_pdf