2

I am working on a document that contains a large amount of content of different type, that needs to be listed in several tables of contents.

e.g.

Contents
Chapter 1........................1
  Section 1.1....................1
  Section 1.2....................2
Chapter 2.......................14

List of Figures
Figure 1.........................7
Figure 2........................15

List of Tables
Table 1..........................4
Table 5..........................8

List of ItemTypeA
Group I
  ItemTypeA Description............3
  ItemTypeA Description...........14
Group II
  ItemTypeA Description............5
  ItemTypeA Description...........52

Lit of ItemTypeB
Group I
  ItemTypeB Description............7
  ItemTypeB Description...........11
  ItemTypeB Description...........21

One can use the commands

\tableofcontents

\listoffigures

\listoftables

to generate the first three tables of contents automatically.

  • How can I wrap an object (e.g. \lipsum or several paragraphs of content) of type ItemType as a single unit and add it to a personalized table of contents?

  • How can I display such table of contents?


EDIT: my question is different from this because i need to support some level of nesting within each custom table of contents.

  • Probably https://tex.stackexchange.com/a/388535/134144 can help. – leandriis Mar 22 '20 at 10:35
  • You could create a new float type using the newfloat package. This will provide a \listof... OTOH, you need to replace \caption with \addcontentsline and/or \addtocontents with the new filename. The trick is to look at the AUX to see how normal \captions are formatted. – John Kormylo Mar 22 '20 at 17:05

1 Answers1

1

You could use the tocloft package. The documentation (texdoc tocloft) section 2.4 New list of... describes how to create new contents-like lists, how to format the entries, and how to flag the entries in the document. Several examples are given.

Peter Wilson
  • 28,066
  • Thank you for your input. tocloft is close, but not quite like, the desired functionality; the main difference is that tocloft apparently groups/counts entries based on the document structure (chapters, sections, etc.), whereas the question asks for customized grouping. One option could be to use a separate command listof for each grouping and then change the textsize/font of the command \listofgroup. But that's outside my grasp at this moment. – Patrick Trentin Mar 22 '20 at 17:54
  • The ToC, LoF, LoT, and any other listof commands work by the appropriate elements in the document (chapters, sections, captions,etc) writing their data to the .aux file and on the next LaTeX run the ToC etc read the data from the .aux file and print it. If you want your listof to do sorting, as you imply, then I think that you will have to develop a lot of new code for that. Think about what you can do within the document structure itself. Sections are subservient to chapters; can you make similar constructs for your "ItemType..."/"Group..." elements? – Peter Wilson Mar 23 '20 at 18:25