Changes

Jump to navigation Jump to search
1,031 bytes added ,  16:39, 24 May 2013
no edit summary
== Using Table of Contents Placing the ToC ==
To get the default table of contents use:
</texcode>
== Modifying the default Table of Contents ToC ==
The default head that \completecontent places can be altered with
{{cmd|setupheadtext|[content=All my contents]}}.
You can customize the appearance, number of shown levels and other attributes of predefined TOCToC. <span style="color:red; font-weight: bold;">Please note that the <code>level</code> parameter has recently (02/2010) no effect in [[Mark IV]], however you can set the number of levels used in the table of contents with the list option (see the next section)</span>, you may use {{cmd|placelist|[chapter,section]}} (optionally adding {{cmd|title|{Contents}}} before) instead of {{cmd|setupcombinedlist|[content][level=2]}}.
<context source="yes">
\setuphead[subsubsection][number=no]
% TOCToC% level=4, \subsubsubsections are not listed in TOCToC
% alternative=c, space to the page number is filled with dots
\setupcombinedlist[content][level=4, alternative=c,]
</context>
== Setting the Number number of Sections sections in the Table of Contents ToC in [[Mark IV]] ==
To set the number of sections included in the table of contents you can explicitly set the list of items included in the 'contents' list. To include chapter, section, and subsection, in the table of contents use:
</context>
== Including unnumbered heads in the ToC == ConTeXts head mechanism is designed in such a way that heads are stored in a list when they have an incrementing counter, so you must activate this for the 'unnumbered' heads (title, subject, subsubject, etc.) In addition, the {{cmd|placecontent}} command is an aggregate of only the numbered heads; to place a list that also includes unnumbered heads, you must manually specify all the heads you want. <context mode=mkii source=yes>% mode=mkii\setuphead[subject] [incrementnumber=yes, % keep track of the number number=no] % but don't show it % Set area in which number is placed: % distance from margin to left edge of title% NB: recent versions of MkIV may ignore `width` % for unnumbered entries, and may require % you to set `margin`, instead.\setuplist[section][width=2cm]\setuplist[subject][width=2cm] \setupcombinedlist[content][list={chapter,subject,subsubject,section,subsection}] \setuppapersize[A7][A7]\starttext  \placecontent  \page  \chapter{One} \section{Sec A} \subject{Sub B} \section{Sec C}\stoptext</context> == Explicitly Excluding Headings excluding headings from the Table of Content ToC ==
To exclude headings from the table of contents, create a new heading that is a copy of the current heading. The new heading will not be in the list of heading that are printed to the table of contents. The command to create a copy of a heading is \definehead. Below is an example of excluding some subheadings from the table of contents. Note that typically this would be done for all subsections under a specific section, but as seen below this is not required:
== Page Numbering numbering in Table of Contents ToC ==
If you have a special page numbering style it won't automatically be reflected in the table of contents. You need to set the parameters of the table of contents separately. For example,
<span style="color:red; font-weight: bold;">The above method does not work in MkIV (not anymore at least).</span> Hence the code below illustrates how to get it working under MkIV. It should be noted that MkIV and MkII are incompatible with respect to this feature.
As an example, consider that the frontmatter uses roman numerals and bodymatter remains unchanged. To reflect the romannumerals of the front matter in the TOCToC,
<texcode>
</texcode>
== Forced page break in a TOC ToC ==
To add a manual/forced page break in a table of contents, you first have to define it. This puts the break before the given heading.
</texcode>
Then, when you place your TOCToC, you have to call for the extras and define the spot for the break:
<texcode>
see setup for author/title/subtitle titling and author in ToC in [[Proceedings_style]].
You can write "everything" desired items to the ToC or an other list (see below) using {{cmd|writetolist}}.
== Several ToC's in different languages ==
== How ConTeXt generates the table of contents is generated by ConTeXt ToC == 
(from Tobias Burnus [http://archive.contextgarden.net/message/20060809.162652.8f517267.en.html on the mailinglist])
In principle TeXExec should do this automatically.
== Tables of contents ToC (and other lists) via project structures ==
As of November 25, 2011, ConTeXt [[Mark IV]] supports the generation of lists via [[Project structure]]. Thus, given a product (possibly within some project), and given two or more components in that product with its own sections (chapters, sections, etc) or floats (figures, tables, etc); then each component can have its own list of contents independent of the other. This is done by setting ''criterium=component''. For example, create three files, one product and two components (slightly modified version of a sample posted by Hans):
== Suppressing page numbering for the TOC ToC pages ==
Sometimes the document needs to have pagenumbering according to realpages, but numbering shouldn't be visible until the first text page. This is Wolfgang's trick (January 2013) for suppressing the pagenumbers so that they'll still be counted:

Navigation menu