bug-texinfo
[Top][All Lists]
Advanced

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

Re: backslashes, macros, indexes, texinfo


From: Gavin Smith
Subject: Re: backslashes, macros, indexes, texinfo
Date: Sat, 8 Aug 2015 15:30:44 +0100

> Allow me to post my work so far. I seem to have something working for
> backslashes. I haven't got { and } to work yet.
>
> My test file is "macro-backslash.texi", attached. I've tested macro
> invocations both with and without braces, to check that I am not
> messing anything up for the case with braces. To test this, try
> replacing one of the instances of "\\yesbrace" with "\yesbrace", in
> order to get an error message about an undefined control sequence. As
> you can see from the output dvi file, both "\\" and "\" effect a "\"
> in the output for a line argument.

A month or so ago I made more progress on this. If I remember
correctly, previous changes I posted had the flaw that the definition
of backslash would be permanently changed for the rest of the
document. I managed to fix this flaw, and went on to try to get \, to
work as an escape for a comma for macros taking multiple arguments.
This was more complicated though, and I never finished it.

The change I've attached to this email works for macros taking a
single argument only, and allows backslashes to appear on their own in
braced arguments, while double backslashes are converted into a single
backslash.

I'm sure it's possible to get it to work for macros of multiple
arguments as well, but I expect that that use case isn't as common; so
I figured it's better just to put out what I've got so far, instead of
holding out for a perfect solution that I may never finish.

\} and \{ aren't important to support: they would only be needed in
cases when a macro argument contains unbalanced braces.

I've attached a test file showing use of a @macro and a @rmacro for
braced and whole-line arguments. Please have a play around and post if
anything breaks.

Attachment: macro-backslash.patch
Description: Text Data

Attachment: bsbsbs.texi
Description: TeXInfo document


reply via email to

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