* Customize register format
@ 2014-03-09 23:56 Thangalin
0 siblings, 0 replies; only message in thread
From: Thangalin @ 2014-03-09 23:56 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
I am trying to reproduce the following register layout:
http://i.imgur.com/qXSK2VM.png
Entries include a section name, page number, author, and author URL;
the entries are formatted fairly differently from a standard index. So
far I have:
\setupinteraction[state=start,]
\define\Punctuate{\color[black]{\normal.}}
\define[2]\href{\begingroup\goto{\color[blue]{#1}}[url(#2)]\endgroup}
\define[1]\TextCommand{\item\currentregisterpageuserdata{title}, }
\define[1]\PageCommand{#1\Punctuate{}
{\href{\currentregisterpageuserdata{author}}{\currentregisterpageuserdata{authorurl}}}\Punctuate\stopitemize}
% #1 - Author; #2 - Author URL; #3 - Section title
\define[3]\PhotographerIndexEntry{%
\setregisterentry[PhotographerIndex][entries={#1}][
title={#3},
author={#1},
authorurl={#2},
]{}
}
\defineregister[PhotographerIndex][
n=1,
indicator=no,
textcommand=\TextCommand,
pagecommand=\PageCommand,
distance=\zeropoint,
before={\startitemize[packed,nowhite]},
]
\setuphead[section][aftersection=\page,]
\starttext
\startsection[title={Maguro}]
Text
\PhotographerIndexEntry{Kenji Fujimoto}{http://bit.ly/1fNWF0Y}{Maguro}
\stopsection
\startsection[title={Unagi}]
Text
\PhotographerIndexEntry{Kenji Fujimoto}{http://bit.ly/1fNWF0Y}{Unagi}
\stopsection
\placePhotographerIndex
\stoptext
This fails because values for "entries={#1}" must be unique.
How can I customize the registers to resemble the given layout?
(Aside, the section title is repeated twice -- is there a way to
remove the duplication? I tried \namedstructurevariable, but couldn't
figure out how to get the expanded value.)
Thank you.
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-03-09 23:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-09 23:56 Customize register format Thangalin
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).