[Tex/LaTex] How to change the year in Mathematics Subject Classification in an AMS article in LyX

amsartlyx

There's a new revision
of the Mathematics Subject Classification scheme that was released recently this year (2020). However, when inserting a subjectclass in LyX to an amsart document, LyX outputs the following:

2000 Mathematics Subject Classification

The Code Preview Pane shows the following read-only TeX code:

\subjclass[2000]{Primary 60-01, 62-01; Secondary 05-01.}

LyX decided that I'm using the 2000 revision (whether it matters or not), and I don't know how to change this. I attempted to insert [2020] in RET (Red Evil Text, which is how the LyX wiki refers to raw TeX code) inside and after the sujbectclass, but it didn't work. I couldn't find any special item to insert in the context menu like with theorems.

Best Answer

One way to change the LaTeX command is to override the layout with a "local layout". I give a simple solution here and a larger explanation afterwards:

  1. Go to Document > Settings > Local Layout
  2. Paste in the following (adapt as desired):
Style Subjectclass
    CopyStyle             Address
    LatexName             subjclass[2020]
    LabelString           "2020 Mathematics Subject Classification:"
End
  1. Click on "Validate".
  2. Click on "OK".

A longer explanation on how to find what you should paste into your local layout:

  1. Go to Help > About LyX and find your "Library directory".
  2. Navigate to your library directory and search for a file that contains the word "subjclass". For example, on Linux, you can do use the command grep -IR "subjclass" *. This returns the file named layouts/amsdefs.inc.
  3. Open layouts/amsdefs.inc in a text editor and copy the layout that contains the subjclass string.

Note that you could edit the file layouts/amsdefs.inc directly and it would work. The advantage of putting it in your local layout is that if you compile the LyX file on a different system, you will get your desired output because the local layout is saved with the file.

For more information on layouts, see Help > Customization. It is a long and at times dry read, but if you plan on using LyX for a while, you will find it useful to know the details in there.

EDIT (thanks to Tamar's comment): we still need to add the following segment, which Carlisle posted, in the preamble, so that amsart would permit the year of 2020:

\makeatletter
\@namedef{subjclassname@2020}{%
  \textup{2020} Mathematics Subject Classification}
\makeatother

To do that in LyX, go to Document > Settings and paste the above into the preamble and then click "OK".