def create_id_box(label, num_digits, box_width=None):
    """Creates the ID box given a label to show and number of digits.

    """
    parts = ['\\begin{center}', '\\Large']
    if box_width is not None:
        parts.append('\\resizebox{%fcm}{!}{' % box_width)
    parts.append('\\begin{tabular}{l|' + num_digits * 'p{3mm}|' + '}')
    parts.append('\\cline{2-%d}' % (1 + num_digits))
    parts.append('\\textbf{%s}: ' % label + num_digits * '& ' + '\\\\')
    parts.append('\\cline{2-%d}' % (1 + num_digits))
    parts.append('\\end{tabular}')
    if box_width is not None:
        parts.append('}')
    parts.append('\\end{center}')
    return '\n'.join(parts)
