def convert_title_to_id(title, doc_type, options):
    """
    Converts the human-readable title to an ID string.
    """
    if options['id_case'] in ['lowercase', 'lower-case', 'lower case']:
        converted_id = title.lower()
    elif options['id_case'] in ['capitalize', 'capitalise']:
        converted_id = title.capitalize()
    elif options['id_case'] in ['preserve', 'original']:
        converted_id = title
    else:
        print("Error: ID capitalization option not recognized: '{}'".format
            (options['id_case']))
        exit(1)
    subst_map = {' ': options['word_separator'], '(': '', ')': '', '?': '',
        '!': '', "'": '', '"': '', '#': '', '%': '', '&': '', '*': '', ',':
        '', '.': '-', '/': '-', ':': '-', ';': '', '@': '-at-', '\\': '',
        '`': '', '$': '', '^': '', '|': '', '[package]': '', '[option]': '',
        '[parameter]': '', '[variable]': '', '[command]': '',
        '[replaceable]': '', '[filename]': '', '[literal]': '',
        '[systemitem]': '', '[application]': '', '[function]': '', '[gui]':
        '', '[': '', ']': '', '{': '', '}': ''}
    for k in subst_map.keys():
        v = subst_map[k]
        converted_id = converted_id.replace(k, v)
    while '--' in converted_id:
        converted_id = converted_id.replace('--', '-')
    return converted_id
