def iter_flat_paragraph_formula(semantic_paragraph: SemanticParagraph) -> Iterable[SemanticContentWrapper]:
    pending_semantic_content_list: List[SemanticContentWrapper] = []
    for semantic_content in semantic_paragraph:
        if isinstance(semantic_content, SemanticRawEquation):
            if pending_semantic_content_list:
                (yield SemanticParagraph(pending_semantic_content_list))
                pending_semantic_content_list = []
            (yield semantic_content)
            continue
        pending_semantic_content_list.append(semantic_content)
    if pending_semantic_content_list:
        (yield SemanticParagraph(pending_semantic_content_list))
def iter_flat_paragraph_formula(semantic_paragraph: SemanticParagraph) -> Iterable[SemanticContentWrapper]:
    pending_semantic_content_list: List[SemanticContentWrapper] = []
    for semantic_content in semantic_paragraph:
        if isinstance(semantic_content, SemanticRawEquation):
            if pending_semantic_content_list:
                (yield SemanticParagraph(pending_semantic_content_list))
                pending_semantic_content_list = []
            (yield semantic_content)
            continue
        pending_semantic_content_list.append(semantic_content)
    if pending_semantic_content_list:
        (yield SemanticParagraph(pending_semantic_content_list))