Eu tenho um documento que exibirá um resumo no início de cada capítulo. O resumo listará pontos importantes que aparecem posteriormente ao longo das passagens.
Por exemplo:
This chapter will talk about:
\printtopics
Section 1
Building a bridge is very easy. First start with some stones. Then,
\definetopic{How to build a temporary bridge from stones.}
find a narrow area in a river. Throw the stones into the river
until the river has completely stopped.
...
Isso produziria:
This chapter will talk about:
1. How to build a temporary bridge from stones.
2. How to hunt for rabbits.
3. How to find firewood.
Section 1
Building a bridge is very easy. First start with some stones. Then,
find a narrow area in a river. Throw the stones into the river
until the river has completely stopped.
...
O uso de \definetopic{How to build a temporary bridge from stones.}
significa que essas palavras são adicionadas à lista e aparecem no resumo no início do capítulo.
Como posso definir itens a serem adicionados a uma lista, aparecendo no início de um capítulo, mas defini-los dentro do texto do documento, no ConTeXt?
Responder1
Você pode definir uma lista local de capítulo para essa finalidade.
\definelist
[topics]
[criterium=chapter,
headnumber=always,
pagenumber=no]
\definecounter
[topic]
[way=bychapter]
\define[1]\definetopic{%
\incrementcounter[topic]%
\writetolist[topics]{\rawcountervalue[topic]}{#1}}
\starttext
\startchapter[title=Foo]
This chapter will talk about:
\placelist[topics]
\startsection[title=Bar]
\definetopic{How to build a temporary bridge from stones.}%
\input knuth
\definetopic{How to hunt for rabbits.}%
\input knuth
\definetopic{How to find firewood.}%
\input knuth
\stopsection
\stopchapter
\startchapter[title=Foo]
This chapter will talk about:
\placelist[topics]
\startsection[title=Bar]
\definetopic{How to hunt for rabbits.}%
\input knuth
\stopsection
\stopchapter
\stoptext