How to add the current heading text to the header or footer
Some headings or titles (such as table titles or figure captions) in the document are too long or have a format, making it difficult to include them in a Table of Contents, Table of Figures, or similar lists.