Re: Using a macro makes pdfetex quits and exits with bad status

Gavin Smith <[email protected]>
Newsgroups gmane.comp.tex.texinfo.general
Message-ID <CAKPWYQ2X=yUEf2Q74pr+VjeozsNSA61DjE1H6WM=+SgSGygUGw@mail.gmail.com>
On Tue, Jun 22, 2021 at 6:53 PM Christopher Dimech <[email protected]> wrote:
>
> @macro usubsec {label, titl}
>
> @set lb \label\
> @set tl \titl\
> @ifclear usubsec-no-label
>    @unnumberedsubsec @value{lb} @ @value{tl}
> @end ifclear
>
> @ifset usubsec-no-label
>   @unnumberedsubsec @value{tl}
> @end ifset
>
> @end macro
>

This appears to work OK?

Eli gave you good advice about putting the macro definition inside the
conditionals rather than the other way around although I don't know if
that is part of the problem here.

I remember you had problems with newlines in macro arguments before
but I thought we had fixed them. It wouldn't be surprising if there
were still problems though.

$ pdfetex test.texi
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian)
(preloaded format=pdfetex)
 restricted \write18 enabled.
entering extended mode
(./test.texi (./texinfo.tex Loading texinfo [version 2021-04-25.21]: pdf,
fonts, glyphs, page headings, tables, conditionals, indexing, sectioning, toc,
environments, defuns, macros, cross references, insertions, (./epsf.tex
This is `epsf.tex' v2.7.4 <14 February 2011>
) localization, formatting, and turning on texinfo input format.) [1{/var/lib/t
exmf/fonts/map/pdftex/updmap/pdftex.map}] )</usr/share/texlive/texmf-dist/fonts
/type1/public/amsfonts/cm/cmbx12.pfb>
Output written on test.pdf (1 page, 13595 bytes).
Transcript written on test.log.
test.texi (text/x-texinfo, 369 B)
\input texinfo

@macro usubsec {label, titl}

@set lb \label\
@set tl \titl\
@ifclear usubsec-no-label
   @unnumberedsubsec @value{lb} @ @value{tl}
@end ifclear

@ifset usubsec-no-label
  @unnumberedsubsec @value{tl}
@end ifset

@end macro

@usubsec{16D,
Utilisation of Rapid Computations}

@set usubsec-no-label

@usubsec{16D,
Utilisation of Rapid Computations}

@bye
test.pdf (application/pdf, 13.3 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.