1from pylatex import Document, Section, Subsection, Command
2from pylatex.utils import italic, NoEscape
3#...
4with doc.create(Section('A section')):
5 doc.append('Some regular text and some ')
6 doc.append(italic('italic text. '))
7
8 with doc.create(Subsection('A subsection')):
9 doc.append('Also some crazy characters: $&#{}')
10#...