Difference between revisions of "Command/definecombinedlist"

From Wiki
Jump to navigation Jump to search
(Create reference page)
 
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<!-- please remove this and the following line if you have checked this page -->
 
{{Reference_Cleanup}}
 
 
{{Reference
 
{{Reference
 
|name=definecombinedlist
 
|name=definecombinedlist
 
|attributes=
 
|attributes=
 
}}
 
}}
 +
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>definecombinedlist</syntax>
  
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==
<table cellspacing="4" cellpadding="2" class="cmd">
+
<syntax>definecombinedlist</syntax>
  <tr>
 
    <td colspan="2" class="cmd">\definecombinedlist<span class="first" >[...]</span><span class="second" >[...,...,...]</span><span class="third" style="color:red;">[...,...=...,...]</span></td>
 
  </tr>
 
  <tr valign="top" class="first">
 
    <td class="cmd">[...]</td>
 
    <td>name </td>
 
  </tr>
 
  <tr valign="top" class="second">
 
    <td class="cmd">[...,...,...]</td>
 
    <td>list </td>
 
  </tr>
 
  <tr valign="top" class="third">
 
    <td class="cmd">[...,...=...,...]</td>
 
    <td>see [[Reference/en/setupcombinedlist|\setupcombinedlist]] </td>
 
  </tr>
 
</table>
 
 
 
  
 
== Description ==  
 
== Description ==  
The command <pre>placecontent</pre> is available after definition with:
+
{{cmd|definecombinedlist|[mylist]}} creates the command {{cmd|placemylist|link=no}}.
  
    [[cmd:definecombinedlist]]
+
This command and {{cmd|definelist}} allows you to define your own lists necessary for structuring your documents.
                                                                                                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.
 
The use of this command and its related commands is illustrated for the table of contents.
                                                                                                  <texcode>
+
 
    \definelist[chapter]
+
<texcode>
    \setuplist
+
\definelist[chapter]
        [chapter]
+
\setuplist
        [before=\blank,
+
    [chapter]
        after=\blank,
+
    [before=\blank,
        style=bold]
+
    after=\blank,
    \definelist[section]
+
    style=bold]
    \setuplist
+
\definelist[section]
        [section]
+
\setuplist
        [alternative=d]
+
    [section]
 +
    [alternative=d]
 
</texcode>
 
</texcode>
  
Now there are two lists of chapters and sections and these will be combined in a table of contents with the command <pre>definecombinedlist</pre>.
+
Now there are two lists of chapters and sections and these will be combined in a table of contents with the command {{cmd|definecombinedlist}}.
  
 
<texcode>
 
<texcode>
    \definecombinedlist
+
\definecombinedlist
        [contents]
+
    [content]
        [chapter,section]
+
    [chapter,section]
        [level=subsection]
+
    [level=subsection]
 
</texcode>
 
</texcode>
  
Now two commands are available: <pre>placecontent</pre> and <pre>completecontent</pre>. With the second command the title of the table of contents will be added to the table of contents itself.
+
Now two commands are available: {{cmd|placecontent}} and {{cmd|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:
 
The layout of lists can be varied with the parameter alternative:
Line 65: Line 48:
 
* f = reserved for interactive purposes
 
* f = reserved for interactive purposes
  
Lists are set up with:
+
Lists are set up with: {{cmd|setuplist}} and {{cmd|setupcombinedlist}}.
    [[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.
 
If you want to change the layout of the generated table of contents you’ll have to remember that it is a list.
 
<texcode>
 
<texcode>
    \setupcombinedlist
+
\setupcombinedlist
      [content]
+
  [content]
      [alternative=c,
+
  [alternative=c,
      aligntitle=no,
+
  aligntitle=no,
      width=2.5cm]
+
  width=2.5cm]
 
</texcode>
 
</texcode>
  
 
This will result in a somewhat different layout than the default one.
 
This will result in a somewhat different layout than the default one.
  
Lists are called up and placed with:
+
Lists are called up and placed with   {{cmd|placelist}}.
 
 
    [[cmd:placelist]]
 
  
 
So if you want a table of content you type:
 
So if you want a table of content you type:
  
 
<texcode>
 
<texcode>
    \placecontent[level=section]
+
\placecontent[level=section]
    \completecontent[level=section]
+
\completecontent[level=section]
 
</texcode>
 
</texcode>
  
Line 94: Line 73:
  
 
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:
 
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:
    <pre>completecontent[2.2,8.5,12.3.3]</pre>
+
<texcode>\completecontent[2.2,8.5,12.3.3]</texcode>
  
 
A page break will occur after section 2.2 and 8.5 and sub section 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
+
In some cases you want to be able to write your own text in an automatically generated list. This is done with {{cmd|writetolist}} and {{cmd|writebetweenlist}}
    [[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:
 
For example if you want to make a remark in your table of contents after a section titled Hotels in Hasselt you can type:
 
<texcode>
 
<texcode>
    \section{Hotels in Hasselt}
+
\section{Hotels in Hasselt}
    \writebetweenlist[section]{\blank}
+
\writebetweenlist[section]{\blank}
 
</texcode>
 
</texcode>
 
  
 
== Example ==
 
== Example ==
Line 112: Line 88:
  
 
== See also ==
 
== See also ==
<!-- something like [[cmd:goto|\goto]] -->
+
<!-- something like {{cmd|goto}} -->
 +
 
 +
* {{cmd|setupcombinedlist}}
 +
* {{cmd|definelist}}
 +
* {{cmd|setuplist}}
 +
* [[Table of Contents]]
 +
 
 +
== Help from ConTeXt-Mailinglist/Forum ==
 +
All issues with:
 +
{{Forum|{{SUBPAGENAME}}}}
  
[[Category:Reference/en|definecombinedlist]]
+
[[Category:Command/Lists|definecombinedlist]]

Latest revision as of 16:51, 12 November 2019

\definecombinedlist

Syntax (autogenerated)

\definecombinedlist[...][...,...][...=...,...]
[...]name
[...,...]list
...=...,...inherits from \setupcombinedlist


Syntax

\definecombinedlist[...][...,...][...=...,...]
[...]name
[...,...]list
...=...,...inherits from \setupcombinedlist


Description

\definecombinedlist[mylist] creates the command \placemylist.

This command and \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
    [content]
    [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: \setuplist and \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 \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 \writetolist and \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

Help from ConTeXt-Mailinglist/Forum

All issues with: