[texhax] how to write href into an indexentry

Fehd, Ronald J. (CDC/CCHIS/NCHM) rjf2 at cdc.gov
Mon Aug 7 23:57:12 CEST 2006


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



More information about the texhax mailing list