You could always do ```python r"\text{\frac" + str(variable1) + str(variable2) + "}" ```