[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GLOBAL_COMMANDS needed for some customization (tex4ht for instance)
From: |
Gavin Smith |
Subject: |
Re: GLOBAL_COMMANDS needed for some customization (tex4ht for instance) |
Date: |
Sat, 30 Mar 2019 15:41:17 +0000 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Thu, Mar 28, 2019 at 02:45:54AM +0100, Patrice Dumas wrote:
> On Wed, Mar 27, 2019 at 06:57:27PM +0000, Gavin Smith wrote:
> > On Wed, Mar 27, 2019 at 01:38:03PM +0100, Patrice Dumas wrote:
> > > Hello,
> > >
> > > 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.
> > >
> > > Any idea on what should be done there?
> > >
> >
> > I'd missed those files when I removed this variable.
> >
> > I think the easiest thing to do would be to have these commands present
> > in GLOBAL_COMMANDS all the time. That would be easy to implement in
> > Perl and in the XS modules and no extra code would be needed to pass an
> > array configuration value to the XS code.
>
> The problem here is that we cannot know in advance which @-commands the
> user would like to have recorded.
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). 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.
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
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.
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.