[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Effect of newline in macro definition
From: |
Gavin Smith |
Subject: |
Effect of newline in macro definition |
Date: |
Tue, 2 Dec 2014 22:51:47 +0000 |
In the Texinfo manual, under "Macro Details", there is this example:
@macro linemac
@cindex whatever @c
@end macro
...
foo
@linemac
bar
It states:
Without the '@c', there will be a unwanted blank line between the
'@cindex whatever' and the 'bar' (one newline comes from the macro
definition, one from after the invocation), causing an unwanted
paragraph break.
However, I tried it without the @c and didn't get a paragraph break. A
test Texinfo file and the Info output file are attached.
The statement that "one newline comes from the macro definition"
appears to be incorrect. From the "Defining Macros" node in the
manual:
The newline characters after the '@macro' line and before the '@end
macro' line are ignored, that is, not included in the macro body.
This implies that the last line of a macro body doesn't have a newline
at the end when it is expanded. Hence "@linemac" expands to "@cindex
whatever" without a newline at the end.
macro.info
Description: Binary data
macro.texi
Description: TeXInfo document
- Effect of newline in macro definition,
Gavin Smith <=