I'm trying to put together a text-based PDF that will be read with a screen reader. In order to make the reading process as straightforward as possible I've used a hierarchy of three levels of headings. I originally created the document in Google Drive, but if I try to export a PDF from there all my headers disappear in the PDF document. If I export from Drive to Word then the headings are retained, but they disappear when I create a PDF from Word by using the built-in macOS PDF creation function.
How can I retain my headings when I create a PDF in macOS?