# False lacheck Unmatched "{" Error

In the simple LaTeX file:

\documentclass{report}

\newcommand{\defaultleftmargin}{0.25in}

\begin{document}
\end{document}


I get the following errors with lacheck:

"hw01.tex", line 5: <- unmatched "end of file hw01.tex"
"hw01.tex", line 2: -> unmatched "{"


This is reported by Vim's syntastic running lacheck ver. $Id: lacheck.lex,v 1.26 1998/03/07 07:46:45 abraham Exp$ on MacOS High Seirra. The issue only seems to arise when \newcommand is followed by {\def*} (where * is zero or more other characters). Removal of the curly brackets around \def* or any term other than def causes the issue to go away.

I found an old bug report regarding a similar issue. I did not see any talk of a fix. Is this a bug or is there something I am missing?

Edit: The issue appears to not be limited to newcommand. I get the same error for the line:

\setlength{\oddsidemargin}{\defaultleftmargin}

• I get the same. Maybe you should report it to the maintainers of lacheck as a bug
– DG'
Jan 24, 2019 at 7:04
• use \newcommand\defaultleftmargin{0.25in} then there will be no error. Same for \newlength
– user2478
Jan 24, 2019 at 8:37
• @Herbert still a strange bug, as the syntax for both is fine. Jan 24, 2019 at 10:01
• @Herbert, I mentioned in the original question removing the curly brackets makes the warning go away. I assume the error is raised for a reason (unless it is a straight bug). If it is a bug, I expect it would have been reported earlier (other than one post on a Debian forum). I will write to TeXlive and update when I hear more. Jan 25, 2019 at 3:02
• Updating mactex (via brew) did not fix the issue. I reported it to the TexLive folks as a bug. Jan 25, 2019 at 3:20