LyXtheorem numbering

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
CSMR
Posts: 44
Joined: Fri Oct 10, 2008 10:44 pm

theorem numbering

Post by CSMR »

Hello. Liking LyX so far! (LyX 1.6RC3)
My first question is about theorem numbering.
I want theorem types: theorem, proposition, assumption, definition, corollary, lemma,...
I want them to be numbered independently.
When I use Theorems (AMS) and Theorems (AMS-Extended) they are numbered jointly (assumption 1, definition 2, theorem 3,...).
One solution would be to remove Theorems (AMS-Extended) and define my own. But that does not seem to be working.
Here is the code:

Code: Select all

\usepackage{amsthm}
\usepackage{amssymb}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{equation}{section} %% Comment out for sequentially-numbered
\numberwithin{figure}{section} %% Comment out for sequentially-numbered
\theoremstyle{plain}
\theoremstyle{plain}
\newtheorem{thm}{Theorem}
  \theoremstyle{plain}
  \newtheorem{assumption}[thm]{Assumption}
  \theoremstyle{plain}
  \newtheorem{fact}[thm]{Fact}
  \theoremstyle{definition}
  \newtheorem{defn}[thm]{Definition}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\newtheorem{userdefined}{Userdefined}
Because of the silly [thm] tags in the definitions the numbering is wrong. But that part is lyx-generated so I can't edit it.
The problem is my "\newtheorem{userdefined}{userdefined}" does not seem to be working: it doesn't seem to create the theorem class, despite looking just like the others in the latex code. (\theoremstyle makes no difference)

What is the solution?
Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

CSMR
Posts: 44
Joined: Fri Oct 10, 2008 10:44 pm

Re: theorem numbering

Post by CSMR »

Any ideas?
How to change numbering system or how to define new theorem types?
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

theorem numbering

Post by Juanjo »

I am not a LyX user, but after playing a bit with Lyx 1.5.6 (the last release on Mac), I think I can figure out which is your problem. Each class defines a series of theorem-like environments which can be easily accessed through the pulling menu on the top left corner of the window (together with standard, itemize, enumerate, part, section,...) Suppose that a given class provides the environments "Theorem" and "Lemma" sharing numbering. You cannot modify this... without tweeking inside the class file. At most, if numbering is reset in each section, you can get to reset it in each chapter or not to reset it at all in the whole document. Of course, you can define your own environments. The code appearing in your post for "userdefined" is correct and works. I don't know if it is possible to include user defined environments in the pulling menu. In any case, you can use it through ERT, writting, say:

Code: Select all

\begin{userdefined}This is my own theorem-like environment \end{userdefined}
This is not comfortable, but it works.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
CSMR
Posts: 44
Joined: Fri Oct 10, 2008 10:44 pm

Re: theorem numbering

Post by CSMR »

Thanks for the info. That's unfortunate. Hopefully the menu issue will be fixed in a later version.
User avatar
Maksi
Posts: 52
Joined: Sun Mar 16, 2008 12:12 pm

theorem numbering

Post by Maksi »

I am not using the 1.6.x-version yet, but that sounds like something that will be much easier in the future thanks to layout modules
A Humanities user of LaTeX :)
CSMR
Posts: 44
Joined: Fri Oct 10, 2008 10:44 pm

theorem numbering

Post by CSMR »

Maksi wrote:I am not using the 1.6.x-version yet, but that sounds like something that will be much easier in the future thanks to layout modules
You may as well use 1.6; they have just released the windows installer for the 4th release candidate.
The problems were with the Theorems modules (standard, AMS, and extended), but probably can be fixed by editing these layout modules.
Post Reply