[texhax] how to write href into an indexentry

John R. Culleton john at wexfordpress.com
Tue Aug 8 16:55:43 CEST 2006

On Monday 07 August 2006 17:57, Fehd, Ronald J. (CDC/CCHIS/NCHM) wrote:
> I am beginning work on a project to write an index
> of conference proceedings.
> I would like to have an href in each
> of my conference proceedings index entries
> in order to save the user one click and a page search
> i.e.: from having to click backward into the document
> using the hyperpage link
> and then find the paper on the page.
> here are my LaTeX commands
> \renewcommand{\writeurl}{\href{http://www2.sas.com/proceedings/sugi30/??
> }{??}}
> \newcommand{\Index}[2][default]{\index[#1]{#2 \writeurl}}%
> \Index[xauthor]{Fehd, Ronald!macro tools}
> which generates this
> \indexentry {Fehd, Ronald!macro tools \writeurl |hyperpage}{1}
> and what I get is this:
> \item Fehd, Ronald
> \subitem macro tools \writeurl , \hyperpage{2}
> when what I want is this:
> \item Fehd, Ronald
> \subitem macro tools
> \href{http://www2.sas.com/proceedings/sugi30/004-30.pdf}{sugi30-004}},
> \hyperpage{2}
> I am primarily a LaTeX user
> and have no problem understanding the issues of writing LaTeX macros
> however, after thumbing through the blue book on TeX commands
> I'm thinking I will need either edef or xdef
> I am willing to settle for something simple like:
> \newcommand{\writeurl}[2]{
> \href{http://www2.sas.com/proceedings/sugi30/#1}{#2}}
> \item Fehd, Ronald
> \subitem SAS
> \writeurl{004-30.pdf}{sugi30-004},
> \hyperpage{2}
> Q: what are the issues of macro resolution
> to get the pdf-name and text written into the index file?
> thanx,
> Ron Fehd  CDC Atlanta
> note: I read texhax in digest
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org

I think Context has a facility like this but I have never tried
to use it. 

I suggest you look at the file samplepdf.tex in the pdtex distro.
This is not LaTeX but the commands should still work, First you
establish a destination on a page, and then you refer to it. Try
pages 9 and 10 of  samplepdf pdf.  

Another option is to use the pdf bookmark facility. This is in
effect another form of index. 

John Culleton
Able Indexing and Typesetting
Precision typesetting (tm) at reasonable cost.
Satisfaction guaranteed. 

More information about the texhax mailing list