import re


def split_parts(body:str):
    """Split into:
    * Pre
    * Document
    * End

    Parameters
    ----------
    body : [type]
        [description]
    """
    
    

    p = re.split(pattern= r'\\begin{document}', string=body)
    pre = p[0]
    rest = p[1]

    p2 = re.split(pattern= r'\\end{document}', string=rest)
    document = p2[0]
    end = p2[1]

    return pre, document, end