Hi,
Starting from the “Non-Fiction Format for LaTeX” template, I’m trying to modify the “Unnumbered Chapter” section layout such that it appears in the Table of Contents. I created a copy of the default format to allow editing, and tried modifying the “Section prefix” segment as follows:
While this does add unnumbered chapters to my ToC, it gives all of them the title of “Section Title”, as opposed to detecting their actual titles. How do I modify the code to dynamically react to chapter titles? Or is there a different way to achieve this goal?
Thanks in advance.
You have to use the placeholder (variable) instead of the literal text “Section Title” in your LaTeX code. So where you have
\addcontentsline{toc}{chapter}{Section Title}
delete “Section Title” and replace it with <$title>:
\addcontentsline{toc}{chapter}{<$title>}
If you have any punctuation in your titles, you may have to do something to escape that text. I’ve found that sometimes adding a extra set of {} around the title helps.
A list of all placeholders can be found under the Help menu.
That works perfectly, thank you! And I appreciate the pointer to the other placeholders, that will be useful.