def _process_preamble(latex_string):
    """Detect Latex Preamble

    Arguments:
        latex_string {string} -- Latex Source

    Returns:
        tupple -- preamble, content
    """
    if r"\begin{document}" in latex_string:
        preamble, content = latex_string.split(r"\begin{document}")
        if r"\end{document}" in content:
            content = content.split(r"\end{document}")[0]
    else:
        preamble = "\\documentclass{article}\n"
        content = latex_string
    return preamble, content