I have now tried

@uSubSec{@value{SecLb}, Probabilistic Characterisation of^?
Microseismicity}

But this is giving me the following output in my pdf file.
As seen, the ^? is being printed

B Probabilistic Characterisation of^?
Microseismicity

And the Table of Contents is showing

B Probabilistic Characterisation of^?\par Microseismicity . . . . . . . . 5




> Sent: Saturday, October 03, 2020 at 12:18 PM
> From: "Gavin Smith" <gavinsmith0...@gmail.com>
> To: "Christopher Dimech" <dim...@gmx.com>
> Cc: "help-texinfo gnu" <help-texinfo@gnu.org>
> Subject: Re: Macro introduces \par in Table of Contents
>
> On Sat, Oct 3, 2020 at 9:20 AM Christopher Dimech <dim...@gmx.com> wrote:
> >
> >
> > I have written the macro uSubSec
> >
> > However I have found that a \par is introduced in the Table of Contents
> > when the title continues on the next line. How can this problem be solved?
> >
> > Example:
> >
> > @uSubSec{@value{SecLb}, Probabilistic Characterisation of
> > Microseismicity}
> >
> > @macro uSubSec{label, titl}
> >
> >   @set lb \label\
> >   @ifclear USubSec--No--Label
> >     @unnumberedsubsec @value{lb} @ \titl\
> >   @end ifclear
> >
> >   @ifset USubSec--No--Label
> >     @unnumberedsubsec \titl\
> >   @end ifset
> >
> > @end macro
>
> Your input does not work with texi2any either, although in that case
> the part of the argument on the next line is not even included in the
> argument to @unnumberedsubsec. Hence, I do not think that this should
> be made to work with TeX.
>
> The best solution I've come up with is to use DEL as a comment
> character. (I've never seen a use for this before!)
>
> \input texinfo
>
> @macro uSubSec{label, titl}
>
>   @set lb \label\
>     @unnumberedsubsec @value{lb} @ \titl\
>
> @end macro
>
>
> @uSubSec{@value{SecLb}, Probabilistic ^?
> Characterisation of Microseismicity}
>
>
> where ^? is the DEL character (byte value 0x7f). This appears to work
> perfectly with both texinfo.tex and texi2any.
>
> I found that starting a new line, like
>
> @uSubSec{@value{SecLb},
> Probabilistic Characterisation of Microseismicity}
>
> worked with texi2any, but not with TeX.
>
> As usual with macro handling in Texinfo, this is not easy to fix, and
> any fix risks breaking something else. There is an @xeatspaces macro
> being used around macro arguments that is not being expanded until
> quite late on, which might be better expanded earlier with a given
> value of active newline, but it would be very complicated if not
> impossible to expand this earlier without fully expanding the macro
> arguments at the same time (probably some complex arrangement of
> \expandafter's which would differ depending on the number of macro
> arguments, or repeatedly reading the argument text as a macro argument
> and moving expanded arguments one by one to the end). Even if it's
> possible it's probably better not to try as it would be error-prone
> and hard to understand after the fact.
>
> Another option was changing the definition of active newline away from
> @par to a space or an empty string, but this broke using a macro
> inside an environment like @example.
>

Reply via email to