[l2h] adding perl implementations of commands to init

mjreed at essex.ac.uk mjreed at essex.ac.uk
Wed Oct 22 00:03:56 CEST 2003


Hi,

I am trying to add some custom commands to be implemented in a
latex2html init file.

I think I can pull all the information out of latex2html.pl and other
style.pl files to implement the code however I cannot get latex2html
to properly call my code.

say I have a latex macro

\def\mymacro#1#2{do with #1 and something with #2}

and I want to create a quick an dirty implementation in perl for it (I
do not have a style file and do not want to create one) so I put the
following in a latex2html init file:

sub do_cmd_mymacro{
	# do some processing
	join('', "command placeholder", $_);
}

latex2html ignores the perl code with a complaint:

*** wrap_cmd_mymacro not defined, cannot wrap \mymacro

However, if I implement a command as follows (just guessing from warning!)

sub wrap_cmd_mymacro{
	# do some processing
	join('', "command placeholder", $_);
}

It runs the command but not in a way that seems compatible with
do_cmd_mymacro type of invocation (it appears to repeat the beginning
of a line with the macro on). Is there a way to get Latex2html to call
do_cmd_mymacro as it does for commands in a style file?

I have played around with commands like

&process_commands_wrap_deferred (<<_RAW_ARG_DEFERRED_CMDS_);
mymacro # {} # {}
_RAW_ARG_DEFERRED_CMDS_

in the init file after the definition but this does not seem to help
(and I really do not know what this is doing anyway!)

There have been quite a few posts in the mail archive asking similar
questions but I have not seen any answers - maybe answering might open
a whole can of worms! Even an answer like "this is too hard" would be
better than nothing....

Thanks,

Martin
--
Dr. M.J. Reed                               Room:          4SB.6.15
Dept. Electronic Systems Engineering         Tel:+44 (0)1206 872479
University of Essex, Colchester CO4 3SQ, UK  FAX:+44 (0)1206 872900
mailto:mjreed at essex.ac.uk    Web: http://esewww.essex.ac.uk/~mjreed


More information about the latex2html mailing list