[NTG-context] Reference text differing from title

Christoph Reller christoph.reller at gmail.com
Mon Dec 29 16:09:19 CET 2014


On Wed, Nov 26, 2014 at 6:32 AM, Christoph Reller <
christoph.reller at gmail.com> wrote:
>
> On Tue, Nov 25, 2014 at 5:33 PM, Wolfgang Schuster wrote:
>
>> > Am 24.11.2014 um 14:00 schrieb Christoph Reller <
>> christoph.reller at gmail.com>:
>> >
>> > Is it possible to change the text shown in \about[...] to be something
>> else than the text given to the title key of \startsection?
>> >
>> > \starttext
>> > \startsection[
>> >   title={Very Long},
>> > %  referencetext={Short}, % <- is there something like this?
>> >   reference=mysec]
>> >   We are now in \about[mysec]. % <- should render as "Short"
>> > \stopsection
>> > \stoptext
>> >
>> > Thank you for any help,
>>
>> You can use the selector mechanism to set multiple texts for the title.
>>
>> \defineselector[chaptertitle][max=2,n=2]
>>
>> \setuplist[chapter][textcommand={\setupselector[chaptertitle][n=1]}]
>> \setuphead[chapter][textcommand={\setupselector[chaptertitle][n=1]}]
>>
>> \starttext
>>
>> \completecontent
>>
>> \startchapter[reference=sec:short,title=\select{chaptertitle}{Long title
>> for the chapter}{Short title}]
>>
>> \input knuth
>>
>> \about[sec:short]
>>
>> \stopchapter
>>
>> \stoptext
>>
>> Wolfgang
>>
>
> Thank you Wolfgang! This is a perfect solution.
> Christoph
>

Dear Wolfgang,

The example you have provided works well for section titles, table of
contents and references. What about bookmarks? The following extension of
your example produces a bookmark "1 chaptertitle{Long title for the
chapter}{Short title}":

\setupinteraction[state=start]
\placebookmarks[chapter]
\defineselector[chaptertitle][max=2,n=2]
\setuphead[chapter][textcommand={\setupselector[chaptertitle][n=1]}]
\starttext
\startchapter[reference=sec:short,title=\select{chaptertitle}{Long title
for the chapter}{Short title}]
\input knuth
\about[sec:short]
\stopchapter
\stoptext

For setuphead, is there something like a "textcommand" key for bookmarks?

Thank you for any help,
Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20141229/511c4068/attachment.html>


More information about the ntg-context mailing list