[Tex/LaTex] How to make “claim” environments look like “theorem” environment

environmentslyxtheorems

I am using LyX 2.0.5 with document class article and 'Theorems (AMS)' in the modules. From what I understand, the claim environment copies its style from the remark environment. I'd like it to copy the style of the theorem environment instead. Namely, have the word claimF typeset in bold instead of in italics, as it is now.

Is there a way to do this in LyX?

Best Answer

Define a new module

There may be other (easier) ways, but you can create a new module, based on the existing one. It's not a lot of work, you just have to copy and rename some files, then do some small modifications to them:

  1. Go to the LyX system directory, and from the layouts folder copy the two files theorems-ams.module and theorems-ams.inc, and paste them into the LyX user directory. (To find the path to these two directories, open LyX and do Help --> About LyX.)

  2. Rename both files in the User directory, to for example theorems-ams-new.module and theorems-ams-new.inc. Doesn't matter what the filename is, just something other than the original.

  3. Open the theorems-ams-new.module and make two changes:

    1. In the first line, change the name of the module, i.e. from

      #\DeclareLyXModule{Theorems (AMS)}
      

      to

      #\DeclareLyXModule{Theorems (AMS) modified}
      
    2. Further down, change

      Input theorems-ams.inc
      

      to

      Input theorems-ams-new.inc
      

      I.e., the filename should be same as the other file you just renamed.

  4. Open theorems-ams-new.inc, and find the definition of the Claim environment (lines 257-271, in my version). There are two changes you should make.

    1. In the second line of the definition, change the CopyStyle from Remark to Theorem (optionally Definition, see below). This defines how it is rendered in LyX.

    2. In the sixth line of the definition, change

      \theoremstyle{remark}
      

      to

      \theoremstyle{plain}
      

      This changes how it is rendered in the PDF. The plain style typesets the 'heading' in bold font, and the body in italics, just like theorems. If you wish to have the body of the claim in roman font, use \theoremstyle{definition} instead. In this case you would probably also like to use CopyStyle Definition, as mentioned above.

Having done these modifications, you may need to reconfigure (Tools --> Reconfigure) and restart LyX. Now, instead of loading the 'Theorems (AMS)' module, load your own 'Theorems (AMS) modified'.

Using Local layout.

If this is a modification you need for just a single document, you can use Document --> Settings --> Local layout instead. Copy the entire definition of Claim to the Local layout, and do the changes described in point 4 above.