def plot_band_structure(ylim=(-5, 5), draw_fermi=False, fmt="pdf"):
    """
    Plot a standard band structure with no projections. Requires
    EIGENVAL, OUTCAR and KPOINTS files in the current working directory.

    Args:
        ylim (tuple): minimum and maximum potentials for the plot's y-axis.
        draw_fermi (bool): whether or not to draw a dashed line at E_F.
        fmt (str): matplotlib format style. Check the matplotlib docs
            for options.
    """

    eigenval_lines = open("EIGENVAL").readlines()
    kpoints_lines = open("KPOINTS").readlines()

    # IBZ k-points used for SCF but not useful for plotting bands.
    ibz_kpoints = [k for k in kpoints_lines[3:] if int(k.split()[3]) != 0]
    # Lines containing hig-symmetry k-points (e.g. Gamma)
    vertex_lines = [k for k in kpoints_lines[3:] if len(k.split()) == 5]
    n_bands = int(eigenval_lines[5].split()[2])
    with open("OUTCAR", "r") as outcar:
        for line in outcar:
            if "E-fermi" in line:
                efermi = float(line.split()[2])
                break
    spin_polarized = False
    if len(eigenval_lines[8].split()) == 5:
        spin_polarized = True

    bs_kpoints = []
    vertices = []
    bands = [[[], []] for x in range(n_bands)]

    i = 7 + len(ibz_kpoints)*(n_bands+2)
    while i < len(eigenval_lines):
        kpt_coords = [float(x) for x in eigenval_lines[i].split()[:3]]
        for kpt in vertex_lines:
            ref_coords = [float(x) for x in kpt.split()[:3]]
            if euclidean(kpt_coords, ref_coords) < 0.0001:
                kpt_coords.append(kpt.split()[-1])
                vertices.append(kpt_coords)
                break
        bs_kpoints.append(kpt_coords)
        for j in range(n_bands):
            i += 1
            split_line = eigenval_lines[i].split()
            bands[j][0].append(float(split_line[1]) - efermi)
            if spin_polarized:
                bands[j][1].append(float(split_line[2]) - efermi)
        i += 2

    path_lengths, kpt_distances = [], [0]
    discontinuity = False
    for i in range(1, len(vertices)):
        if discontinuity:
            path_lengths.append(0)
        else:
            path_lengths.append(euclidean(vertices[i][:3],vertices[i-1][:3]))

        if i < len(vertices)-1 and vertices[i][3] != vertices[i-1][3] and\
                vertices[i][3] != vertices[i+1][3] and not discontinuity:
            discontinuity = True
        else:
            discontinuity = False

    n_kpt_divs = len(bs_kpoints) / float(len(path_lengths))

    x, j = 0, 0
    for i in range(1, len(bs_kpoints)):
        if len(bs_kpoints[i]) == 4 and len(bs_kpoints[i-1]) == 4 and \
                bs_kpoints[i][3] != bs_kpoints[i-1][3]:
            x += 0
        else:
            x += euclidean(bs_kpoints[i][:3], bs_kpoints[i-1][:3])
        kpt_distances.append(x)

    ax = plt.figure(figsize=(11, 8.5)).gca()
    font = FontProperties()
    font.set_size(24)
    font.set_family("serif")
    large_font = font.copy()
    large_font.set_size(32)

    for b in bands:
        ax.plot(kpt_distances, b[0], 'b-')
        if spin_polarized:
            ax.plot(kpt_distances, b[1], 'r--')
    if draw_fermi:
        ax.plot([min(kpt_distances), max(kpt_distances)], [0, 0], 'k-')
    ax.set_xlim(min(kpt_distances), max(kpt_distances))
    ax.set_xticks([])

    d = 0
    ax.text(d, ylim[0]*1.05, r"$\mathrm{%s}$" % vertices[0][-1],
            fontproperties=font, verticalalignment="top",
            horizontalalignment="center")
    for i in range(len(path_lengths)):
        d += path_lengths[i]
        if i < len(path_lengths)-1 and path_lengths[i+1] == 0 and\
                vertices[i+1][-1] != vertices[i+2][-1]:
            label = "{}|{}".format(vertices[i+1][-1], vertices[i+2][-1])
        else:
            label = vertices[i+1][-1]
        if path_lengths[i] != 0:
            ax.text(d, ylim[0]*1.05, r"$\mathrm{%s}$" % label,
                    fontproperties=font, verticalalignment="top",
                    horizontalalignment="center")
            ax.plot([d, d], [ylim[0], ylim[1]], 'k--')

    ax.set_ylim(ylim)
    ax.set_ylabel(r"$\mathrm{E - E_F (eV)}$", fontproperties=large_font)
    ax.set_yticklabels([int(t) for t in ax.get_yticks()], fontproperties=font)
    plt.savefig("band_structure.{}".format(fmt))