[l2h] help files (.hhp .hhc .hhk)

Oscar Germán Duarte Velasco ogduartev at unal.edu.co
Tue May 4 15:54:11 CEST 2004

I need to create help files and I want to use latex/latex2html to do
that. I have found a previous message in this list
concerning with this topic, but no further references, so I have tried
to do it by myself, and I want to share with you the results.

The problem is to create 3 files (.hhp .hhc .hhk) whose format are
explained at:

In the message of August-2002 Ross Moore suggested a postproccesing of
the contents.pl or labels.pl files... I have tried a different
approach... I have used the latex2html-init file and the
custom_title_hook subroutine.

I do not know in depth the latex/latex2html code, and I have not written
any previous perl subroutine... so I am sure you can do a better job...
My init file is bellow. You will find some weak points:

1) The directory and file names managment
2) I must to add manually a "</UL>" line at the end of the .hhc and .hhk
3) No Anchors are proccessed, just file names
4) I must replace in the html files the ALIGN="MIDDLE" statments for
ALIGN="CENTER". A simple grep instruction do that. Why? because I am
using the wxWindows library (www.wxwindows.org), and the wxHTML class of
that library does not recognize the "MIDDLE".

I hope this wil be useful for anybody... at least it has been useful for

Oscar Duarte
Universidad Nacional de Colombia

$HTML_VERSION = 3.2,no_math;
$IMAGE_TYPE = 'gif';

open (HHP,">./fzn/help.hhp");
print HHP "Contents file=help.hhc\n";
print HHP "Index file=help.hhk\n";
print HHP "Title=Fuzzynet - Manual del Usuario\n";
print HHP "Default topic=node1.html\n";
close (HHP);

open (HHC,">/home/ogduarte/fuzzynethelp/fzn/fzn/help.hhc");
close (HHC);
open (HHK,">/home/ogduarte/fuzzynethelp/fzn/fzn/help.hhk");
print HHK "<UL>\n";
close (HHK);


sub custom_title_hook
  open (HHC,">>/home/ogduarte/fuzzynethelp/fzn/fzn/help.hhc");
  open (HHK,">>/home/ogduarte/fuzzynethelp/fzn/fzn/help.hhk");
  $return = "node" . $contadorNodos ;

  @tmp = split(/_/,$packed_curr_sec_id);
  foreach $i ( @tmp)
    if($i != 0)
  if($nivelAnterior < $nivel)
    print HHC "<UL>\n";
  if($nivelAnterior > $nivel)
    print HHC "</UL>\n";
  print HHC "<LI> <object type='text/sitemap'>";
  print HHC "<param name='Name' value='" . $_[0] . "'>\n";
  print HHC "<param name='ID' value=" . $contadorNodos . ">\n";
  print HHC "<param name='Local' value='" . $return . ".html'>\n";
  print HHC "</object>\n";
  print HHK "<LI> <object type='text/sitemap'>";
  print HHK "<param name='Name' value='" . $_[0] . "'>\n";
  print HHK "<param name='Local' value='" . $return . ".html'>\n";
  print HHK "</object>\n";
  close (HHC);
  close (HHK);


More information about the latex2html mailing list