From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/80167 Path: news.gmane.org!not-for-mail From: Sietse Brouwer Newsgroups: gmane.comp.tex.context Subject: Re: How to use module simpleslides' SideToc Date: Wed, 9 Jan 2013 15:47:08 +0100 Message-ID: References: <20130108105658.2762be6e@iram-hb-003386.extra.cea.fr> <20130108151028.55af3352@iram-hb-003386.extra.cea.fr> <50EC9D28.4010508@uni-bonn.de> <50ECA3F2.2080101@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1357742867 13127 80.91.229.3 (9 Jan 2013 14:47:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Jan 2013 14:47:47 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 09 15:48:03 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tswwk-0000Nf-Jm for gctc-ntg-context-518@m.gmane.org; Wed, 09 Jan 2013 15:48:02 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 15837101EC; Wed, 9 Jan 2013 15:47:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id uArFwp4wSKeP; Wed, 9 Jan 2013 15:47:41 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id B181E101E6; Wed, 9 Jan 2013 15:47:41 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 966D5101E6 for ; Wed, 9 Jan 2013 15:47:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id MJ0KQlwyto+H for ; Wed, 9 Jan 2013 15:47:39 +0100 (CET) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id 71401101E5 for ; Wed, 9 Jan 2013 15:47:39 +0100 (CET) Original-Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r09Elc50004490 for ; Wed, 9 Jan 2013 15:47:38 +0100 Original-Received: by mail-ee0-f41.google.com with SMTP id d41so875186eek.28 for ; Wed, 09 Jan 2013 06:47:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=HgaWqmBs3lWYJJ4BWBfxNRmIUcSTRDEKQ5WlJT+nyko=; b=UEL8nNWR+Oog6fOSDkCrMHZKHzjpHjywubP4C2ser5kKdmlzcZ51ZTteOLhXTg9LUL 6I0swqy+XqEVX1b8lxv0Z2vzW3IFcRRUdnjIHB3uCLenCokFi/2V4FKTLXs31MWR+zcd PnD1K3b6EDV8cJR8ni0/dI94lxcYtvGlJjrItT0rNXqoMMmd8s6yoABuYU0PvsJkgww5 VSs2TO/VjU4HXshR/xLrll9QrGfTIx4i1kPP21s+fnR4eLC+wEiMf95Xy/H5Hopl3yaz +IJ0RDdfjUO9U73qLijs+Q+OolDfjER7WlRySPkeLsonCODZZYU7zSTBlNr5zWFdFZ+d 5TIw== Original-Received: by 10.14.178.196 with SMTP id f44mr183131001eem.14.1357742858648; Wed, 09 Jan 2013 06:47:38 -0800 (PST) Original-Received: by 10.14.101.129 with HTTP; Wed, 9 Jan 2013 06:47:08 -0800 (PST) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.83.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0NIJOLC9S - dbe3b58408ca - 20130109 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:80167 Archived-At: Hello PengCZ, This is not exactly what you want, because it took me very long to remember to look at SideToc.pdf. But it is close, and I have tried to put in a lot of comments. Hopefully you can solve it from here? Cheers, and good luck, Sietse % * We use \Topic to set the current topic, and to % record it in the topic list % * \setuptexttexts places the topic list in the left margin % on every page % http://wiki.contextgarden.net/Command/setuptexttexts % (needs improving) % * \setupbackgrounds sets the backgrond color of the left % margin on every page: this highlights the TOC area % http://wiki.contextgarden.net/Command/setupbackgrounds % * the entry typesetting command (called \FancyTopic) typesets % entries inside a \framed block as wide as the margin is. % This allows highlighting the background of the current topic, % and also allows linebreaks etc. % http://wiki.contextgarden.net/Command/framed \setuppapersize[A6,landscape][A6,landscape] \setuplayout [leftmargin=5cm, backspace=6cm, width=6cm, ] % Color for the margin (topic list area) \definecolor[colMyTopics][r=1,g=0.7,b=0.7] % pink % Color for the current topic (in the topic list) % I like white, because it attaches the current topic to the % main area; but perhaps you prefer pale yellow? % \definecolor[colCurrentTopic][r=1,g=1,b=0.7] % pale yellow \definecolor[colCurrentTopic][r=1,g=1,b=1] % white % When \placelist[MyTopics] is called, it calls this \FancyEntry % function to typeset each individual entry. % #1: entry (i.e. topic name) to typeset % \MyMark: section (i.e. topic name) we are currently in (set by % \Topic). \define[3]\FancyEntry { \ifnum\structurelistrealpagenumber=\realpageno\relax SAME \else OTHER \fi PAGE \blank[medium] \doifelse \rawstructurelistfirst \MyMark {\framed[frame=off, align=normal, width=5cm, % same as leftmargin in \setuplayout background=color, backgroundcolor=colCurrentTopic]{% --- current mark's entry \par \color[red]{--- arg (entry): #1}\par \color[red]{--- mark: \MyMark} }} {\framed[frame=off, align=normal]{% --- other entry \par \color[blue]{--- arg (entry): #1}\par \color[blue]{--- mark: \MyMark} }} \blank[medium] } % Show the margin areas, headers, footers, etc. \showframe % Color the margin area. \setupbackgrounds must be called after % \showframe, or \showframe will 'overwrite' \setupbackgrounds. \setupbackgrounds[text][leftmargin][ background=color, backgroundcolor=colMyTopics] \definelist[MyTopics][criterium=all] \def\MyMark{} % \Topic takes one optional argument: #1, the topic name. \def\Topic% {\dosingleargument\doTopic} \def\doTopic[#1]{% % let it be known that we are in section #1 (used by \FancyTopic) \def\MyMark{#1}% % let topic #1 appear in the TOC (well, the MyTopics list) \writetolist[MyTopics]{#1}{}% } \setuplist[MyTopics] [pagenumber=no, alternative=command, command=\FancyEntry] % On every page, place the TOC in the margin, plzkthx \setuptexttexts[margin][\vbox{\placelist[MyTopics]}][] \starttext \Topic[First] First Topic \page \Topic[Second] Second Topic \page \Topic[Third] Third Topic \stoptext ___________________________________________________________________________________ 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 ___________________________________________________________________________________