In the same way that creating a standard table of contents makes use of levels (chapters, sections, subsections, etc.) Is there a way to create a custom function that that mimics this using tocloft? I have played around with modifications to #8 in this list of ways to customize toc to get the list of lists effect as well as this more in-depth guide on the behavior of the functions with no luck.
I am envisioning some custom function of the form:
\function{the chapter}{the section}
Called like this in the code:
\function{pine}{cone}
\function{pine}{wood}
\function{foo}{bar}
Generates a table of contents something like this when \listofWHATEVER is called:
Pine
cone
wood
foo
- bar
I know there are examples of doing this using custom environments or brute-forcing it using enumerate/itemize. But I'm hoping there is some way to do it with a custom command.
I've searched around and haven't seen a solution for this, it's possible I have been using the wrong keywords or simply missed it. Examples or links to a solution would be much appreciated.
tocloft
. Please read the documentation or guides like this for that purpose and then ask a specific question.\function{pine}{sawmill}
is called after\function{foo}{bar}
?3. Pine
andsawmill
then, but not 'sorted' into the firstPine
appearance?