Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline macro arguments break indexing, macro expansion #12

Open
thoelze1 opened this issue May 26, 2020 · 1 comment
Open

Multiline macro arguments break indexing, macro expansion #12

thoelze1 opened this issue May 26, 2020 · 1 comment

Comments

@thoelze1
Copy link
Contributor

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.

@webframp
Copy link
Owner

I don't have any great suggestions for this one, but am open to ideas from someone more experienced with texinfo to me and definitely will merge improvments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants