calling add_heading(adds paragraph with one of the heading styles enter the following into the interactive shelldoc docx document(doc add_heading('header ' doc add_heading('header ' doc add_heading('header ' doc add_heading('header ' doc add_heading('header ' doc save('headings docx'the arguments to add_heading(are string of the heading text and an integer from to the integer makes the heading the title stylewhich is used for the top of the document integers to are for various heading levelswith being the main heading and the lowest subheading the add_heading(function returns paragraph object to save you the step of extracting it from the document object as separate step the resulting headings docx file will look like figure - figure - the headings docx document with headings to adding line and page breaks to add line break (rather than starting whole new paragraph)you can call the add_break(method on the run object you want to have the break appear after if you want to add page break insteadyou need to pass the value docx enum text wd_break page as lone argument to add_break()as is done in the middle of the following exampledoc docx document(doc add_paragraph('this is on the first page!'doc paragraphs[ runs[ add_break(docx enum text wd_break pagedoc add_paragraph('this is on the second page!'doc save('twopage docx'