Skip to content

Multiline macro arguments break indexing, macro expansion #12

@thoelze1

Description

@thoelze1

Each time a new term is introduced, the following macro is used to add the term to the index (with @cindex) and format the term (with @dfn):

@macro newterm{term}
@cindex \term\
@dfn{\term\}
@end macro

Sometimes term happens to span multiple lines (usually due to the 80-character fill-width used in sicp.texi), which is fine because @newterm has only one argument (see the manual). However, @cindex takes its argument on a single line (see the manual) so when term spans multiple lines, @cindex adds only the first line of term to the index, and the remaining lines are simply expanded in the macro. Therefore the following source in sicp.texi (line 1388):

Such exceptions to the general evaluation rule are called @newterm{special
forms}.

Expands into:

Such exceptions to the general evaluation rule are called @cindex special
forms @dfn{special
forms}.

Which results in the following sicp.info:

  Such exceptions to the general evaluation rule are called forms
"special forms".

@newterm is used about 424 times in sicp.texi and its argument occurs on a line break about 31 times (resulting in the undesirable behavior of the index and macro expansion). I tried adjusting the @newterm macro in a few ways to collapse term into a single line, but I wasn't able (maybe someone more familiar with texinfo/tex knows a way?). Editing the 31 problematic macro invocations would certainly solve this, but would defy the 80-character fill-width.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions