area/language-latex

eqnarray and \rm highlighted red?

Closed this issue · 4 comments

adrn commented

Prerequisites

  • Put an X in this box if you have done the following:
    • Ensured the issue has not already been raised
    • Ensured the issue is caused by this package
    • Run atom --safe, activated this package, and the issue persisted

Description

See images below: I'm using the language-latex for editing latex documents. Overall works very nicely, but both eqnarray and \rm are highlighted red for reasons I don't understand (no error messages are shown).

image

image

Steps to reproduce & Minimum working example

  1. Type \begin{eqnarray} or {\rm x}

Because you shouldn’t use them. They are deprecated and objectively bad choices. This is part of this package by design.

By the way, most themes use a yellow colour for deprecated syntax, and reserve red for invalid syntax.

A bit information on why those are discouraged. The two-letter font commands like \rm are not NFSS compliant and therefore have some defects (e.g., you cannot nest these commands and \it has no italic correction). The eqnarray environments produces wrong spaces around the delimiter and incorrect equation numberings.

Here are some references that explain the deprecation in more detail:

adrn commented

Thanks for the context @yudai-nkt. Strangely, some of the journals in my field (astrophysics) still recommend using \rm for, e.g., writing numbers with units where the unit abbreviations shouldn't be math text, so I wasn't aware of the deprecation.

@adrn Yout might try siunitx if the journal will allow it. It does an excellent job at units in my experience.