lacheck is confused when curly brackets are inside a \newcommand
Michael Clark
clark.michael.c at gmail.com
Mon Apr 25 23:37:27 CEST 2022
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).
More information about the tex-live
mailing list.