[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hat accent bug
From: |
Gavin Smith |
Subject: |
Re: hat accent bug |
Date: |
Sat, 8 Aug 2015 16:14:29 +0100 |
On 2 August 2015 at 22:16, Karl Berry <address@hidden> wrote:
> It could be done somehow, I'm sure. But I don't want to spend the time
> to do it unless someone has a real document that really needs math in
> section titles. The bug has been there since @math was created and no
> one has ever complained about it, so I don't think any fix is needed.
> Seems like it would be more fruitful to spend time on improving the math
> support in general, e.g., to really support the commands, or to support
> displayed equations, or whatever.
It's not just in @math that @-commands have to be recognized by
makeinfo. It's also in @tex. Backslash can be used instead for
commands makeinfo doesn't know about, so I don't see any need for
change. Only that catcode changes are tricky TeX, as I've been
discovering and as you've long known; so using @ throughout for
catcode 0 seems nicer.
The following had good results for the testing I did. There's no
immediate need for anything like this but maybe it's an idea to bear
in mind if ever there are problems.
Index: Texinfo/Parser.pm
===================================================================
--- Texinfo/Parser.pm (revision 6455)
+++ Texinfo/Parser.pm (working copy)
@@ -5052,8 +5052,14 @@ sub _parse_texi($;$)
last;
}
} else {
- $self->line_error(sprintf($self->__("unknown command `%s'"),
- $command), $line_nr);
+ if ($self->{'context_stack'}->[-1] ne 'math'
+ and $self->{'context_stack'}->[-1] ne 'raw'
+ and $self->{'context_stack'}->[-1] ne 'rawpreformatted') {
+ $self->line_error(sprintf($self->__("unknown command `%s'"),
+ $command), $line_nr);
+ } else {
+ $current = _merge_text($self, $current, '@'.$command);
+ }
}