[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: backslashes, macros, indexes, texinfo
From: |
David Kastrup |
Subject: |
Re: backslashes, macros, indexes, texinfo |
Date: |
Sat, 08 Aug 2015 21:31:24 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Gavin Smith <address@hidden> writes:
>> 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.
breaks.
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2015/dev/Debian)
(preloaded format=pdfetex)
restricted \write18 enabled.
entering extended mode
(./music-glossary.texi (/usr/local/tmp/lilypond/tex/texinfo.tex
Loading texinfo [version 2015-08-03.11]: pdf, fonts, markup, glyphs,
page headings, tables, conditionals, indexing, sectioning, toc, environments,
defuns, macros, cross references, insertions,
(/usr/share/texlive/texmf-dist/tex/generic/epsf/epsf.tex
This is `epsf.tex' v2.7.4 <14 February 2011>
) localization, formatting, and turning on texinfo input format.)
(/usr/local/tmp/lilypond/tex/txi-en.tex) (./macros.texi (./version.texi)
(./common-macros.texi{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}{/usr/l
ocal/tmp/lilypond/tex/./out-www/lilypond.map} (./cyrillic.texi)))
./music-glossary.texi:39: Missing @endcsname inserted.
<to be read again>
@macroargdummy
@xrefX address@hidden @Xthisreftitle @csname XR#1
address@hidden address@hidden
l.2 address@hidden },,,web,General Information}
@empty
@scanmacro ...spaceisspace @scantokens address@hidden }
@endgroup
@macnamexxx ...es {#1},,,web,General Information}}
@egroup @egroup
l.4 @rweb{Manuals}
.
...
l.39 @lilyTitlePage{Music Glossary}
?
./music-glossary.texi:39: Emergency stop.
<to be read again>
@macroargdummy
@xrefX address@hidden @Xthisreftitle @csname XR#1
address@hidden address@hidden
l.2 address@hidden },,,web,General Information}
@empty
@scanmacro ...spaceisspace @scantokens address@hidden }
@endgroup
@macnamexxx ...es {#1},,,web,General Information}}
@egroup @egroup
l.4 @rweb{Manuals}
.
...
l.39 @lilyTitlePage{Music Glossary}
./music-glossary.texi:39: ==> Fatal error occurred, no output PDF file produce
d!
Transcript written on music-glossary.log.
/usr/bin/texi2dvi: pdfetex exited with bad status, quitting.
The definition of @rweb would be
@macro rweb{TEXT}
@vindex \TEXT\
@ref{\TEXT\,,,web-big-page,General Information}
@end macro
Anything more?
--
David Kastrup
- Re: backslashes, macros, indexes, texinfo, Gavin Smith, 2015/08/08
- Re: backslashes, macros, indexes, texinfo,
David Kastrup <=
- Re: backslashes, macros, indexes, texinfo, Gavin Smith, 2015/08/08
- Re: backslashes, macros, indexes, texinfo, Gavin Smith, 2015/08/08
- Re: backslashes, macros, indexes, texinfo, Gavin Smith, 2015/08/09
- Re: backslashes, macros, indexes, texinfo, David Kastrup, 2015/08/10
- Re: backslashes, macros, indexes, texinfo, Gavin Smith, 2015/08/10
- Re: backslashes, macros, indexes, texinfo, David Kastrup, 2015/08/10
- Re: backslashes, macros, indexes, texinfo, David Kastrup, 2015/08/10
- Re: backslashes, macros, indexes, texinfo, Gavin Smith, 2015/08/11
- Re: backslashes, macros, indexes, texinfo, Gavin Smith, 2015/08/12
- Re: backslashes, macros, indexes, texinfo, David Kastrup, 2015/08/15