[tex4ht] Use Original \label as Anchor Text

Radhakrishnan CV cvr at river-valley.org
Wed Sep 23 19:56:27 CEST 2009

On 23-Sep-09, at 5:36 PM, Allen Barnett wrote:

> Hi: I'd like to be able to jump into the middle of the HTML  
> generated by
> tex4ht. So, I was wondering if there was a way to use the original
> \label text as the anchor id in the generated HTML? For example, I  
> have:
> \label{chp:ChapterTitle}
> and would like the HTML to have
> <a id="chp:ChapterTitle">
> instead of (or in addition to)
> <a id="x7-510005.1">.

\Get:SecAnchor macro does the job of inserting anchor id's as shown  
above to various anchor points. It has further implications and role  
in several places like TOC, next, previous, top, up, etc in a html  
page. If you want to use your label as the anchor point, I am afraid,  
it is a non-trivial task, particularly when your label occurs after  
the occurrence of a chapter heading. The following macro does the job  
of configuring chapter mark:

  \ConfigureMark{chapter}{\HCode{<a id="chp:ChapterTitle"></a>}}

You need to insert the label string as a parameter in place of  
'chp:ChapterTitle' so that your can use the above function in a  
generic fashion to insert labels as id's wherever possible. I would  
appreciate to see your results if you are successful to configure  
chaptermark successfully.

Best regards

"I had to censor everything my sons watched ... even on the Mary Tyler
Moore show I heard the word 'damn'!"
		-- Mary Lou Bax

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3685 bytes
Desc: not available
URL: <http://tug.org/pipermail/tex4ht/attachments/20090923/1b97dc18/attachment.bin>

More information about the tex4ht mailing list