lacheck is confused when curly brackets are inside a \newcommand

Lars Madsen daleif at math.au.dk
Tue Apr 26 09:08:30 CEST 2022


I would have hoped that it complained a lot more from

    \newcommand{\boldx}[1]{{\bf #1}}

\bf has been depreciated syntax since 1993!



Lars Madsen
Programmør

Institut for Matematik
Aarhus Universitet

person.au.dk/daleif at math<https://person.au.dk/daleif@math>

________________________________
From: tex-live <tex-live-bounces+daleif=imf.au.dk at tug.org> on behalf of Michael Clark <clark.michael.c at gmail.com>
Sent: 25 April 2022 23:37
To: tex-live at tug.org <tex-live at tug.org>
Subject: lacheck is confused when curly brackets are inside a \newcommand

Example latex file (foo.tex):

    \newcommand{\boldx}[1]{{\bf #1}}
    \newcommand{\ibx}[1]{\textbf{\textit{#1}}}

lacheck output:

    "foo.tex", line 1: <- unmatched "}"
    "foo.tex", line 1: -> unmatched "beginning of file foo.tex"
    "foo.tex", line 2: <- unmatched "}"
    "foo.tex", line 1: -> unmatched "beginning of file foo.tex"

I pulled the example commands from
https://www.physicsread.com/latex-bold/ showing two useful cases. One,
using a command inside of a newcommand, and the other creates a group
to isolate the scope of the command to the included text.

Replacing \newcommand with \newcommand* reports no error as expected.
If an error is expected behavior for \newcommand, it would be nice if
the error message were more clear, as the brackets are correctly
matched.

Thank you for maintaining this tool. I'd need to devote longer than I
have to figure out where to go from line 391 of lacheck.l
(https://tug.org/svn/texlive/trunk/Build/source/utils/lacheck/lacheck.l?view=markup#l391).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex-live/attachments/20220426/bb3654b5/attachment.html>


More information about the tex-live mailing list.