def print_latex(formula):
    """
    Print a LaTeX - formatted version of the formula

    Examples
    ---------
    >>> print_latex('Fe2SO4')
    Fe_2SO_4
    >>> print_latex('CH3CH2CH3')
    CH_3CH_2CH_3
    >>> print_latex('Fe2(OH)2+2')
    Fe_2(OH)_2^+^2

    """
    output = ''
    for i in range(len(formula)):
        if formula[i].isnumeric() and i > 0:
            if formula[i - 1] == '+' or formula[i - 1] == '-':
                output += '^'
            else:
                output += '_'
        if formula[i] == '+' or formula[i] == '-':
            output += '^'
        output += formula[i]
    print(output)
