Skip to content

[BUG]: codebook "checks" lots of latex keywords #303

Description

@francescomalandrino

Issue Description

Hello! The github homepage sais that issues about latex are welcome, so, here I am ;)

Codebook checks/marks several words that are, in fact, LaTeX commands, both when used through Zed's extension and when called as a standalone executable (codebook-lsp lint myfile.tex). Examples I encountered:

  • arguments to command \documentclass
    \documentclass[journal,compsoc]{IEEEtran}
  • arguments to command \DeclareMathOperator
    \DeclareMathOperator{\FDD}{FDD}
  • commands \IEEEmembership, \IEEEcompsocthanksitem, \IEEEcompsocitemizethanks, \maketitle,
  • several commands used in math mode, e.g., \mathrm, \nonumber, \mbox, \mathsf (but I think nothing between $...$ or inside equation, eqnarray, multline... should be checked)
  • environments eqnarray, multline, IEEEkeywords, IEEEproof (but I think nothing that is an argument of \begin or \end shall be checked)
  • user-defined commands, e.g., \Mcal
  • arguments to \cite (they are bibtex labels, usually have no meaning)
  • keyword \columnwidth (then I also guess \pagewidth, \textwidth and related)
  • arguments to \ref commands

Hope this is, in fact, welcome, and that it helps!

Operating System

macOS

Editor

Zed

Codebook Version

0.3.42

Configuration

none

Steps to Reproduce

check this example

\documentclass[journal,compsoc]{IEEEtran}
\DeclareMathOperator{\FDD}{FDD}
\author{Name,\IEEEmembership{SeniorMember,IEEE,}
the solution presented in
\cite{sallam2021joint}, solving the placement problem with a competitive ratio of~$\frac{1}{2} \left ( 1-\frac{1}{\mathrm{e}} \right )$.
\begin{property}
The task-specific derivation procedure in \Alg{derive} has polynomial worst-case computational complexity.
\label{prop:poly}
\end{property}
\begin{equation}
\label{eq:obj}
\min_{\Mcal \in \Fc}
{ c( \Mcal ) :
\mbox{Eqs.}~ (\ref{eq:delayconstraint})
( \ref{eq:memoryconstraint} )
\mbox{and}(\ref{eq:qualityconstraint} )
}.
\end{equation}
\includegraphics[width=.9\columnwidth]{img/steps2.pdf}

Expected Behavior

no issues should be marked

Actual Behavior

plenty of issues are marked

codebook-lsp lint examples.tex
No config found, using default config

examples.tex
examples.tex:1:24 compsoc
examples.tex:2:28 FDD
examples.tex:3:16 IEE
examples.tex:3:19 Emembership
examples.tex:4:33 sallam
examples.tex:4:142 mathrm
examples.tex:11:8 Mcal
examples.tex:13:2 mbox
examples.tex:15:3 mbox
examples.tex:13:7 Eqs
examples.tex:18:27 columnwidth

Code Sample


Log Output

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions