format_sub function

Format subscript text