def _write_header(margin_size_cm=3):
    """Write the header of the latex file, including any
    `usepackage` commands.

    Parameters
    ----------
    margin_size_cm: int
        The size of the margin to use.

    Returns
    -------
    str
        The formatted latex header.
    """

    return "\n".join(
        [
            r"\documentclass{article}",
            f"\\usepackage[margin={margin_size_cm}cm]{{geometry}}",
            "",
            r"\usepackage[utf8]{inputenc}",
            r"\usepackage{graphicx}",
            r"\usepackage{array}",
            r"\usepackage[export]{adjustbox}",
            r"\usepackage{parskip}",
            "",
            r"\usepackage{amssymb}",
            r"\usepackage{seqsplit}",
            "",
            r"\usepackage{url}",
            r"\urlstyle{same}",
            "",
            r"\usepackage{subfigure}",
            r"\usepackage{alphalph}",
            r"\renewcommand*{\thesubfigure}{%",
            r"\alphalph{\value{subfigure}}%",
            r"}%",
            "",
            r"\edef\hash {\string#}",
            "",
            r"\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}"
            "",
            r"\begin{document}",
        ]
    )