def in_line(xmin_line, xmax_line, ymin_line, xmin_new, xmax_new, ymax_new):
    """Heuristic for determining whether a character is in a line.

    Note:
        Currently dependent on the order in which characters are
        added. For example, a character may vertically overlap with a
        line, but adding it to the line would be out of reading order.
        This should be fixed in a future version.

    Args:
        xmin_line (:obj:`list` of :obj:`int`): Minimum x-coordinate of
            characters in the line the new character is tested against.
        xmax_line (:obj:`list` of :obj:`int`): Maximum x-coordinate of
            characters in the line the new character is tested against.
        ymin_line (int): Minimum y-coordinate of line the new character
            is tested against.
        xmin_new (int): Minimum x-coordinate of new character.
        xmax_new (int): Maximum x-coordinate of new character.
        ymax_new (int): Maximum y-coordinate of new character.

    Returns:
        bool:
            The new character vertically overlaps with the
            "average" character in the line.
    """
    xmin_avg = sum(xmin_line) / len(xmin_line)
    xmax_avg = sum(xmax_line) / len(xmax_line)
    return (xmin_avg <= xmax_new and xmax_avg >= xmin_new and ymax_new >=
        ymin_line)
