ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* indexing suggestion
@ 2006-01-17 13:09 Hans van der Meer
  2006-01-17 14:43 ` Taco Hoekwater
  0 siblings, 1 reply; 2+ messages in thread
From: Hans van der Meer @ 2006-01-17 13:09 UTC (permalink / raw)


When I started to do my syllabus again but in ConTeXt, I also began  
to set up an index.
Readily it became a nuisance to type each time:
	in this sentence \index{sentence} etc.

Making this into a macro I am now typing:
	in this \indexed{sentence} etc.
It is a small difference but not only is it less typing, it also  
keeps the text more readable.
I coded this macro:
	\def\indexed#1{\index{#1}#1}
Note, \index{#1} preceeds typesetting of the text #1, otherwise the  
next space is eaten by \index.

Of course the full macro would be something like \indexed[whatever] 
{sentence}, and all the other options in \index[]{}.
However if have not enough experience with the way such things are  
cooked in ConTeXt and do not want to pollute the code with halfbaked  
code of my own.

Maybe Hans and Taco feel this suggestion useful enough to pick it up.

yours sincerely,
dr. H. van der Meer

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: indexing suggestion
  2006-01-17 13:09 indexing suggestion Hans van der Meer
@ 2006-01-17 14:43 ` Taco Hoekwater
  0 siblings, 0 replies; 2+ messages in thread
From: Taco Hoekwater @ 2006-01-17 14:43 UTC (permalink / raw)




Hans van der Meer wrote:
> Making this into a macro I am now typing:
>     in this \indexed{sentence} etc.


\def\indexed{\dosingleempty\doindexed}
\def\doindexed[#1]#2%
    {\iffirstargument\index[#1]{#2}\else\index{#2}\fi#2}

Cheers, Taco

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-01-17 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-17 13:09 indexing suggestion Hans van der Meer
2006-01-17 14:43 ` Taco Hoekwater

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).