bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GLOBAL_COMMANDS needed for some customization (tex4ht for instance)


From: Patrice Dumas
Subject: Re: GLOBAL_COMMANDS needed for some customization (tex4ht for instance)
Date: Wed, 3 Apr 2019 23:36:26 +0200
User-agent: Mutt/1.10.1 (2018-07-13)

On Sat, Mar 30, 2019 at 03:41:17PM +0000, Gavin Smith wrote:
> On Thu, Mar 28, 2019 at 02:45:54AM +0100, Patrice Dumas wrote:
> > > > 
> > > > GLOBAL_COMMANDS is needed for tp/init/tex4ht.pm and 
> > > > tp/init/latex2html.pm
> > > > to specify that these config files need the @math and @tex @-commands
> > > > added to the @-commands informations put in the parser 'extra' field.
> > > > However, GLOBAL_COMMANDS was removed in commit 
> > > > 828a4add2fea759fa26872f4d9efff84becd7964.
>
> There may be other ways for the user to do what they want.  They could 
> process the commands as they come to them in the main tree (looking at 
> tex4ht.pm, with a texinfo_register_command_formatting handler).

I do not think so, at least for the tex4ht or latex2html use, as the
principle is to gather all the commands, convert only once and then 
substitute using handlers registered through 
texinfo_register_command_formatting.

> Another 
> idea is to search through the entire tree for the commands, iterating 
> through the 'args' and 'contents' for each element - I doubt that that 
> would take too much time.

I have implemented that solution, this seemed to me to be the cleanest.

> If I understand tex4ht.pm correctly, first all the contents of @math and 
> @tex are collected and passed to the tex4ht program, which is only run 
> once or twice for the entire document.  The result is split up according 

Once per @-command, so once for @math and once for @tex.  With
latex2html once.  With latex2html, additionally a cache is used to avoid
rerunning so the document actually passed to latex2html can change
depending on what is in the cache.

> to each input block, and then when the main part of conversion takes
> place, these saved results are used.  Maybe tex4ht could be run once for 
> each @tex or @html block instead.

You mean each @math and @tex black, I presume...  I do not like this
options, that would lead to many small files being created, I'd rather
avoid that.  The only advantage I would see would be a possibility to
parallelize.

> init/tex4ht.pm could be fixed by putting 'math' and 'tex' in the list of 
> global commands permanently, but I think it's likely that other init 
> files that might be written could do things differently so as not to use 
> the global commands arrays.  It's possible that nobody will ever want to 
> write another init file that adds global commands.

With the change I did it is not needed anymore for those commands to be
in global commands.  I think that they should actually be removed from
the global commands.

-- 
Pat



reply via email to

[Prev in Thread] Current Thread [Next in Thread]