I would like to add superscript and subscript text to powerpoint slides using python pptx. When I try to change the superscript/subscript attributes no visual change occurs to the text on powerpoint. I have tried the following:
#Import modules
from pptx import Presentation
from pptx.enum.shapes import MSO_SHAPE
from pptx.util import Cm
#Open powerpoint file
prs = Presentation('filename.pptx')
#Add slide
slidelayout = prs.slide_layouts[0]
slide = prs.slides.add_slide(slidelayout)
shapes = slide.shapes
#Add a shape
shape = shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE, Cm(10), Cm(10), Cm(10), Cm(10))
#Add text
text_frame = shape.text_frame
paragraph = text_frame.add_paragraph()
run = paragraph.add_run()
run.text = 'this text should be superscript'
font = run.font
font.superscript = True
font.subscript = False
#Save the powerpoint file
prs.save('filename2.pptx')