def compare_article_ids(a, b):
    """
    Compares two article ids that are given as e.g. "a11" and "a2".
    Returns

    - 0 if ``a==b`` or both are ``None``,
    - -1 if just ``b`` is ``None`` or the article number of ``b`` is bigger than the one of ``a`` and
    - 1 if just ``a`` is ``None`` or the article number of ``a`` is bigger than the one of ``b``.

    :param a: Article ID 1.
    :param b: Article ID 2.
    :return: 0, -1, 1 as defined above.
    """
    if a is None and b is None:
        return 0
    elif a is None:
        return 1
    elif b is None:
        return -1
    elif int(a[1:]) < int(b[1:]):
        return -1
    elif int(a[1:]) == int(b[1:]):
        return 0
    else:
        return 1