[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon May 6 22:45:42 1994 
Subject:tailoring ved 
From:Terry Dartnall 
Volume-ID:940507.02 

I'm having problems in writing what should be a simple procedure to tailor
ved.  I feel pretty silly because I'm sure it's simple, but... where is the
information telling you how to tailor ved in any detail? (can it even be done?
 what am I missing?)

I have to do the index for a book, in LaTex.  Indexed items must appear
in the text as, for example

Eric\index{Eric}

So I want to be able to write a procedure that searches for a string such as
'Eric' or 'Eric Bloggs' and replace it with 'Eric\index{Eric}' or 'Eric
Bloggs\index{Eric Bloggs}'

That is, I want to be able to define a procedure, say ved_i, so that I
can do

ENTER i(string)     (or is it 'i/string'?)

whereupon it searches for the string and replaces it with string/index{string}

I thought it would be something simple, like:

define ved_i(string);
    vars vedargument;
    '/string/@&\\index{@&}' -> vedargument;
    ved_s();
enddefine;

but ... part of the problem seems to be that I can't pass the value of
string into the string that is the value of vedargument.  Another problem
is that the substitution stubbornly refuses to recognise the \ in front
of "index", even though I've put another \ in front of it.

It would also be nice to get Xved to replace a highlighted (in black)
string S with 'S\index{S}' at the click of a button.

Any help very much appreciated!

Terry Dartnall


Can you help, please?  I feel it's too trivial to send over the net.

Best wishes

Terry
-----------------------------------
Computing and Information Technology
Griffith University
Nathan Brisbane
Queensland 4111
Australia
phone (07) 875 5020
fax (07) 875 5051