Re: [NTG-context] [OT] Spacing research
On Thu, Nov 8, 2012 at 8:58 AM, Nicola wrote: > Hi, > people in this list may be interested in reading this: > > http://aldusleaf.org/rhea.php > > Nicola > really interesting -- luigi ___ 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 ___
Re: [NTG-context] Highlight current chapter in list
Am 08.11.2012 um 00:29 schrieb Marco Patzer : > Hi! > > How do I highlight the current chapter in the table of contents? The > TOC is displayed on each page. For illustration I misused the > interaction colour, which of course only works for the first page of > a chapter. > > \setupheadertexts >[\setups{headlist}] > > \startsetups [headlist] >\framed[align=normal, frame=off] > {\placelist [chapter] [alternative=f, criterium=all]} > \stopsetups > > \setupinteraction >[state=start, > color=lightgray, > contrastcolor=darkgreen] > > \starttext >\startchapter [title=alpha] \stopchapter >\startchapter [title=beta] \page\input knuth \stopchapter >\startchapter [title=gamma] \stopchapter > \stoptext You can use the marking mechanism to get the title of the current chapter. The problem for the solution below is to get a expandable version of the list entry because \currentlistentrytitle itself isn’t expandable and can’t be used in \doifelse. Instead of using \ctxcommand better ask Hans for a raw/expandable version of the tile/pagenumber commands. \setupheadertexts [\setups{headlist}] \startsetups [headlist] \framed[align=normal, frame=off] {\placelist [chapter] [alternative=highlight, criterium=all]} \stopsetups \definelistalternative [highlight] [renderingsetup=list:highlight] \startsetups [list:highlight] \par \startlinealignment[middle] \doifelse{\fetchmark[chapter][first]}{\currentlistentrytitle} %\doifelse{\fetchmark[chapter][first]}{\ctxcommand{listtitle("\currentlist",\currentlistindex)}} {\color[red] {\currentlistentrytitle}} {\color[blue]{\currentlistentrytitle}} \stoplinealignment \par \stopsetups \setupinteraction [state=start, color=lightgray, contrastcolor=darkgreen] \starttext \startchapter [title=alpha] \stopchapter \startchapter [title=beta] \page\input knuth \stopchapter \startchapter [title=gamma] \stopchapter \stoptext Wolfgang ___ 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 ___
Re: [NTG-context] Highlight current chapter in list
2012-11-08 Wolfgang Schuster: Hi Wolfgang! > \startsetups [headlist] > \framed[align=normal, frame=off] > {\placelist [chapter] [alternative=highlight, criterium=all]} > \stopsetups > > \definelistalternative > [highlight] > [renderingsetup=list:highlight] I like the flexibility of renderingsetups for \defineheadalternative, but frankly, I didn't know they can be used for lists as well and I was clueless about the best place to hook into. > \startsetups [list:highlight] > \par > \startlinealignment[middle] > \doifelse{\fetchmark[chapter][first]}{\currentlistentrytitle} > > %\doifelse{\fetchmark[chapter][first]}{\ctxcommand{listtitle("\currentlist",\currentlistindex)}} > {\color[red] {\currentlistentrytitle}} > {\color[blue]{\currentlistentrytitle}} > \stoplinealignment > \par > \stopsetups That's a neat and clean solution. Thanks Wolfgang. Marco ___ 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 ___
Re: [NTG-context] Highlight current chapter in list
On 11/8/2012 11:06 AM, Marco Patzer wrote: 2012-11-08 Wolfgang Schuster: Hi Wolfgang! \startsetups [headlist] \framed[align=normal, frame=off] {\placelist [chapter] [alternative=highlight, criterium=all]} \stopsetups \definelistalternative [highlight] [renderingsetup=list:highlight] I like the flexibility of renderingsetups for \defineheadalternative, but frankly, I didn't know they can be used for lists as well and I was clueless about the best place to hook into. \startsetups [list:highlight] \par \startlinealignment[middle] \doifelse{\fetchmark[chapter][first]}{\currentlistentrytitle} %\doifelse{\fetchmark[chapter][first]}{\ctxcommand{listtitle("\currentlist",\currentlistindex)}} {\color[red] {\currentlistentrytitle}} {\color[blue]{\currentlistentrytitle}} \stoplinealignment \par \stopsetups That's a neat and clean solution. Thanks Wolfgang. Wolfgang: Say that we have: \installcorenamespace{internalreference} \def\structureheadlocation#1% {\csname\??internalreference\ifcsname\??internalreference#1\endcsname#1\else\s!default\fi\endcsname} \letvalue{\??internalreference\s!default}\!!zerocount \def\storeinternalreference#1#2% {\setxvalue{\??internalreference\currentstructurename}{#2}} and in \strc_sectioning_register add: \storeinternalreference\currentstructurename\nextinternalreference then we can say: \startsetups [list:highlight] \par \startlinealignment[middle] \doifelse\currentlistentrylocation{\structureheadlocation{chapter}} {\color[red] {\currentlistentrytitle}} {\color[blue]{\currentlistentrytitle}} \stoplinealignment \par \stopsetups which is just comparing numbers (so one can also say: \startsetups [list:highlight] \par \startlinealignment[middle] \ifnum\currentlistentrylocation=\structureheadlocation{chapter}\relax \color[red] {\currentlistentrytitle} \else \color[blue]{\currentlistentrytitle} \fi \stoplinealignment \par \stopsetups but that's for low level coders) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] Highlight current chapter in list
On 11/8/2012 12:06 PM, Hans Hagen wrote: On 11/8/2012 11:06 AM, Marco Patzer wrote: 2012-11-08 Wolfgang Schuster: Hi Wolfgang! \startsetups [headlist] \framed[align=normal, frame=off] {\placelist [chapter] [alternative=highlight, criterium=all]} \stopsetups \definelistalternative [highlight] [renderingsetup=list:highlight] I like the flexibility of renderingsetups for \defineheadalternative, but frankly, I didn't know they can be used for lists as well and I was clueless about the best place to hook into. \startsetups [list:highlight] \par \startlinealignment[middle] \doifelse{\fetchmark[chapter][first]}{\currentlistentrytitle} %\doifelse{\fetchmark[chapter][first]}{\ctxcommand{listtitle("\currentlist",\currentlistindex)}} {\color[red] {\currentlistentrytitle}} {\color[blue]{\currentlistentrytitle}} \stoplinealignment \par \stopsetups That's a neat and clean solution. Thanks Wolfgang. the next beta has: \namedstructureheadlocation{name} so that you can compare \currentlistentrylocation with \namedstructureheadlocation{chapter} (todo: also store locations elsewhere?) Best document this before we forget about it. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] Highlight current chapter in list
2012-11-08 Hans Hagen: > the next beta has: \namedstructureheadlocation{name} > > so that you can compare > >\currentlistentrylocation > > with > >\namedstructureheadlocation{chapter} Thanks Hans. > Best document this before we forget about it. I assume that's my part, right? I'll extend or add a wiki page the weekend after the beta is released. Marco ___ 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 ___
Re: [NTG-context] RFC: path relative to current file.
Hello, Hans! I quoted this from your message: >>> local function toppath() >>> [...] >>> resolvers.toppath = topath When you commited version "eb24ffd", the following bug was introduced: >> There is a bug here. It should be >> resolvers.toppath = toppath >> (double "p" in the right side) > > In your local copy I presume, not here. Because of the bug (I presume), you removed the whole code. git diff -r eb24ffd tex/context/base/file-job.lua [...] @@ -553,22 +553,6 @@ function resolvers.jobs.currentenvironment() return topofstack(v_environment) en local done = { } local tolerant = false -- too messy, mkii user with the wrong sructure should adapt -local function toppath() -local pathname = dirname(inputstack[#inputstack] or "") -if pathname == "" then -return "." -else -return pathname -end -end - -resolvers.toppath = topath ===> HERE IS THE BUG (right above) <=== - -resolvers.prefixes.toppath = function(str) -local fullname = cleanpath(joinpath(toppath(),str)) -return fullname -end Are we giving up the feature? I was kind of using it already... :-( Cheers, André Caldas. ___ 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 ___
Re: [NTG-context] RFC: path relative to current file.
On 11/8/2012 1:14 PM, Andre Caldas wrote: Hello, Hans! I quoted this from your message: local function toppath() [...] resolvers.toppath = topath When you commited version "eb24ffd", the following bug was introduced: There is a bug here. It should be resolvers.toppath = toppath (double "p" in the right side) In your local copy I presume, not here. Because of the bug (I presume), you removed the whole code. git diff -r eb24ffd tex/context/base/file-job.lua [...] @@ -553,22 +553,6 @@ function resolvers.jobs.currentenvironment() return topofstack(v_environment) en local done = { } local tolerant = false -- too messy, mkii user with the wrong sructure should adapt -local function toppath() -local pathname = dirname(inputstack[#inputstack] or "") -if pathname == "" then -return "." -else -return pathname -end -end - -resolvers.toppath = topath ===> HERE IS THE BUG (right above) <=== - -resolvers.prefixes.toppath = function(str) -local fullname = cleanpath(joinpath(toppath(),str)) -return fullname -end Are we giving up the feature? I was kind of using it already... :-( you have a messed up system ... the code is in data-pre.lua Gabs - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
[NTG-context] \externalfigure and large-paged pdfs
Hi, Actually, this is a bug report. If you try to include a pdf with a large page size: \starttext \externalfigure[plankaart] \stoptext chances are that you get an error message like this: ! Dimension too large. \hsize \setraggedness ...yphenpenalty \dimexpr 2.8\hsize /\dimexpr #1\relax \relax ... \raggedcenter ...spac_align_set_raggedness_middle \raggedstatus \plustwo \at... \next ...ght \pack_framed_do_setups \raggedcenter \vss \bgroup \localbegstru... \grph_include_finalize ...tedexternalfigureframed {\vfilll \box \foundextern... \grph_include_place ...ode \grph_include_finalize \fi \ctxlua {figures.pop()... ... l.2 \externalfigure[plankaart] It seems that \externalfigure forces execution of \raggedcenter, and if your PDF's page is large enough, that then fails. There is, in fact, a workaroud: \starttext {\setupalign[nothyphenated]\externalfigure[plankaart]} \stoptext but that looks totally bizarre. Hans, can you find a way to fix this properly? Best wishes, Taco ___ 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 ___
Re: [NTG-context] \externalfigure and large-paged pdfs
2012/11/8 Taco Hoekwater : > Actually, this is a bug report. If you try to include a pdf with a large > page size: large being > (\maxdimen / 2.8) ? Best Martin PS: What would break if we extended dimens to 64/63 bit in LuaTeX? ___ 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 ___
Re: [NTG-context] \externalfigure and large-paged pdfs
On 11/8/2012 3:18 PM, Taco Hoekwater wrote: Hi, Actually, this is a bug report. If you try to include a pdf with a large page size: \starttext \externalfigure[plankaart] \stoptext chances are that you get an error message like this: ! Dimension too large. \hsize \setraggedness ...yphenpenalty \dimexpr 2.8\hsize /\dimexpr #1\relax \relax ... \raggedcenter ...spac_align_set_raggedness_middle \raggedstatus \plustwo \at... \next ...ght \pack_framed_do_setups \raggedcenter \vss \bgroup \localbegstru... \grph_include_finalize ...tedexternalfigureframed {\vfilll \box \foundextern... \grph_include_place ...ode \grph_include_finalize \fi \ctxlua {figures.pop()... l.2 \externalfigure[plankaart] It seems that \externalfigure forces execution of \raggedcenter, and if your PDF's page is large enough, that then fails. There is, in fact, a workaroud: \starttext {\setupalign[nothyphenated]\externalfigure[plankaart]} \stoptext but that looks totally bizarre. Hans, can you find a way to fix this properly? what happens if you do \setupexternalfigures[align=] Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] \externalfigure and large-paged pdfs
On 11/8/2012 4:09 PM, Hans Hagen wrote: \setupexternalfigures[align=none] \setuppapersize[A0] \starttext \externalfigure[cow.pdf][width=\maxdimen] \stoptext works ok here (which surprises me) (but as martin says: going 64 bit would be nice) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] \externalfigure and large-paged pdfs
On 11/08/2012 03:51 PM, Martin Schröder wrote: 2012/11/8 Taco Hoekwater : Actually, this is a bug report. If you try to include a pdf with a large page size: large being > (\maxdimen / 2.8) ? Yes. Best Martin PS: What would break if we extended dimens to 64/63 bit in LuaTeX? Some poor programmer's head ;) Seriously, the actual implementation would be quite a lot of work. There are definite places in the backend where a 64-bit number would be a no-no, and these have to be captured somewhere. And then there is the lua_Number that is a double, so it cannot fit a full 64-bit number without precision loss, etc. Best wishes, Taco ___ 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 ___
Re: [NTG-context] \externalfigure and large-paged pdfs
On 11/8/2012 4:32 PM, Taco Hoekwater wrote: On 11/08/2012 03:51 PM, Martin Schröder wrote: 2012/11/8 Taco Hoekwater : Actually, this is a bug report. If you try to include a pdf with a large page size: large being > (\maxdimen / 2.8) ? Yes. Best Martin PS: What would break if we extended dimens to 64/63 bit in LuaTeX? Some poor programmer's head ;) Seriously, the actual implementation would be quite a lot of work. There are definite places in the backend where a 64-bit number would be a no-no, and these have to be captured somewhere. And then there is the lua_Number that is a double, so it cannot fit a full 64-bit number without precision loss, etc. and 48 bit? - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] RFC: path relative to current file.
>> Are we giving up the feature? I was kind of using it already... :-( > > you have a messed up system ... the code is in data-pre.lua Indeed! :-) Sorry for the mess! Now, I have a bug at data-pre.lua. The variable inputstack is not defined there. Here is a fix: diff --git a/tex/context/base/data-pre.lua b/tex/context/base/data-pre.lua index 40b430b..3ef8c59 100644 --- a/tex/context/base/data-pre.lua +++ b/tex/context/base/data-pre.lua @@ -91,6 +91,7 @@ prefixes.home = function(str) end local function toppath() +local inputstack = resolvers.inputstack local pathname = dirname(inputstack[#inputstack] or "") if pathname == "" then return "." ___ 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 ___
Re: [NTG-context] Highlight current chapter in list
2012-11-08 Marco Patzer: > > Best document this before we forget about it. > > I assume that's my part, right? I'll extend or add a wiki page the > weekend after the beta is released. http://wiki.contextgarden.net/Command/definelistalternative Marco ___ 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 ___
Re: [NTG-context] Highlight current chapter in list
On 11/8/2012 6:32 PM, Marco Patzer wrote: 2012-11-08 Marco Patzer: Best document this before we forget about it. I assume that's my part, right? I'll extend or add a wiki page the weekend after the beta is released. http://wiki.contextgarden.net/Command/definelistalternative fyi: more commands will support a redering setup approach Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
Re: [NTG-context] [OT] Spacing research
On 11/08/2012 02:58 AM, Nicola wrote: Hi, people in this list may be interested in reading this: http://aldusleaf.org/rhea.php Nicola It was very interesting. Everything that makes my "stuff" look better is most welcome. -- Bill Meahan Westland, Michigan USA ___ 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 ___
[NTG-context] \chapter{} vs \startchapter..\stopchapter
I note there are two different ways of handling a chapter: The traditional \chapter{mytitle} \startchapter[title=mytitle, ownnumber=N ..] blah \stopchapter Is there any difference or advantage/disadvatage to using one method or the other? Other than the source code, is there anything that lists the keys for \startchapter somewhere? It's not documented in even the most recent command reference. Many thanks! -- Bill Meahan Westland, Michigan USA ___ 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 ___
Re: [NTG-context] \chapter{} vs \startchapter..\stopchapter
2012-11-08 Bill Meahan: > I note there are two different ways of handling a chapter: > > The traditional \chapter{mytitle} > > \startchapter[title=mytitle, ownnumber=N ..] >blah > \stopchapter > > Is there any difference or advantage/disadvatage to using one method or > the other? With the start…stop syntax you can easily apply different options to the individual structure elements or add additional information. The \chapter syntax is less verbose but less flexible. But it has at least one caveat that I know: The insidesection key of \setuphead does not work. > Other than the source code, is there anything that lists the keys for > \startchapter somewhere? Keys that I know about: \startchapter[ label=..., title=..., marking=..., list=..., bookmark=..., reference=... ] \stopchapter You can also add an additional pair of brackets with custom settings: \startchapter [title={First chapter}] [foo=bar] \stopchapter In the setups this information is accessible as: \structureuservariable{foo} > It's not documented in even the most recent command reference. Welcome to ConTeXt :) Be the first of your friends to add this information to the wiki. Marco ___ 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 ___
Re: [NTG-context] Highlight current chapter in list
2012-11-08 Wolfgang Schuster: > \setupheadertexts > [\setups{headlist}] > > \startsetups [headlist] > \framed[align=normal, frame=off] > {\placelist [chapter] [alternative=highlight, criterium=all]} > \stopsetups > > \definelistalternative > [highlight] > [renderingsetup=list:highlight] Why does the custom list alternative succeed in a header but fails in a layer? A predefined alternative works perfectly in a layer. \setupfootertexts [\setups{footlist}] \setupbackgrounds [page] [background=layer:chapter] \definelayer [layer:chapter] [state=repeat] \setlayer [layer:chapter] {\placelist [chapter] [alternative=f, criterium=all]}%% works %% {\placelist [chapter] [alternative=highlight, criterium=all]} %% fails \definelistalternative [highlight] [renderingsetup=list:highlight] \startsetups [list:highlight] \currentlistentrytitle \stopsetups %% works \startsetups [footlist] \placelist [chapter] [alternative=highlight, criterium=all] \stopsetups \starttext \startchapter [title=Alpha] \stopchapter \startchapter [title=Beta] \stopchapter \startchapter [title=Gamma] \stopchapter \stoptext Marco ___ 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 ___
Re: [NTG-context] Highlight current chapter in list
2012-11-08 Marco Patzer: I just realized when I presses “send”: > Why does the custom list alternative succeed in a header but fails > in a layer? A predefined alternative works perfectly in a layer. > > \setupfootertexts > [\setups{footlist}] > > \setupbackgrounds > [page] > [background=layer:chapter] \setupbackgrounds [page] [background=layer:chapter, setups=setups:headlayer] > \setlayer > [layer:chapter] > {\placelist [chapter] [alternative=f, criterium=all]}%% works > %% {\placelist [chapter] [alternative=highlight, criterium=all]} %% fails \startsetups [setups:headlayer] \setlayer [layer:chapter] {\placelist [chapter] [alternative=highlight, criterium=all]} \stopsetups Well, we have dynamic content, so wrap it in a setup. Marco ___ 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 ___
Re: [NTG-context] Highlight current chapter in list
Am 08.11.2012 um 22:37 schrieb Marco Patzer : > 2012-11-08 Wolfgang Schuster: > >> \setupheadertexts >> [\setups{headlist}] >> >> \startsetups [headlist] >> \framed[align=normal, frame=off] >>{\placelist [chapter] [alternative=highlight, criterium=all]} >> \stopsetups >> >> \definelistalternative >> [highlight] >> [renderingsetup=list:highlight] > > Why does the custom list alternative succeed in a header but fails > in a layer? A predefined alternative works perfectly in a layer. Header and footers are added and calculated after the page is finished but when you put a text in a layer it is fixed at this moment. The problem in your example with the custom list alternative is that you haven’t defined it when it is needed, when you put \definelistalternative and \startsetups … \stopsetups before \setlayer you can see it. For a dynamic layer take a look at this wiki page: http://wiki.contextgarden.net/Layers#Use_dynamic_content Wolfgang ___ 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 ___
Re: [NTG-context] Highlight current chapter in list
On 11/8/2012 10:48 PM, Wolfgang Schuster wrote: Am 08.11.2012 um 22:37 schrieb Marco Patzer : 2012-11-08 Wolfgang Schuster: \setupheadertexts [\setups{headlist}] \startsetups [headlist] \framed[align=normal, frame=off] {\placelist [chapter] [alternative=highlight, criterium=all]} \stopsetups \definelistalternative [highlight] [renderingsetup=list:highlight] Why does the custom list alternative succeed in a header but fails in a layer? A predefined alternative works perfectly in a layer. Header and footers are added and calculated after the page is finished but when you put a text in a layer it is fixed at this moment. The problem in your example with the custom list alternative is that you haven’t defined it when it is needed, when you put \definelistalternative and \startsetups … \stopsetups before \setlayer you can see it. For a dynamic layer take a look at this wiki page: http://wiki.contextgarden.net/Layers#Use_dynamic_content here is another variant: \defineoverlay[pagenumber:preset][\texsetup{pagenumber:preset}] \startsetups pagenumber:preset PRESET \stopsetups \defineoverlay[pagenumber:action][\texsetup{pagenumber:action}] \startsetups pagenumber:action ACTION \stopsetups \setupbackgrounds [page] [background={pagenumber:preset,pagenumber:action}] \starttext \dorecurse{4}{\page[empty]} \stoptext (just to illustrate that an overlay can be used for anything) - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 ___
[NTG-context] Tikz backgrounds (was Re: Highlight current chapter in list)
On Thu, 8 Nov 2012, Hans Hagen wrote: (just to illustrate that an overlay can be used for anything) This prompted me to finish testing what I had been thinking about for a while. In most cases, metapost is sufficient for drawing backgrounds, but occasionally using tikz is nicer. For example, when tikz provides a solution that is not available in metapost (e.g., drawing "snake" paths), or extremely difficult to get right in metapost (drawing shadows). As Hans said, overlays can be used for anything, including tikz background. Here is a proof of concept implementation: \usemodule[tikz] \usetikzlibrary[decorations.pathmorphing] \def\TIKZdecorationoverlay {\starttikzpicture \expanded{\draw[\overlaylinecolor, line width=\overlaylinewidth, decorate, decoration={\framedparameter{decoration}}] (0,0)--(\overlaywidth,0) -- (\overlaywidth,\overlayheight) -- (0,\overlayheight) -- cycle;} \stoptikzpicture} \defineoverlay[decoration][\TIKZdecorationoverlay] \setupframed [decoration=snake] \starttext \framed[frame=off, rulethickness=3bp, background=decoration, backgroundoffset=3mm, framecolor=red, align=normal] {\input ward \endgraf} \blank[2*big] \externalfigure [cow] [frame=off, frameoffset=5pt, backgroundoffset=frame, background=decoration, decoration={coil, amplitude=4pt, segment length=5pt}] \stoptext Aditya ___ 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 ___