ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: TOC with Grey background for pages belonging to last section of every chapter
Date: Mon, 2 Feb 2015 23:23:44 +0100	[thread overview]
Message-ID: <1375D1CA-977F-460D-8CC5-CA0C93E847C1@gmail.com> (raw)
In-Reply-To: <10244E89-A448-4EB6-8425-65C098BCB83E@web.de>


[-- Attachment #1.1: Type: text/plain, Size: 2014 bytes --]


> Am 02.02.2015 um 14:00 schrieb Keith J. Schultz <keithjschultz@web.de>:
> 
> Hi Wolgang,
> 
> I noticed that \startnamedsection does not add it to the TOC
> how would one go about having these „namedsections“ added to the TOC.
> 
> regards
> 	Keith.
> 
>> Am 02.02.2015 um 12:51 schrieb Wolfgang Schuster <schuster.wolfgang@gmail.com <mailto:schuster.wolfgang@gmail.com>>:
>> 
>> You have to add „location=paragraph” to the textbackground setup.
>> 
>> \definetextbackground
>>  [ChapterFrame]
>>  [frame=off,
>>   background=color,
>>   backgroundcolor=green,
>>   backgroundoffset=1ex,
>>   location=paragraph] % default: location=text
>> 
>> \definehead [Framed]    [chapter]
>> \definehead [Frameless] [chapter]
>> 
>> \setuphead
>>  [Frameless]
>>  [before={\blank[2*line]}]
>> 
>> \setuphead
>>  [Framed]
>>  [page=no,
>>   before=,
>>   beforesection={\page\blank[2*line]\starttextbackground[ChapterFrame]},
>>   aftersection=\stoptextbackground]
>> 
>> \starttext
>> 
>> \startnamedsection[Frameless][title=Chapter without frame]
>> 
>> \input knuth
>> 
>> \stopnamedsection
>> 
>> \startnamedsection[Framed][title=Chapter with frame]
>> 
>> \input knuth
>> 
>> \stopnamedsection
>> 
>> \stoptext

The command \startnamedsection[chapter] is the same as using \startchapter in your
document, the only difference is that you use the header-type as argument in the first
case while in the second case the head-type is part of the command name.

When you print your table of contents with the \placecontent or \completecontent
commands ConTeXt uses only headers which are in the list for the “content” list.
To print additional headers which are defined with \definehead in your document
you can either use \placelist[chapter,MYHEADER,section,…] instead of \placecontent
or you extend the list for “content” with \setupcombinedlist[content][list={chapter,MYHEADER,…}]
or \placecontent[list={chapter,MYHEADER,…}]

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 26642 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

      reply	other threads:[~2015-02-02 22:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 15:13 Rob Heusdens
2015-01-30 16:18 ` Rob Heusdens
2015-01-30 16:34   ` Wolfgang Schuster
2015-01-30 17:17     ` Rob Heusdens
2015-01-30 17:27       ` Wolfgang Schuster
2015-01-30 18:28         ` Rob Heusdens
2015-01-30 19:05           ` Wolfgang Schuster
2015-01-30 20:36             ` Rob Heusdens
2015-01-30 20:43             ` Rob Heusdens
2015-02-02 11:51               ` Wolfgang Schuster
2015-02-02 13:00                 ` TOC with " Keith J. Schultz
2015-02-02 22:23                   ` Wolfgang Schuster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1375D1CA-977F-460D-8CC5-CA0C93E847C1@gmail.com \
    --to=schuster.wolfgang@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).