[l2h] Re: Latex2HTML and Prettyref

Vladimir Klebanov unny@rz.uni-karlsruhe.de
Thu, 24 Jan 2002 20:47:41 +0100


Hi,

thanks a lot, Ross, for this quick course on hacking latex2html. The
prettyref.perl code you provided was very educating. The question that
remains (for me at least) is how can you add the hyperlinked section number?
Can you please give us a clue?

Vladimir


> sub do_cmd_prettyref {
>    local($_) = @_;
>    my($text, $label)=('','');
>    $label = &missing_braces unless (
>         (s/$next_pair_pr_rx/$label =$2;''/eo)
>         ||(s/$next_pair_rx/$label =$2;''/eo));
>    local(@s) = split(/:/, $label);
> 
>   SWITCH: {
>      if ($label =~ /^fig/) {
>        $text = "Figure"; last SWITCH;
>      }
>      if ($label =~ /^sec/) {
>        $text = "Section"; last SWITCH;
>      }
>      if ($label =~ /^tab/) {
>        $text = "Table"; last SWITCH;
>      }
>    $text = "Unknown Prefix";
>  
>    }
>  
>    join(' ', $text, $_);
> }

-- 
Vladimir Klebanov  --   unny@rz.uni-karlsruhe.de
                        http://www.uni-karlsruhe.de/~unny