Command/definecombinedlist

From Wiki
< Command
Revision as of 12:37, 11 April 2010 by Maintenance script (talk) (Create reference page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Reference Cleanup

\definecombinedlist

Syntax

\definecombinedlist[...][...,...,...][...,...=...,...]
[...] name
[...,...,...] list
[...,...=...,...] see \setupcombinedlist


Description

The command

placecontent

is available after definition with:

   cmd:definecombinedlist
                                                                                               commands

This command and cmd:definelist allows you to define your own lists necessary for structuring your documents. The use of this command and its related commands is illustrated for the table of contents.

    \definelist[chapter]
    \setuplist
        [chapter]
        [before=\blank,
         after=\blank,
         style=bold]
    \definelist[section]
    \setuplist
        [section]
        [alternative=d]

Now there are two lists of chapters and sections and these will be combined in a table of contents with the command

definecombinedlist

.

    \definecombinedlist
        [contents]
        [chapter,section]
        [level=subsection]

Now two commands are available:

placecontent

and

completecontent

. With the second command the title of the table of contents will be added to the table of contents itself.

The layout of lists can be varied with the parameter alternative:

  • a = number – title – page number
  • b = number – title – spaces – page number
  • c = number – title – dots – page number
  • d = number – title – page number (continuing)
  • e = reserved for interactive purposes
  • f = reserved for interactive purposes

Lists are set up with:

   cmd:setuplist
   cmd:setupcombinedlist

If you want to change the layout of the generated table of contents you’ll have to remember that it is a list.

    \setupcombinedlist
      [content]
      [alternative=c,
       aligntitle=no,
       width=2.5cm]

This will result in a somewhat different layout than the default one.

Lists are called up and placed with:

   cmd:placelist

So if you want a table of content you type:

    \placecontent[level=section]
    \completecontent[level=section]

only the sections will be displayed. You might need this option when you have a well structured document that has sub sub sub sub sub sections and you don’t want those in the table of contents.

A long list or a long table of contents will use up more than one page. To be able to force page breaking you can type:

completecontent[2.2,8.5,12.3.3]

A page break will occur after section 2.2 and 8.5 and sub section 12.3.3. In some cases you want to be able to write your own text in an automatically generated list. This is done with

   cmd:writetolist
   cmd:writebetweenlist

For example if you want to make a remark in your table of contents after a section titled Hotels in Hasselt you can type:

    \section{Hotels in Hasselt}
    \writebetweenlist[section]{\blank}


Example

See also