[tex4ht] \autoref from hyperref with tex4ht

Radhakrishnan CV cvr at river-valley.org
Thu May 12 09:43:11 CEST 2011


On Wed, May 11, 2011 at 9:29 PM, William F Hammond
<hammond at csc.albany.edu> wrote:
> Radhakrishnan CV <cvr at river-valley.org> writes:
>> ...
>>> \usepackage{hyperref}
>>> ...
>>> \begin{figure}
>>>  \caption{My figure.}
>>>  \label{fig}
>>> \end{figure}
>>>
>>> See~\autoref{fig}.
>> ...
>> Attached is a newer version of nameref.4ht. In my tests, this version
>> seems to fix the problem of not only \autoref, but also \nameref which
>> was also broken.
>
> A brief experiment trying to write a newcommand to work
> around this
>
>  \newcommand{\figref}[1]{\href{\##1}{figure~\ref*{#1}}}
>
> suggests to me that \ref* -- hypperref's inert form of \ref
> producing the textual representation of the reference value
> without a link -- is not yet supported by tex4ht.
>
> And there's another issue here: the author-provided label
> key ("fig" in this example) is swallowed; it never appears
> in the html output.  So the particular location cannot be
> referenced in the standard html way as "#fig".  Instead if
> the author wanted to publish a link to the specific location
> the # reference would be, for my build, #x1-21, which one
> can hardly imagine as durable.

[...]

You're right, Bill. In a customized situation, TeX4ht can be
configured to generate output of your choice. It is very very flexible
to meet your requirements faithfully. However, the default behavior of
TeX4ht heavily relies on the input submitted to it  without need to
any extra configuration or coding.  Surely, that will miss certain
things as you have told above which is the price we pay for making
TeX4ht user friendly or less demanding from the users.

Best regards
-- 
Radhakrishnan



More information about the tex4ht mailing list