def mklabel(fsym, der, arg):
    """mklabel(f, 2, x) --> $f''(x)$"""
    if der == 0:
        return '$%s(%s)$' % (fsym, arg)
    else:
        fsym = fsym + '^{' + der * '\\prime' + '}'
        return '$%s(%s)$' % (fsym, arg)
